]> icculus.org git repositories - btb/d2x.git/blob - ChangeLog-old
e39f222e7c68d37702b41a3688ade08dadec6b8e
[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/linear.asm:
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  * Revision 2.6  1995/03/29  11:19:32  john
1056  * Added broadcasting over a net.
1057  * 
1058  * Revision 2.5  1995/03/28  20:04:43  john
1059  * Took away alternate server stuff.
1060  * 
1061  * Revision 2.4  1995/03/23  19:00:10  john
1062  * Added user list capabitly.
1063  * 
1064  * Revision 2.3  1995/03/23  12:26:57  john
1065  * Move IPX into bios lib.
1066  * 
1067  * Revision 2.2  1995/03/22  19:08:14  john
1068  * Added code to fix sending packets over router... now
1069  * we just need to make broadcasts go over router!!
1070  * 
1071  * Revision 2.1  1995/03/21  08:39:56  john
1072  * Ifdef'd out the NETWORK code.
1073  * 
1074  * Revision 2.0  1995/02/27  11:30:16  john
1075  * New version 2.0, which has no anonymous unions, builds with
1076  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1077  * 
1078  * Revision 1.16  1995/02/16  17:34:52  john
1079  * Added code to allow dynamic socket changing.
1080  * 
1081  * Revision 1.15  1995/01/04  21:43:27  rob
1082  * Remove SPX size definition.
1083  * 
1084  * Revision 1.14  1995/01/03  13:46:18  john
1085  * Added code that should make ipx work over different servers,
1086  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
1087  * this, and I hope it doesn't introduce net bugs.
1088  * 
1089  * Revision 1.13  1994/11/02  11:37:16  rob
1090  * Changed default socket number to a higher regions.
1091  * 
1092  * Revision 1.12  1994/11/01  15:56:51  rob
1093  * Added defines for SPX socketsx.
1094  * 
1095  * Revision 1.11  1994/10/31  19:23:31  rob
1096  * Added a prototype for the new object send function.
1097  * 
1098  * Revision 1.10  1994/09/07  13:37:25  john
1099  * Changed default socket to 0x4000, because 
1100  * the ipx/spx book says that we can only use
1101  * sockets 0x4000 - 0x7fff.
1102  * 
1103  * Revision 1.9  1994/08/25  18:14:45  matt
1104  * Changed socket because of packet change
1105  * 
1106  * Revision 1.8  1994/08/12  22:42:24  john
1107  * Took away Player_stats; added Players array.
1108  * 
1109  * Revision 1.7  1994/08/09  19:31:47  john
1110  * Networking changes.
1111  * 
1112  * Revision 1.6  1994/08/05  16:11:46  john
1113  * Psuedo working version of networking.
1114  * 
1115  * Revision 1.5  1994/08/04  19:17:20  john
1116  * Inbetween version of network stuff.
1117  * 
1118  * Revision 1.4  1994/07/29  16:08:59  john
1119  * *** empty log message ***
1120  * 
1121  * Revision 1.3  1994/07/25  12:33:22  john
1122  * Network "pinging" in.
1123  * 
1124  * Revision 1.2  1994/07/20  15:58:29  john
1125  * First installment of ipx stuff.
1126  * 
1127  * Revision 1.1  1994/07/19  15:43:05  john
1128  * Initial revision
1129
1130 ------------------------------------------------------------------------
1131 arch/dos/joy.c:
1132
1133  * Revision 1.37  1995/10/07  13:22:31  john
1134  * Added new method of reading joystick that allows higher-priority
1135  * interrupts to go off.
1136  * 
1137  * Revision 1.36  1995/03/30  11:03:40  john
1138  * Made -JoyBios read buttons using BIOS.
1139  * 
1140  * Revision 1.35  1995/02/14  11:39:25  john
1141  * Added polled/bios joystick readers..
1142  * 
1143  * Revision 1.34  1995/02/10  17:06:12  john
1144  * Fixed bug with plugging in a joystick not getting detected.
1145  * 
1146  * Revision 1.33  1995/01/27  16:39:42  john
1147  * Made so that if no joystick detected, it wont't
1148  * read buttons.
1149  * 
1150  * Revision 1.32  1995/01/12  13:16:40  john
1151  * Made it so that joystick can't lose an axis
1152  * by 1 weird reading. Reading has to occurr during
1153  * calibration for this to happen.
1154  * 
1155  * Revision 1.31  1994/12/28  15:56:03  john
1156  * Fixed bug that refused to read joysticks whose 
1157  * min,cen,max were less than 100 apart.
1158  * 
1159  * Revision 1.30  1994/12/28  15:31:53  john
1160  * Added code to read joystick axis not all at one time.
1161  * 
1162  * Revision 1.29  1994/12/27  15:44:36  john
1163  * Made the joystick timeout be at 1/100th of a second, 
1164  * regardless of CPU speed.
1165  * 
1166  * Revision 1.28  1994/12/04  11:54:54  john
1167  * Made stick read at whatever rate the clock is at, not
1168  * at 18.2 times/second.
1169  * 
1170  * Revision 1.27  1994/11/29  02:25:40  john
1171  * Made it so that the scaled reading returns 0 
1172  * if the calibration factors look funny..
1173  * 
1174  * Revision 1.26  1994/11/22  11:08:07  john
1175  * Commented out the ARCADE joystick.
1176  * 
1177  * Revision 1.25  1994/11/14  19:40:26  john
1178  * Fixed bug with no joystick being detected.
1179  * 
1180  * Revision 1.24  1994/11/14  19:36:40  john
1181  * Took out initial cheapy calibration.
1182  * 
1183  * Revision 1.23  1994/11/14  19:13:27  john
1184  * Took out the calibration in joy_init
1185  * 
1186  * Revision 1.22  1994/10/17  10:09:57  john
1187  * Made the state look at last_State, so that a joy_flush
1188  * doesn't cause a new down state to be added next reading.
1189  * 
1190  * Revision 1.21  1994/10/13  11:36:23  john
1191  * Made joy_down_time be kept track of in fixed seconds,
1192  * not ticks.
1193  * 
1194  * Revision 1.20  1994/10/12  16:58:50  john
1195  * Fixed bug w/ previous comment.
1196  * 
1197  * Revision 1.19  1994/10/12  16:57:44  john
1198  * Added function to set a joystick button's state.
1199  * 
1200  * Revision 1.18  1994/10/11  10:20:13  john
1201  * Fixed Flightstick Pro/
1202  * ..
1203  * 
1204  * Revision 1.17  1994/09/29  18:29:20  john
1205  * *** empty log message ***
1206  * 
1207  * Revision 1.16  1994/09/27  19:17:23  john
1208  * Added code so that is joy_init is never called, joystick is not
1209  * used at all.
1210  * 
1211  * Revision 1.15  1994/09/22  16:09:23  john
1212  * Fixed some virtual memory lockdown problems with timer and
1213  * joystick.
1214  * 
1215  * Revision 1.14  1994/09/16  11:44:42  john
1216  * Fixed bug with slow joystick.
1217  * 
1218  * Revision 1.13  1994/09/16  11:36:15  john
1219  * Fixed bug with reading non-present channels.
1220  * 
1221  * Revision 1.12  1994/09/15  20:52:48  john
1222  * rme john
1223  * Added support for the Arcade style joystick.
1224  * 
1225  * Revision 1.11  1994/09/13  20:04:49  john
1226  * Fixed bug with joystick button down_time.
1227  * 
1228  * Revision 1.10  1994/09/10  13:48:07  john
1229  * Made all 20 buttons read.
1230  * 
1231  * Revision 1.9  1994/08/31  09:55:02  john
1232  * *** empty log message ***
1233  * 
1234  * Revision 1.8  1994/08/29  21:02:14  john
1235  * Added joy_set_cal_values...
1236  * 
1237  * Revision 1.7  1994/08/29  20:52:17  john
1238  * Added better cyberman support; also, joystick calibration
1239  * value return funcctiionn,
1240  * 
1241  * Revision 1.6  1994/08/24  18:53:12  john
1242  * Made Cyberman read like normal mouse; added dpmi module; moved
1243  * mouse from assembly to c. Made mouse buttons return time_down.
1244  * 
1245  * Revision 1.5  1994/07/14  22:12:23  john
1246  * Used intrinsic forms of outp to fix vmm error.
1247  * 
1248  * Revision 1.4  1994/07/07  19:52:59  matt
1249  * Made joy_init() return success/fail flag
1250  * Made joy_init() properly detect a stick if one is plugged in after joy_init()
1251  * was called the first time.
1252  * 
1253  * Revision 1.3  1994/07/01  10:55:55  john
1254  * Fixed some bugs... added support for 4 axis.
1255  * 
1256  * Revision 1.2  1994/06/30  20:36:55  john
1257  * Revamped joystick code.
1258  * 
1259  * Revision 1.1  1994/06/30  15:42:15  john
1260  * Initial revision
1261
1262 ------------------------------------------------------------------------
1263 arch/dos/joydefs.c:
1264
1265  * Revision 2.2  1995/06/30  12:30:22  john
1266  * Added -Xname command line.
1267  * 
1268  * Revision 2.1  1995/04/06  12:13:20  john
1269  * Made so you can calibrate Gravis Gamepad.
1270  * 
1271  * Revision 2.0  1995/02/27  11:30:27  john
1272  * New version 2.0, which has no anonymous unions, builds with
1273  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1274  * 
1275  * Revision 1.71  1995/02/12  02:06:10  john
1276  * Fixed bug with joystick incorrectly asking for
1277  * calibration.
1278  * 
1279  * Revision 1.70  1995/01/28  15:58:07  john
1280  * Made joystick calibration be only when wrong detected in
1281  * menu or joystick axis changed.
1282  * 
1283  * Revision 1.69  1995/01/25  14:37:55  john
1284  * Made joystick only prompt for calibration once...
1285  * 
1286  * Revision 1.68  1995/01/24  16:34:29  john
1287  * Made so that if you reconfigure joystick and
1288  * add or subtract an axis, it asks for a recalibration
1289  * upon leaving.
1290  * 
1291  * Revision 1.67  1994/12/29  11:08:51  john
1292  * Fixed Thrustmaster and Logitech Wingman extreme
1293  * Hat by reading the y2 axis during the center stage
1294  * of the calibration, and using 75, 50, 27, and 3 %
1295  * as values for the 4 positions.
1296  * 
1297  * Revision 1.66  1994/12/15  18:17:39  john
1298  * Fixed warning with previous.
1299  * 
1300  * Revision 1.65  1994/12/15  18:15:48  john
1301  * Made the joy cal only write the .cfg file, not
1302  * the player file.
1303  * 
1304  * Revision 1.64  1994/12/13  14:43:35  john
1305  * Took out the code in kconfig to build direction array.
1306  * Called kc_set_controls after selecting a new control type.
1307  * 
1308  * Revision 1.63  1994/12/10  12:08:47  john
1309  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
1310  * 
1311  * Revision 1.62  1994/12/09  11:01:07  mike
1312  * force calibration of joystick on joystick selection from Controls... menu.
1313  * 
1314  * Revision 1.61  1994/12/07  21:50:27  john
1315  * Put stop/start time around joystick delay.
1316  * 
1317  * Revision 1.60  1994/12/07  19:34:39  john
1318  * Added delay.
1319  * 
1320  * Revision 1.59  1994/12/07  18:12:14  john
1321  * NEatened up joy cal.,
1322  * 
1323  * Revision 1.58  1994/12/07  17:07:51  john
1324  * Fixed up joy cal.
1325  * 
1326  * Revision 1.57  1994/12/07  16:48:53  yuan
1327  * localization
1328  * 
1329  * Revision 1.56  1994/12/07  16:05:55  john
1330  * Changed the way joystick calibration works.
1331  * 
1332  * Revision 1.55  1994/12/06  20:15:22  john
1333  * Took out code that unpauses songs that were never paused.
1334  * 
1335  * Revision 1.54  1994/12/06  15:14:09  yuan
1336  * Localization
1337  * 
1338  * Revision 1.53  1994/12/05  16:29:16  john
1339  * Took out music pause around the cheat menu.
1340  * 
1341  * Revision 1.52  1994/12/04  12:39:10  john
1342  * MAde so that FCS calibration doesn't ask for axis #2.
1343  * 
1344  * Revision 1.51  1994/12/03  15:14:59  john
1345  * Took out the delay mentioned previosuly cause it would
1346  * cause bigger problems than it helps, especially with netgames.
1347  * 
1348  * Revision 1.50  1994/12/03  14:16:14  john
1349  * Put a delay between screens in joy cal to keep Yuan from
1350  * double hitting.
1351  * 
1352  * Revision 1.49  1994/12/03  11:04:06  john
1353  * Changed newmenu code a bit to fix bug with bogus
1354  * backgrounds occcasionally.
1355  * 
1356  * Revision 1.48  1994/12/02  11:03:44  yuan
1357  * Localization.
1358  * 
1359  * Revision 1.47  1994/12/02  10:50:33  yuan
1360  * Localization
1361  * 
1362  * Revision 1.46  1994/12/01  12:21:59  john
1363  * Added code to calibrate 2 joysticks separately.
1364  * 
1365  * Revision 1.45  1994/12/01  11:52:31  john
1366  * Added message when you select FCS to say that if
1367  * you have WCS, see manuel.
1368  * 
1369  * Revision 1.44  1994/11/29  02:26:28  john
1370  * Made the prompts for upper-left, lower right for joy
1371  * calibration more obvious.
1372  * 
1373  * Revision 1.43  1994/11/26  13:13:59  matt
1374  * Changed "none" option to "keyboard only"
1375  * 
1376  * Revision 1.42  1994/11/21  19:35:13  john
1377  * Replaced calls to joy_init with if (joy_present)
1378  * 
1379  * Revision 1.41  1994/11/21  19:28:34  john
1380  * Changed warning for no joystick to use nm_messagebox..
1381  * 
1382  * Revision 1.40  1994/11/21  19:06:25  john
1383  * Made it so that it only stops sound when your in game mode. 
1384  * 
1385  * Revision 1.39  1994/11/21  11:47:18  john
1386  * Made sound pause during joystick calibration.
1387  * 
1388  * Revision 1.38  1994/11/10  20:34:18  rob
1389  * Removed menu-specific network mode support in favor in new stuff
1390  * in newmenu.c
1391  * 
1392  * Revision 1.37  1994/11/08  21:21:38  john
1393  * Made Esc exit joystick calibration.
1394  * 
1395  * Revision 1.36  1994/11/08  15:14:42  john
1396  * Added more calls so net doesn't die in net game.
1397  * 
1398  * Revision 1.35  1994/11/08  14:59:12  john
1399  * Added code to respond to network while in menus.
1400  * 
1401  * Revision 1.34  1994/10/24  19:56:32  john
1402  * Made the new user setup prompt for config options.
1403  * 
1404  * Revision 1.33  1994/10/22  14:11:52  mike
1405  * Suppress compiler warning message.
1406  * 
1407  * Revision 1.32  1994/10/19  12:44:24  john
1408  * Added hours field to player structure.
1409  * 
1410  * Revision 1.31  1994/10/17  13:07:13  john
1411  * Moved the descent.cfg info into the player config file.
1412  * 
1413  * Revision 1.30  1994/10/13  21:41:12  john
1414  * MAde Esc exit out of joystick calibration.
1415  * 
1416  * Revision 1.29  1994/10/13  19:22:27  john
1417  * Added separate config saves for different devices.
1418  * Made all the devices work together better, such as mice won't
1419  * get read when you're playing with the joystick.
1420  * 
1421  * Revision 1.28  1994/10/13  11:40:18  john
1422  * Took out warnings.
1423  * 
1424  * Revision 1.27  1994/10/13  11:35:23  john
1425  * Made Thrustmaster FCS Hat work.  Put a background behind the
1426  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
1427  * menu to new menu. Made F6 be calibrate joystick.
1428  * 
1429  * Revision 1.26  1994/10/11  21:29:03  matt
1430  * Made a bunch of menus have good initial selected values
1431  * 
1432  * Revision 1.25  1994/10/11  17:08:39  john
1433  * Added sliders for volume controls.
1434  * 
1435  * Revision 1.24  1994/10/10  17:59:21  john
1436  * Neatend previous.
1437  * 
1438  * Revision 1.23  1994/10/10  17:57:59  john
1439  * Neatend previous.
1440  * 
1441  * Revision 1.22  1994/10/10  17:56:11  john
1442  * Added messagebox that tells that config has been saved.
1443  * 
1444  * Revision 1.21  1994/09/30  12:37:26  john
1445  * Added midi,digi volume to configuration.
1446  * 
1447  * Revision 1.20  1994/09/22  16:14:14  john
1448  * Redid intro sequecing.
1449  * 
1450  * Revision 1.19  1994/09/19  18:50:15  john
1451  * Added switch to disable joystick.
1452  * 
1453  * Revision 1.18  1994/09/12  11:47:36  john
1454  * Made stupid cruise work better.  Make kconfig values get
1455  * read/written to disk.
1456  * 
1457  * Revision 1.17  1994/09/10  15:46:47  john
1458  * First version of new keyboard configuration.
1459  * 
1460  * Revision 1.16  1994/09/06  19:35:44  john
1461  * Fixed bug that didn';t load new size .cal file.
1462  * 
1463  * Revision 1.15  1994/09/06  14:51:58  john
1464  * Added sensitivity adjustment, fixed bug with joystick button not
1465  * staying down.
1466  * 
1467  * Revision 1.14  1994/09/02  16:13:47  john
1468  * Made keys fill in position.
1469  * 
1470  * Revision 1.13  1994/08/31  17:58:50  john
1471  * Made a bit simpler.
1472  * 
1473  * Revision 1.12  1994/08/31  14:17:54  john
1474  * *** empty log message ***
1475  * 
1476  * Revision 1.11  1994/08/31  14:10:56  john
1477  * Made keys not work when KEY_DELETE pressed.
1478  * 
1479  * Revision 1.10  1994/08/31  13:40:47  mike
1480  * Change constant
1481  * 
1482  * Revision 1.9  1994/08/31  12:56:27  john
1483  * *** empty log message ***
1484  * 
1485  * Revision 1.8  1994/08/30  20:38:29  john
1486  * Add more config stuff..
1487  * 
1488  * Revision 1.7  1994/08/30  16:37:25  john
1489  * Added menu options to set controls.
1490  * 
1491  * Revision 1.6  1994/08/30  09:27:18  john
1492  * *** empty log message ***
1493  * 
1494  * Revision 1.5  1994/08/30  09:12:01  john
1495  * *** empty log message ***
1496  * 
1497  * Revision 1.4  1994/08/29  21:18:32  john
1498  * First version of new keyboard/oystick remapping stuff.
1499  * 
1500  * Revision 1.3  1994/08/24  19:00:29  john
1501  * Changed key_down_time to return fixed seconds instead of
1502  * milliseconds.
1503  * 
1504  * Revision 1.2  1994/08/17  16:50:37  john
1505  * Added damaging fireballs, missiles.
1506  * 
1507  * Revision 1.1  1994/08/17  10:07:12  john
1508  * Initial revision
1509
1510 ------------------------------------------------------------------------
1511 arch/dos/key.c:
1512
1513  * Revision 1.35  1995/01/25  20:13:30  john
1514  * Took out not passing keys to debugger if w10.
1515  * 
1516  * Revision 1.34  1995/01/14  19:19:31  john
1517  * Made so when you press Shift+Baskspace, it release keys autmatically.
1518  * 
1519  * Revision 1.33  1994/12/13  09:21:48  john
1520  * Took out keyd_editor_mode, and KEY_DEBUGGED stuff for NDEBUG versions.
1521  * 
1522  * Revision 1.32  1994/11/12  13:52:01  john
1523  * Fixed bug with code that cleared bios buffer.
1524  * 
1525  * Revision 1.31  1994/10/24  15:16:16  john
1526  * Added code to detect KEY_PAUSE.
1527  * 
1528  * Revision 1.30  1994/10/24  13:57:53  john
1529  * Hacked in support for pause key onto code 0x61.
1530  * 
1531  * Revision 1.29  1994/10/21  15:18:13  john
1532  * *** empty log message ***
1533  * 
1534  * Revision 1.28  1994/10/21  15:17:24  john
1535  * Made LSHIFT+BACKSPACE do what PrtScr used to.
1536  * 
1537  * Revision 1.27  1994/09/22  16:09:18  john
1538  * Fixed some virtual memory lockdown problems with timer and
1539  * joystick.
1540  * 
1541  * Revision 1.26  1994/09/15  21:32:47  john
1542  * Added bounds checking for down_count scancode
1543  * parameter.
1544  * 
1545  * Revision 1.25  1994/08/31  12:22:20  john
1546  * Added KEY_DEBUGGED
1547  * 
1548  * Revision 1.24  1994/08/24  18:53:48  john
1549  * Made Cyberman read like normal mouse; added dpmi module; moved
1550  * mouse from assembly to c. Made mouse buttons return time_down.
1551  * 
1552  * Revision 1.23  1994/08/18  15:17:51  john
1553  * *** empty log message ***
1554  * 
1555  * Revision 1.22  1994/08/18  15:16:38  john
1556  * fixed some bugs with clear_key_times and then
1557  * removed it because i fixed key_flush to do the
1558  * same.
1559  * 
1560  * Revision 1.21  1994/08/17  19:01:25  john
1561  * Attempted to fix a bug with a key being held down
1562  * key_flush called, then the key released having too 
1563  * long of a time.
1564  * 
1565  * Revision 1.20  1994/08/08  10:43:48  john
1566  * Recorded when a key was pressed for key_inkey_time.
1567  * 
1568  * Revision 1.19  1994/06/22  15:00:03  john
1569  * Made keyboard close automatically on exit.
1570  * 
1571  * Revision 1.18  1994/06/21  09:16:29  john
1572  * *** empty log message ***
1573  * 
1574  * Revision 1.17  1994/06/21  09:08:23  john
1575  * *** empty log message ***
1576  * 
1577  * Revision 1.16  1994/06/21  09:05:01  john
1578  * *** empty log message ***
1579  * 
1580  * Revision 1.15  1994/06/21  09:04:24  john
1581  * Made PrtScreen do an int5
1582  * 
1583  * Revision 1.14  1994/06/17  17:17:06  john
1584  * Added keyd_time_last_key_was_pressed or something like that.
1585  * 
1586  * Revision 1.13  1994/05/14  13:55:16  matt
1587  * Added #define to control key passing to bios
1588  * 
1589  * Revision 1.12  1994/05/05  18:09:39  john
1590  * Took out BIOS to prevent stuck keys.
1591  * 
1592  * Revision 1.11  1994/05/03  17:39:12  john
1593  * *** empty log message ***
1594  * 
1595  * Revision 1.10  1994/04/29  12:14:20  john
1596  * Locked all memory used during interrupts so that program
1597  * won't hang when using virtual memory.
1598  * 
1599  * Revision 1.9  1994/04/28  23:49:41  john
1600  * Made key_flush flush more keys and also did something else but i forget what.
1601  * 
1602  * Revision 1.8  1994/04/22  12:52:12  john
1603  * *** empty log message ***
1604  * 
1605  * Revision 1.7  1994/04/01  10:44:59  mike
1606  * Change key_getch() to call getch() if our interrupt hasn't been installed.
1607  * 
1608  * Revision 1.6  1994/03/09  10:45:48  john
1609  * Neatend code a bit.
1610  * 
1611  * Revision 1.5  1994/02/17  17:24:16  john
1612  * Neatened up a bit.
1613  * 
1614  * Revision 1.4  1994/02/17  16:30:29  john
1615  * Put in code to pass keys when in debugger.
1616  * 
1617  * Revision 1.3  1994/02/17  15:57:59  john
1618  * Made handler not chain to BIOS handler.
1619  * 
1620  * Revision 1.2  1994/02/17  15:56:06  john
1621  * Initial version.
1622  * 
1623  * Revision 1.1  1994/02/17  15:54:07  john
1624  * Initial revision
1625
1626 ------------------------------------------------------------------------
1627 arch/dos/mono.c:
1628
1629  * Revision 1.12  1995/02/23  11:59:57  john
1630  * Made the windows smaller so they don't overwrite the debug file menus.
1631  * 
1632  * Revision 1.11  1994/11/27  23:07:50  matt
1633  * Made changes needed to be able to compile out monochrome debugging code
1634  * 
1635  * Revision 1.10  1994/10/26  22:23:43  john
1636  * Limited windows to 2.  Took away saving what was under
1637  * a window.
1638  * 
1639  * Revision 1.9  1994/07/14  23:25:44  matt
1640  * Allow window 0 to be opened; don't allow mono to be initialized twice
1641  * 
1642  * Revision 1.8  1994/03/09  10:45:38  john
1643  * Sped up scroll.
1644  * 
1645  * Revision 1.7  1994/01/26  08:56:55  mike
1646  * Comment out int3 in mputc.
1647  * 
1648  * Revision 1.6  1994/01/12  15:56:34  john
1649  * made backspace do an int3 during mono stuff.
1650  * .,
1651  * 
1652  * Revision 1.5  1993/12/07  12:33:23  john
1653  * *** empty log message ***
1654  * 
1655  * Revision 1.4  1993/10/15  10:10:25  john
1656  * *** empty log message ***
1657  * 
1658  * Revision 1.3  1993/09/14  20:55:13  matt
1659  * Made minit() and mopen() check for presence of mono card in machine.
1660  * 
1661  * Revision 1.2  1993/07/22  13:10:21  john
1662  * *** empty log message ***
1663  * 
1664  * Revision 1.1  1993/07/10  13:10:38  matt
1665  * Initial revision
1666
1667 ------------------------------------------------------------------------
1668 arch/dos/mono.h:
1669
1670  * Revision 1.6  1994/12/03  17:07:37  matt
1671  * Made mono code turn off with either NDEBUG or NMONO
1672  * 
1673  * Revision 1.5  1994/11/27  23:07:28  matt
1674  * Made changes needed to be able to compile out monochrome debugging code
1675  * 
1676  * Revision 1.4  1993/12/07  12:33:28  john
1677  * *** empty log message ***
1678  * 
1679  * Revision 1.3  1993/09/14  20:54:50  matt
1680  * Made minit() check for mono card, return -1 if present, 0 if not
1681  * 
1682  * Revision 1.2  1993/07/22  13:05:40  john
1683  * added macros to print variables
1684  * 
1685  * Revision 1.1  1993/07/10  13:10:40  matt
1686  * Initial revision
1687
1688 ------------------------------------------------------------------------
1689 arch/dos/mouse.c:
1690
1691  * Revision 1.11  1995/02/10  18:52:17  john
1692  * Fixed bug with mouse not getting closed.
1693  *
1694  * Revision 1.10  1995/02/02  11:10:33  john
1695  * Changed a bunch of mouse stuff around to maybe get
1696  * around PS/2 mouse hang.
1697  *
1698  * Revision 1.9  1995/01/14  19:19:52  john
1699  * Fixed signed short error cmp with -1 that caused mouse
1700  * to break under Watcom 10.0
1701  *
1702  * Revision 1.8  1994/12/27  12:38:23  john
1703  * Made mouse use temporary dos buffer instead of
1704  *
1705  * allocating its own.
1706  *
1707  *
1708  * Revision 1.7  1994/12/05  23:54:53  john
1709  * Fixed bug with mouse_get_delta only returning positive numbers..
1710  *
1711  * Revision 1.6  1994/11/18  23:18:18  john
1712  * Changed some shorts to ints.
1713  *
1714  * Revision 1.5  1994/09/13  12:34:02  john
1715  * Added functions to get down count and state.
1716  *
1717  * Revision 1.4  1994/08/29  20:52:19  john
1718  * Added better cyberman support; also, joystick calibration
1719  * value return funcctiionn,
1720  *
1721  * Revision 1.3  1994/08/24  18:54:32  john
1722  * *** empty log message ***
1723  *
1724  * Revision 1.2  1994/08/24  18:53:46  john
1725  * Made Cyberman read like normal mouse; added dpmi module; moved
1726  * mouse from assembly to c. Made mouse buttons return time_down.
1727  *
1728  * Revision 1.1  1994/08/24  13:56:37  john
1729  * Initial revision
1730
1731 ------------------------------------------------------------------------
1732 arch/include/joy.h:
1733
1734  * Revision 1.17  1995/10/07  13:22:30  john
1735  * Added new method of reading joystick that allows higher-priority
1736  * interrupts to go off.
1737  *
1738  * Revision 1.16  1995/02/14  11:17:13  john
1739  * Added BIOS readings for stick.
1740  *
1741  * Revision 1.15  1995/02/14  10:09:58  john
1742  * Added OS2 switch.
1743  *
1744  * Revision 1.14  1994/12/28  13:49:20  john
1745  * Added function to set joystick for slow reading
1746  *
1747  * Revision 1.13  1994/10/13  11:36:06  john
1748  * Made joy_down_time be kept track of in fixed seconds,
1749  * not ticks.
1750  *
1751  * Revision 1.12  1994/10/12  17:03:16  john
1752  * Added prototype for joy_get_scaled_reading.
1753  *
1754  * Revision 1.11  1994/10/12  16:57:55  john
1755  * Added function to set a joystick button's state.
1756  *
1757  * Revision 1.10  1994/09/22  16:09:00  john
1758  * Fixed some virtual memory lockdown problems with timer and
1759  * joystick.
1760  *
1761  * Revision 1.9  1994/08/31  09:54:57  john
1762  * *** empty log message ***
1763  *
1764  * Revision 1.8  1994/08/29  21:02:24  john
1765  * Added joy_set_cal_values...
1766  *
1767  * Revision 1.7  1994/08/29  20:51:52  john
1768  * Added better cyberman support; also, joystick calibration
1769  * value return funcctiionn,
1770  *
1771  * Revision 1.6  1994/07/01  10:55:44  john
1772  * Fixed some bugs... added support for 4 axis.
1773  *
1774  * Revision 1.5  1994/06/30  20:36:51  john
1775  * Revamped joystick code.
1776  *
1777  * Revision 1.4  1994/04/22  12:52:10  john
1778  * *** empty log message ***
1779  *
1780  * Revision 1.3  1994/01/18  13:53:39  john
1781  * Made all joystick functions return int's instead of
1782  * shorts.  Also made the stick reading be CPU speed
1783  * independant by using the timer_get_Stamp_64
1784  * function.
1785  *
1786  * Revision 1.2  1994/01/18  10:58:42  john
1787  * *** empty log message ***
1788  *
1789  * Revision 1.1  1993/07/10  13:10:39  matt
1790  * Initial revision
1791
1792 ------------------------------------------------------------------------
1793 arch/win32/include/key.h:
1794
1795  * Revision 1.19  1994/10/24  13:58:12  john
1796  * Hacked in support for pause key onto code 0x61.
1797  * 
1798  * Revision 1.18  1994/10/21  15:17:10  john
1799  * Added KEY_PRINT_SCREEN
1800  * 
1801  * Revision 1.17  1994/08/31  12:22:13  john
1802  * Added KEY_DEBUGGED
1803  * 
1804  * Revision 1.16  1994/08/24  18:53:50  john
1805  * Made Cyberman read like normal mouse; added dpmi module; moved
1806  * mouse from assembly to c. Made mouse buttons return time_down.
1807  * 
1808  * Revision 1.15  1994/08/18  14:56:16  john
1809  * *** empty log message ***
1810  * 
1811  * Revision 1.14  1994/08/08  10:43:24  john
1812  * Recorded when a key was pressed for key_inkey_time.
1813  * 
1814  * Revision 1.13  1994/06/17  17:17:28  john
1815  * Added keyd_time_last_key_was_pressed or something like that.
1816  * 
1817  * Revision 1.12  1994/04/29  12:14:19  john
1818  * Locked all memory used during interrupts so that program
1819  * won't hang when using virtual memory.
1820  * 
1821  * Revision 1.11  1994/02/17  15:57:14  john
1822  * Changed key libary to C.
1823  * 
1824  * Revision 1.10  1994/01/31  08:34:09  john
1825  * Fixed reversed lshift/rshift keys.
1826  * 
1827  * Revision 1.9  1994/01/18  10:58:17  john
1828  * *** empty log message ***
1829  * 
1830  * Revision 1.8  1993/10/16  19:24:43  matt
1831  * Added new function key_clear_times() & key_clear_counts()
1832  * 
1833  * Revision 1.7  1993/10/15  10:17:09  john
1834  * added keyd_last_key_pressed and released for use with recorder.
1835  * 
1836  * Revision 1.6  1993/10/06  16:20:37  john
1837  * fixed down arrow bug
1838  * 
1839  * Revision 1.5  1993/10/04  13:26:42  john
1840  * changed the #defines for scan codes.
1841  * 
1842  * Revision 1.4  1993/09/28  11:35:20  john
1843  * added key_peekkey
1844  * 
1845  * Revision 1.3  1993/09/20  18:36:43  john
1846  * *** empty log message ***
1847  * 
1848  * Revision 1.1  1993/07/10  13:10:39  matt
1849  * Initial revision
1850
1851 ------------------------------------------------------------------------
1852 arch/win32/include/mouse.h:
1853
1854  * Revision 1.10  1995/02/02  10:22:29  john
1855  * Added cyberman init parameter.
1856  * 
1857  * Revision 1.9  1994/11/18  23:18:09  john
1858  * Changed some shorts to ints.
1859  * 
1860  * Revision 1.8  1994/09/13  12:33:49  john
1861  * Added functions to get down count and state.
1862  * 
1863  * Revision 1.7  1994/08/29  20:52:20  john
1864  * Added better cyberman support; also, joystick calibration
1865  * value return funcctiionn,
1866  * 
1867  * Revision 1.6  1994/08/24  17:54:35  john
1868  * *** empty log message ***
1869  * 
1870  * Revision 1.5  1994/08/24  17:51:43  john
1871  * Added transparent cyberman support
1872  * 
1873  * Revision 1.4  1993/07/27  09:32:22  john
1874  * *** empty log message ***
1875  * 
1876  * Revision 1.3  1993/07/26  10:46:44  john
1877  * added definition for mouse_set_pos
1878  * 
1879  * Revision 1.2  1993/07/22  13:07:59  john
1880  * added header for mousesetlimts
1881  * 
1882  * Revision 1.1  1993/07/10  13:10:40  matt
1883  * Initial revision
1884
1885 ------------------------------------------------------------------------
1886 arch/win32/mouse.c:
1887
1888  * Revision 1.8  1996/02/21  13:57:36  allender
1889  * cursor device manager stuff added here so as not to
1890  * rely on InterfaceLib anymore
1891  *
1892  * Revision 1.7  1995/10/17  15:42:21  allender
1893  * new mouse function to determine single button press
1894  *
1895  * Revision 1.6  1995/10/03  11:27:31  allender
1896  * fixed up hotspot problems with the mouse on multiple monitors
1897  *
1898  * Revision 1.5  1995/07/13  11:27:08  allender
1899  * trap button checks at MAX_MOUSE_BUTTONS
1900  *
1901  * Revision 1.4  1995/06/25  21:56:53  allender
1902  * added events include
1903  *
1904  * Revision 1.3  1995/05/11  17:06:38  allender
1905  * fixed up mouse routines
1906  *
1907  * Revision 1.2  1995/05/11  13:05:53  allender
1908  * of mouse handler code
1909  *
1910  * Revision 1.1  1995/05/05  09:54:45  allender
1911  * Initial revision
1912  *
1913  * Revision 1.9  1995/01/14  19:19:52  john
1914  * Fixed signed short error cmp with -1 that caused mouse
1915  * to break under Watcom 10.0
1916  *
1917  * Revision 1.8  1994/12/27  12:38:23  john
1918  * Made mouse use temporary dos buffer instead of
1919  *
1920  * allocating its own.
1921  *
1922  * Revision 1.7  1994/12/05  23:54:53  john
1923  * Fixed bug with mouse_get_delta only returning positive numbers..
1924  *
1925  * Revision 1.6  1994/11/18  23:18:18  john
1926  * Changed some shorts to ints.
1927  *
1928  * Revision 1.5  1994/09/13  12:34:02  john
1929  * Added functions to get down count and state.
1930  *
1931  * Revision 1.4  1994/08/29  20:52:19  john
1932  * Added better cyberman support; also, joystick calibration
1933  * value return funcctiionn,
1934  *
1935  * Revision 1.3  1994/08/24  18:54:32  john
1936  * *** empty log message ***
1937  *
1938  * Revision 1.2  1994/08/24  18:53:46  john
1939  * Made Cyberman read like normal mouse; added dpmi module; moved
1940  * mouse from assembly to c. Made mouse buttons return time_down.
1941  *
1942  * Revision 1.1  1994/08/24  13:56:37  john
1943  * Initial revision
1944
1945 ------------------------------------------------------------------------
1946 cfile/cfile.c:
1947
1948  * Revision 1.7  1995/10/27  15:18:20  allender
1949  * get back to descent directory before trying to read a hog file
1950  *
1951  * Revision 1.6  1995/10/21  23:48:24  allender
1952  * hogfile(s) are now in :Data: folder
1953  *
1954  * Revision 1.5  1995/08/14  09:27:31  allender
1955  * added byteswap header
1956  *
1957  * Revision 1.4  1995/05/12  11:54:33  allender
1958  * changed memory stuff again
1959  *
1960  * Revision 1.3  1995/05/04  20:03:38  allender
1961  * added code that was missing...use NewPtr instead of malloc
1962  *
1963  * Revision 1.2  1995/04/03  09:59:49  allender
1964  * *** empty log message ***
1965  *
1966  * Revision 1.1  1995/03/30  10:25:02  allender
1967  * Initial revision
1968  *
1969  *
1970  * --- PC RCS Information ---
1971  * Revision 1.24  1995/03/15  14:20:27  john
1972  * Added critical error checker.
1973  *
1974  * Revision 1.23  1995/03/13  15:16:53  john
1975  * Added alternate directory stuff.
1976  *
1977  * Revision 1.22  1995/02/09  23:08:47  matt
1978  * Increased the max number of files in hogfile to 250
1979  *
1980  * Revision 1.21  1995/02/01  20:56:47  john
1981  * Added cfexist function
1982  *
1983  * Revision 1.20  1995/01/21  17:53:48  john
1984  * Added alternate pig file thing.
1985  *
1986  * Revision 1.19  1994/12/29  15:10:02  john
1987  * Increased hogfile max files to 200.
1988  *
1989  * Revision 1.18  1994/12/12  13:20:57  john
1990  * Made cfile work with fiellentth.
1991  *
1992  * Revision 1.17  1994/12/12  13:14:25  john
1993  * Made cfiles prefer non-hog files.
1994  *
1995  * Revision 1.16  1994/12/09  18:53:26  john
1996  * *** empty log message ***
1997  *
1998  * Revision 1.15  1994/12/09  18:52:56  john
1999  * Took out mem, error checking.
2000  *
2001  * Revision 1.14  1994/12/09  18:10:31  john
2002  * Speed up cfgets, which was slowing down the reading of
2003  * bitmaps.tbl, which was making POF loading look slow.
2004  *
2005  * Revision 1.13  1994/12/09  17:53:51  john
2006  * Added error checking to number of hogfiles..
2007  *
2008  * Revision 1.12  1994/12/08  19:02:55  john
2009  * Added cfgets.
2010  *
2011  * Revision 1.11  1994/12/07  21:57:48  john
2012  * Took out data dir.
2013  *
2014  * Revision 1.10  1994/12/07  21:38:02  john
2015  * Made cfile not return error..
2016  *
2017  * Revision 1.9  1994/12/07  21:35:34  john
2018  * Made it read from data directory.
2019  *
2020  * Revision 1.8  1994/12/07  21:33:55  john
2021  * Stripped out compression stuff...
2022  *
2023  * Revision 1.7  1994/04/13  23:44:59  matt
2024  * When file cannot be opened, free up the buffer for that file.
2025  *
2026  * Revision 1.6  1994/02/18  12:38:20  john
2027  * Optimized a bit
2028  *
2029  * Revision 1.5  1994/02/15  18:13:20  john
2030  * Fixed more bugs.
2031  *
2032  * Revision 1.4  1994/02/15  13:27:58  john
2033  * Works ok...
2034  *
2035  * Revision 1.3  1994/02/15  12:51:57  john
2036  * Crappy inbetween version
2037  *
2038  * Revision 1.2  1994/02/14  20:12:29  john
2039  * First version working with new cfile stuff.
2040  *
2041  * Revision 1.1  1994/02/14  15:51:33  john
2042  * Initial revision
2043  *
2044  * Revision 1.1  1994/02/10  15:45:12  john
2045  * Initial revision
2046
2047 ------------------------------------------------------------------------
2048 iff/iff.c:
2049
2050  * Revision 1.2  1995/05/12  11:54:43  allender
2051  * changed memory stuff again
2052  *
2053  * Revision 1.1  1995/05/05  08:59:41  allender
2054  * Initial revision
2055  *
2056  * Revision 1.43  1994/12/08  19:03:17  john
2057  * Added code to use cfile.
2058  *
2059  * Revision 1.42  1994/12/08  17:45:32  john
2060  * Put back in cfile stuff.
2061  *
2062  * Revision 1.41  1994/11/19  16:41:06  matt
2063  * Took out unused code
2064  *
2065  * Revision 1.40  1994/11/07  21:26:39  matt
2066  * Added new function iff_read_into_bitmap()
2067  *
2068  * Revision 1.39  1994/10/27  00:12:03  john
2069  * Used nocfile
2070  *
2071  * Revision 1.38  1994/08/10  19:49:58  matt
2072  * Fixed bitmaps in ILBM format with masking (stencil) on.
2073  *
2074  * Revision 1.37  1994/06/02  18:53:17  matt
2075  * Clear flags & selector in new bitmap structure
2076  *
2077  * Revision 1.36  1994/05/17  14:00:33  matt
2078  * Fixed bug with odd-width deltas & odd-length body chunks
2079  *
2080  * Revision 1.35  1994/05/16  20:38:55  matt
2081  * Made anim brushes work when odd width
2082  *
2083  * Revision 1.34  1994/05/06  19:37:26  matt
2084  * Improved error handling and checking
2085  *
2086  * Revision 1.33  1994/04/27  20:57:07  matt
2087  * Fixed problem with RLE decompression and odd-width bitmap
2088  * Added more error checking
2089  *
2090  * Revision 1.32  1994/04/16  21:44:19  matt
2091  * Fixed bug introduced last version
2092  *
2093  * Revision 1.31  1994/04/16  20:12:40  matt
2094  * Made masked (stenciled) bitmaps work
2095  *
2096  * Revision 1.30  1994/04/13  23:46:16  matt
2097  * Added function, iff_errormsg(), which returns ptr to error message.
2098  *
2099  * Revision 1.29  1994/04/13  23:27:25  matt
2100  * Put in support for anim brushes (.abm files)
2101  *
2102  * Revision 1.28  1994/04/13  16:33:31  matt
2103  * Cleaned up file read code, adding fake_file structure (FFILE), which
2104  * cleanly implements reading the entire file into a buffer and then reading
2105  * out of that buffer.
2106  *
2107  * Revision 1.27  1994/04/06  23:07:43  matt
2108  * Cleaned up code; added prototype (but no new code) for anim brush read
2109  *
2110  * Revision 1.26  1994/03/19  02:51:52  matt
2111  * Really did what I said I did last revision.
2112  *
2113  * Revision 1.25  1994/03/19  02:16:07  matt
2114  * Made work ILBMs which didn't have 8 planes
2115  *
2116  * Revision 1.24  1994/03/15  14:45:26  matt
2117  * When error, only free memory if has been allocated
2118  *
2119  * Revision 1.23  1994/02/18  12:39:05  john
2120  * Made code read from buffer.
2121  *
2122  * Revision 1.22  1994/02/15  18:15:26  john
2123  * Took out cfile attempt (too slow)
2124  *
2125  * Revision 1.21  1994/02/15  13:17:48  john
2126  * added assert to cfseek.
2127  *
2128  * Revision 1.20  1994/02/15  13:13:11  john
2129  * Made iff code work normally.
2130  *
2131  * Revision 1.19  1994/02/15  12:51:07  john
2132  * crappy inbetween version.
2133  *
2134  * Revision 1.18  1994/02/10  18:31:32  matt
2135  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2136  *
2137  * Revision 1.17  1994/01/24  11:51:26  john
2138  * Made write routine write transparency info.
2139  *
2140  * Revision 1.16  1994/01/22  14:41:11  john
2141  * Fixed bug with declareations.
2142  *
2143  * Revision 1.15  1994/01/22  14:23:00  john
2144  * Added global vars to check transparency
2145  *
2146  * Revision 1.14  1993/12/08  19:00:42  matt
2147  * Changed while loop to memset
2148  *
2149  * Revision 1.13  1993/12/08  17:23:51  mike
2150  * Speedup by converting while...getc to fread.
2151  *
2152  * Revision 1.12  1993/12/08  12:37:35  mike
2153  * Optimize parse_body.
2154  *
2155  * Revision 1.11  1993/12/05  17:30:14  matt
2156  * Made bitmaps with width <= 64 not compress
2157  *
2158  * Revision 1.10  1993/12/03  12:24:51  matt
2159  * Fixed TINY chunk when bitmap was part of a larger bitmap
2160  *
2161  * Revision 1.9  1993/11/22  17:26:43  matt
2162  * iff write now writes out a tiny chunk
2163  *
2164  * Revision 1.8  1993/11/21  22:04:13  matt
2165  * Fixed error with non-compressed bitmaps
2166  * Added Yuan's code to free raw data if we get an error parsing the body
2167  *
2168  * Revision 1.7  1993/11/11  12:12:12  yuan
2169  * Changed mallocs to MALLOCs.
2170  *
2171  * Revision 1.6  1993/11/01  19:02:23  matt
2172  * Fixed a couple bugs in rle compression
2173  *
2174  * Revision 1.5  1993/10/27  12:47:39  john
2175  * *** empty log message ***
2176  *
2177  * Revision 1.4  1993/10/27  12:37:31  yuan
2178  * Added mem.h
2179  *
2180  * Revision 1.3  1993/09/22  19:16:57  matt
2181  * Added new error type, IFF_CORRUPT, for internally bad IFF files.
2182  *
2183  * Revision 1.2  1993/09/08  19:24:16  matt
2184  * Fixed bug in RLE compression
2185  * Changed a bunch of unimportant values like aspect and page size when writing
2186  * Added new error condition, IFF_BAD_BM_TYPE
2187  * Make sub-bitmaps work correctly
2188  * Added compile flag to turn compression off (COMPRESS)
2189  *
2190  * Revision 1.1  1993/09/08  14:24:15  matt
2191  * Initial revision
2192
2193 ------------------------------------------------------------------------
2194 include/3d.h:
2195
2196  * Revision 1.2  1995/09/14  14:08:58  allender
2197  * return value for g3_draw_sphere
2198  *
2199  * Revision 1.1  1995/05/05  08:48:41  allender
2200  * Initial revision
2201  *
2202  * Revision 1.34  1994/11/11  19:22:14  matt
2203  * Added new function, g3_calc_point_depth()
2204  *
2205  * Revision 1.33  1994/09/09  14:23:58  matt
2206  * Added support for glowing textures, to add engine glow to Descent.
2207  *
2208  * Revision 1.32  1994/09/01  10:42:27  matt
2209  * Blob routine, renamed g3_draw_bitmap(), now takes seperate 3d width & height.
2210  *
2211  * Revision 1.31  1994/07/29  18:16:14  matt
2212  * Added instance by angles, and corrected parms for g3_init()
2213  *
2214  * Revision 1.30  1994/07/25  00:00:00  matt
2215  * Made 3d no longer deal with point numbers, but only with pointers.
2216  *
2217  * Revision 1.29  1994/07/22  17:57:27  matt
2218  * Changed the name of the rod functions, and took out some debugging code
2219  *
2220  * Revision 1.28  1994/06/07  16:49:12  matt
2221  * Made interpreter take lighting value as parm, rather than in global var
2222  *
2223  * Revision 1.27  1994/05/31  18:35:28  matt
2224  * Added light value to g3_draw_facing_bitmap()
2225  *
2226  * Revision 1.26  1994/05/30  22:48:04  matt
2227  * Added support for morph effect
2228  *
2229  * Revision 1.25  1994/05/30  11:34:57  matt
2230  * Added g3_set_special_render() to allow a user to specify functions to
2231  * call for 2d draws.
2232  *
2233  * Revision 1.24  1994/05/19  21:46:31  matt
2234  * Moved texture lighting out of 3d and into the game
2235  *
2236  * Revision 1.23  1994/05/14  15:26:48  matt
2237  * Added extern for polyobj outline flag
2238  *
2239  * Revision 1.22  1994/04/19  18:26:33  matt
2240  * Added g3_draw_sphere() function.
2241  *
2242  * Revision 1.21  1994/03/25  18:22:28  matt
2243  * g3_draw_polygon_model() now takes ptr to list of angles
2244  *
2245  * Revision 1.20  1994/03/15  21:23:23  matt
2246  * Added interpreter functions
2247  *
2248  * Revision 1.19  1994/02/15  17:37:34  matt
2249  * New function, g3_draw_blob()
2250  *
2251  * Revision 1.18  1994/02/09  11:47:47  matt
2252  * Added rod & delta point functions
2253  *
2254  * Revision 1.17  1994/01/26  12:38:11  matt
2255  * Added function g3_compute_lighting_value()
2256  *
2257  * Revision 1.16  1994/01/25  18:00:02  yuan
2258  * Fixed variable beam_brightness...
2259  *
2260  * Revision 1.15  1994/01/24  14:08:34  matt
2261  * Added instancing functions
2262  *
2263  * Revision 1.14  1994/01/22  18:21:48  matt
2264  * New lighting stuff now done in 3d; g3_draw_tmap() takes lighting parm
2265  *
2266  * Revision 1.13  1994/01/20  17:21:24  matt
2267  * New function g3_compute_sky_polygon()
2268  *
2269  * Revision 1.12  1994/01/14  17:20:25  matt
2270  * Added prototype for new function g3_draw_horizon()
2271  *
2272  * Revision 1.10  1993/12/20  20:21:52  matt
2273  * Added g3_point_2_vec()
2274  *
2275  * Revision 1.9  1993/12/07  23:05:47  matt
2276  * Fixed mistyped function name.
2277  *
2278  * Revision 1.8  1993/12/05  23:47:03  matt
2279  * Added function g3_draw_line_ptrs()
2280  *
2281  * Revision 1.7  1993/12/05  23:13:22  matt
2282  * Added prototypes for g3_rotate_point() and g3_project_point()
2283  *
2284  * Revision 1.6  1993/12/05  23:03:28  matt
2285  * Changed uvl structs to g3s_uvl
2286  *
2287  * Revision 1.5  1993/11/22  10:51:09  matt
2288  * Moved uvl structure here from segment.h, made texture map functions use it
2289  *
2290  * Revision 1.4  1993/11/21  20:08:31  matt
2291  * Added function g3_draw_object()
2292  *
2293  * Revision 1.3  1993/11/04  18:49:19  matt
2294  * Added system to only rotate points once per frame
2295  *
2296  * Revision 1.2  1993/11/04  08:16:06  mike
2297  * Add light field (p3_l) to g3s_point.
2298  *
2299  * Revision 1.1  1993/10/29  22:20:56  matt
2300  * Initial revision
2301
2302 ------------------------------------------------------------------------
2303 include/args.h:
2304
2305  * Revision 1.1  1995/05/16  15:54:24  allender
2306  * Initial revision
2307  *
2308  * Revision 2.0  1995/02/27  11:33:09  john
2309  * New version 2.0, which has no anonymous unions, builds with
2310  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2311  *
2312  * Revision 1.4  1994/07/11  16:27:28  matt
2313  * Took out prototypes for netipx funcs
2314  *
2315  * Revision 1.3  1994/05/11  19:45:34  john
2316  * *** empty log message ***
2317  *
2318  * Revision 1.2  1994/05/09  17:02:55  john
2319  * Split command line parameters into arg.c and arg.h.
2320  * Also added /dma, /port, /irq to digi.c
2321  *
2322  * Revision 1.1  1994/05/09  16:47:49  john
2323  * Initial revision
2324
2325 ------------------------------------------------------------------------
2326 include/byteswap.h:
2327
2328  * Revision 1.4  1995/08/23  21:28:15  allender
2329  * fix mcc compiler warning
2330  *
2331  * Revision 1.3  1995/08/18  15:51:42  allender
2332  * put back in old byteswapping code
2333  *
2334  * Revision 1.2  1995/05/04  20:10:18  allender
2335  * proper prototypes
2336  *
2337  * Revision 1.1  1995/03/30  15:02:11  allender
2338  * Initial revision
2339
2340 ------------------------------------------------------------------------
2341 include/cfile.h:
2342
2343  * Revision 1.1  1995/03/30  10:25:08  allender
2344  * Initial revision
2345  *
2346  *
2347  * -- PC RCS Information ---
2348  * Revision 1.10  1995/03/13  15:16:47  john
2349  * Added alternate directory stuff.
2350  *
2351  * Revision 1.9  1995/02/01  20:56:40  john
2352  * Added cfexist function
2353  *
2354  * Revision 1.8  1995/01/21  17:53:41  john
2355  * Added alternate pig file thing.
2356  *
2357  * Revision 1.7  1994/12/12  13:19:47  john
2358  * Made cfile work with fiellentth.
2359  *
2360  * Revision 1.6  1994/12/08  19:02:52  john
2361  * Added cfgets.
2362  *
2363  * Revision 1.5  1994/12/07  21:34:07  john
2364  * Stripped out compression stuff...
2365  *
2366  * Revision 1.4  1994/07/13  00:16:53  matt
2367  * Added include
2368  *
2369  * Revision 1.3  1994/02/17  17:36:19  john
2370  * Added CF_READ_MODE and CF_WRITE_MODE constants.
2371  *
2372  * Revision 1.2  1994/02/15  12:52:08  john
2373  * Crappy inbetween version
2374  *
2375  * Revision 1.1  1994/02/15  10:54:23  john
2376  * Initial revision
2377  *
2378  * Revision 1.1  1994/02/10  15:50:54  john
2379  * Initial revision
2380
2381 ------------------------------------------------------------------------
2382 include/error.h:
2383
2384  * Revision 1.12  1994/06/17  15:22:46  matt
2385  * Added pragma for Error() for when NDEBUG
2386  *
2387  * Revision 1.11  1994/03/07  13:22:14  matt
2388  * Since the Error() function has 'aborts' set in pragma, we do a jmp
2389  * to the function rather than call.
2390  *
2391  * Revision 1.10  1994/02/17  12:37:15  matt
2392  * Combined two pragma's for Error(), since second superseded the first
2393  *
2394  * Revision 1.9  1994/02/10  18:02:53  matt
2395  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2396  *
2397  * Revision 1.8  1994/02/09  15:18:29  matt
2398  * Added pragma saying that Error() never returns
2399  *
2400  * Revision 1.7  1993/10/19  12:57:53  matt
2401  * If DEBUG_ON not defined, define it to be 1
2402  *
2403  * Revision 1.6  1993/10/15  21:40:39  matt
2404  * Made error functions generate int3's if debugging on
2405  *
2406  * Revision 1.5  1993/10/14  15:29:22  matt
2407  * Added new function clear_warn_func()
2408  *
2409  * Revision 1.4  1993/10/08  16:16:47  matt
2410  * Made Assert() call function _Assert(), rather to do 'if...' inline.
2411  *
2412  * Revision 1.3  1993/09/29  11:39:07  matt
2413  * Added Assert() macro, like the system one, but calls Error()
2414  *
2415  * Revision 1.2  1993/09/27  11:47:03  matt
2416  * Added function set_warn_func()
2417  *
2418  * Revision 1.1  1993/09/23  20:17:46  matt
2419  * Initial revision
2420
2421 ------------------------------------------------------------------------
2422 include/gr.h:
2423
2424  * Revision 1.7  1995/09/13  08:39:44  allender
2425  * added prototype for gr_bitblt_cockpit
2426  *
2427  * Revision 1.6  1995/08/23  18:47:01  allender
2428  * fixed compiler warnings on mcc
2429  *
2430  * Revision 1.5  1995/08/14  15:51:01  allender
2431  * added #define for transparency color
2432  *
2433  * Revision 1.4  1995/06/13  13:03:55  allender
2434  * added graphics mode
2435  *
2436  * Revision 1.3  1995/04/18  09:50:16  allender
2437  * *** empty log message ***
2438  *
2439  * Revision 1.2  1995/04/07  07:32:33  allender
2440  * *** empty log message ***
2441  *
2442  * Revision 1.1  1995/03/09  09:04:16  allender
2443  * Initial revision
2444  *
2445  *
2446  * --- PC RCS information ---
2447  * Revision 1.45  1994/11/18  22:50:21  john
2448  * Changed shorts to ints in parameters.
2449  *
2450  * Revision 1.44  1994/11/13  13:04:07  john
2451  * Added paged out bit in bitmap structure.  Commented out the
2452  * poly code that is never used.
2453  *
2454  * Revision 1.43  1994/11/09  23:04:56  mike
2455  * Add avg_color field.
2456  *
2457  * Revision 1.42  1994/10/27  00:53:35  john
2458  * Added RLE Flag to bitmap structere.
2459  *
2460  * Revision 1.41  1994/10/26  23:55:52  john
2461  * Took out roller; Took out inverse table.
2462  *
2463  * Revision 1.40  1994/08/11  17:59:12  mike
2464  * Assembler merge functions written for 3 rotations of bitmaps.
2465  *
2466  * Revision 1.39  1994/08/10  12:24:56  matt
2467  * Added support for colors fonts & kerned fonts
2468  * Made our own font file format
2469  *
2470  * Revision 1.38  1994/07/27  18:30:18  john
2471  * Took away the blending table.
2472  *
2473  * Revision 1.37  1994/06/16  15:25:06  mike
2474  * Add flag BM_FLAG_NO_LIGHTING.
2475  *
2476  * Revision 1.36  1994/05/31  10:01:22  john
2477  * *** empty log message ***
2478  *
2479  * Revision 1.35  1994/05/31  07:53:34  john
2480  * *** empty log message ***
2481  *
2482  * Revision 1.34  1994/05/14  17:19:41  matt
2483  * Added externs
2484  *
2485  * Revision 1.33  1994/05/12  17:33:09  john
2486  * Added circle code.
2487  *
2488  * Revision 1.32  1994/05/06  12:50:16  john
2489  * Added supertransparency; neatend things up; took out warnings.
2490  *
2491  * Revision 1.31  1994/05/04  10:06:06  john
2492  * Added flag for bitmap super-transparency.
2493  *
2494  * Revision 1.30  1994/05/03  19:38:56  john
2495  * *** empty log message ***
2496  *
2497  * Revision 1.29  1994/04/22  11:16:05  john
2498  * *** empty log message ***
2499  *
2500  * Revision 1.28  1994/04/08  16:59:32  john
2501  * Add fading poly's; Made palette fade 32 instead of 16.
2502  *
2503  * Revision 1.27  1994/03/16  17:29:52  john
2504  * *** empty log message ***
2505  *
2506  * Revision 1.26  1994/03/16  17:20:51  john
2507  * Added slow palette searching options.
2508  *
2509  * Revision 1.25  1994/03/14  17:59:20  john
2510  * Added function to check bitmap's transparency.
2511  *
2512  * Revision 1.24  1994/03/14  16:56:26  john
2513  * Changed grs_bitmap structure to include bm_flags.
2514  *
2515  * Revision 1.23  1994/02/18  15:32:30  john
2516  * *** empty log message ***
2517  *
2518  * Revision 1.22  1994/01/25  11:40:48  john
2519  * Added gr_check_mode function.
2520  *
2521  * Revision 1.21  1994/01/12  13:45:24  john
2522  * Added scaler.
2523  *
2524  * Revision 1.20  1993/12/21  19:58:24  john
2525  * added selector stuff
2526  *
2527  * Revision 1.19  1993/12/21  11:40:40  john
2528  * *** empty log message ***
2529  *
2530  * Revision 1.18  1993/12/09  15:02:08  john
2531  * Changed palette stuff majorly
2532  *
2533  * Revision 1.17  1993/12/07  12:32:05  john
2534  * moved bmd_palette to gr_palette
2535  *
2536  * Revision 1.16  1993/11/28  12:08:06  mike
2537  * Change prototype for rotate_bitmap.
2538  *
2539  * Revision 1.15  1993/11/18  14:22:51  mike
2540  * Add prototype for rotate_bitmap.
2541  *
2542  * Revision 1.14  1993/11/17  19:00:59  mike
2543  * Add prototype for test_rotate_bitmap
2544  *
2545  * Revision 1.13  1993/11/16  11:28:58  john
2546  * *** empty log message ***
2547  *
2548  * Revision 1.12  1993/10/26  13:17:43  john
2549  * *** empty log message ***
2550  *
2551  * Revision 1.11  1993/10/15  16:23:37  john
2552  * y
2553  *
2554  * Revision 1.10  1993/09/28  15:32:33  john
2555  * added def for save/restore vidmode
2556  *
2557  * Revision 1.9  1993/09/28  12:51:46  matt
2558  * Added aspect ratio to grs_screen structure
2559  *
2560  * Revision 1.8  1993/09/26  22:45:12  matt
2561  * Changed prototypes for line functions to take fixes, not ints.
2562  *
2563  * Revision 1.7  1993/09/26  18:58:16  john
2564  * fadein/out stuff
2565  *
2566  * Revision 1.6  1993/09/14  16:26:44  matt
2567  * Changed gr_change_mode() to be gr_set_mode()
2568  *
2569  * Revision 1.4  1993/09/14  13:08:45  john
2570  * added gr_change_mode
2571  *
2572  * Revision 1.3  1993/09/08  13:56:03  matt
2573  * Put 'if' block around body of file; added bitmap type BM_RGB15
2574  *
2575  * Revision 1.2  1993/09/08  13:02:14  john
2576  * Changed structure definitions a bit.
2577  *
2578  * Revision 1.1  1993/09/08  11:25:15  john
2579  * Initial revision
2580
2581 ------------------------------------------------------------------------
2582 include/grdef.h:
2583
2584  * Revision 1.5  1995/09/14  15:36:33  allender
2585  * added stuff for 68k version
2586  *
2587  * Revision 1.4  1995/07/05  16:10:57  allender
2588  * gr_linear_movsd prototype changes
2589  *
2590  * Revision 1.3  1995/04/19  14:39:28  allender
2591  * changed function prototype
2592  *
2593  * Revision 1.2  1995/04/18  09:49:53  allender
2594  * *** empty log message ***
2595  *
2596  * Revision 1.1  1995/03/09  09:04:56  allender
2597  * Initial revision
2598  *
2599  *
2600  * --- PC RCS information ---
2601  * Revision 1.8  1994/05/06  12:50:09  john
2602  * Added supertransparency; neatend things up; took out warnings.
2603  *
2604  * Revision 1.7  1994/01/25  11:40:29  john
2605  * Added gr_check_mode function.
2606  *
2607  * Revision 1.6  1993/10/15  16:22:53  john
2608  * y
2609  *
2610  * Revision 1.5  1993/09/29  17:31:00  john
2611  * added gr_vesa_pixel
2612  *
2613  * Revision 1.4  1993/09/29  16:14:43  john
2614  * added global canvas descriptors.
2615  *
2616  * Revision 1.3  1993/09/08  17:38:02  john
2617  * Looking for errors
2618  *
2619  * Revision 1.2  1993/09/08  15:54:29  john
2620  * *** empty log message ***
2621  *
2622  * Revision 1.1  1993/09/08  11:37:57  john
2623  * Initial revision
2624
2625 ------------------------------------------------------------------------
2626 include/ibitblt.h:
2627
2628  * Revision 1.1  1995/08/18  15:50:57  allender
2629  * Initial revision
2630  *
2631  * Revision 1.2  1994/05/31  11:10:56  john
2632  * *** empty log message ***
2633  *
2634  * Revision 1.1  1994/05/30  16:08:46  john
2635  * Initial revision
2636
2637 ------------------------------------------------------------------------
2638 include/iff.h:
2639
2640  * Revision 1.2  1995/05/05  16:33:22  allender
2641  * changed types.h to dtypes.h
2642  *
2643  * Revision 1.1  1995/05/05  08:59:45  allender
2644  * Initial revision
2645  *
2646  * Revision 1.12  1994/11/07  21:26:53  matt
2647  * Added new function iff_read_into_bitmap()
2648  *
2649  * Revision 1.11  1994/05/06  19:37:38  matt
2650  * Improved error handling and checking
2651  *
2652  * Revision 1.10  1994/04/16  20:12:54  matt
2653  * Made masked (stenciled) bitmaps work
2654  *
2655  * Revision 1.9  1994/04/13  23:46:00  matt
2656  * Added function, iff_errormsg(), which returns ptr to error message.
2657  *
2658  * Revision 1.8  1994/04/13  23:27:10  matt
2659  * Put in support for anim brushes (.abm files)
2660  *
2661  * Revision 1.7  1994/04/06  23:08:02  matt
2662  * Cleaned up code; added prototype (but no new code) for anim brush read
2663  *
2664  * Revision 1.6  1994/01/22  14:40:59  john
2665  * Fixed bug with declareations.
2666  *
2667  * Revision 1.5  1994/01/22  14:23:13  john
2668  * Added global vars to check transparency
2669  *
2670  * Revision 1.4  1993/10/27  12:47:42  john
2671  * Extended the comments
2672  *
2673  * Revision 1.3  1993/09/22  19:17:20  matt
2674  * Fixed handling of pad byte in ILBM/PPB body - was writing pad byte to
2675  * destination buffer.
2676  *
2677  * Revision 1.2  1993/09/08  19:23:25  matt
2678  * Added additional return code, IFF_BAD_BM_TYPE
2679  *
2680  * Revision 1.1  1993/09/08  14:24:21  matt
2681  * Initial revision
2682
2683 ------------------------------------------------------------------------
2684 include/ipx.h:
2685
2686  * Revision 2.6  1995/03/29  11:19:32  john
2687  * Added broadcasting over a net.
2688  *
2689  * Revision 2.5  1995/03/28  20:04:43  john
2690  * Took away alternate server stuff.
2691  *
2692  * Revision 2.4  1995/03/23  19:00:10  john
2693  * Added user list capabitly.
2694  *
2695  * Revision 2.3  1995/03/23  12:26:57  john
2696  * Move IPX into bios lib.
2697  *
2698  * Revision 2.2  1995/03/22  19:08:14  john
2699  * Added code to fix sending packets over router... now
2700  * we just need to make broadcasts go over router!!
2701  *
2702  * Revision 2.1  1995/03/21  08:39:56  john
2703  * Ifdef'd out the NETWORK code.
2704  *
2705  * Revision 2.0  1995/02/27  11:30:16  john
2706  * New version 2.0, which has no anonymous unions, builds with
2707  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2708  *
2709  * Revision 1.16  1995/02/16  17:34:52  john
2710  * Added code to allow dynamic socket changing.
2711  *
2712  * Revision 1.15  1995/01/04  21:43:27  rob
2713  * Remove SPX size definition.
2714  *
2715  * Revision 1.14  1995/01/03  13:46:18  john
2716  * Added code that should make ipx work over different servers,
2717  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
2718  * this, and I hope it doesn't introduce net bugs.
2719  *
2720  * Revision 1.13  1994/11/02  11:37:16  rob
2721  * Changed default socket number to a higher regions.
2722  *
2723  * Revision 1.12  1994/11/01  15:56:51  rob
2724  * Added defines for SPX socketsx.
2725  *
2726  * Revision 1.11  1994/10/31  19:23:31  rob
2727  * Added a prototype for the new object send function.
2728  *
2729  * Revision 1.10  1994/09/07  13:37:25  john
2730  * Changed default socket to 0x4000, because
2731  * the ipx/spx book says that we can only use
2732  * sockets 0x4000 - 0x7fff.
2733  *
2734  * Revision 1.9  1994/08/25  18:14:45  matt
2735  * Changed socket because of packet change
2736  *
2737  * Revision 1.8  1994/08/12  22:42:24  john
2738  * Took away Player_stats; added Players array.
2739  *
2740  * Revision 1.7  1994/08/09  19:31:47  john
2741  * Networking changes.
2742  *
2743  * Revision 1.6  1994/08/05  16:11:46  john
2744  * Psuedo working version of networking.
2745  *
2746  * Revision 1.5  1994/08/04  19:17:20  john
2747  * Inbetween version of network stuff.
2748  *
2749  * Revision 1.4  1994/07/29  16:08:59  john
2750  * *** empty log message ***
2751  *
2752  * Revision 1.3  1994/07/25  12:33:22  john
2753  * Network "pinging" in.
2754  *
2755  * Revision 1.2  1994/07/20  15:58:29  john
2756  * First installment of ipx stuff.
2757  *
2758  * Revision 1.1  1994/07/19  15:43:05  john
2759  * Initial revision
2760
2761 ------------------------------------------------------------------------
2762 include/palette.h:
2763
2764  * Revision 1.11  1994/11/15  17:55:10  john
2765  * Made text palette fade in when game over.
2766  *
2767  * Revision 1.10  1994/11/07  13:53:42  john
2768  * Added better gamma stufff.
2769  *
2770  * Revision 1.9  1994/11/07  13:38:03  john
2771  * Added gamma correction stuff.
2772  *
2773  * Revision 1.8  1994/11/05  13:05:59  john
2774  * Added back in code to allow keys during fade.
2775  *
2776  * Revision 1.7  1994/11/05  12:46:37  john
2777  * Changed palette stuff a bit.
2778  *
2779  * Revision 1.6  1994/09/22  16:08:37  john
2780  * Fixed some palette stuff.
2781  *
2782  * Revision 1.5  1994/08/09  11:27:04  john
2783  * Add cthru stuff.
2784  *
2785  * Revision 1.4  1994/06/09  10:39:33  john
2786  * In fade out.in functions, returned 1 if key was pressed...
2787  *
2788  * Revision 1.3  1994/05/31  19:04:24  john
2789  * Added key to stop fade if desired.
2790  *
2791  * Revision 1.2  1994/05/06  12:50:42  john
2792  * Added supertransparency; neatend things up; took out warnings.
2793  *
2794  * Revision 1.1  1994/05/04  14:59:57  john
2795  * Initial revision
2796
2797 ------------------------------------------------------------------------
2798 include/pcx.h:
2799
2800  * Revision 1.4  1995/01/21  17:07:34  john
2801  * Added out of memory error.
2802  *
2803  * Revision 1.3  1994/11/29  02:53:10  john
2804  * Added error messages; made call be more similiar to iff.
2805  *
2806  * Revision 1.2  1994/11/28  20:03:48  john
2807  * Added PCX functions.
2808  *
2809  * Revision 1.1  1994/11/28  19:57:45  john
2810  * Initial revision
2811
2812 ------------------------------------------------------------------------
2813 include/pstypes.h:
2814
2815  * Revision 1.2  1993/09/14  12:12:30  matt
2816  * Added #define for NULL
2817  *
2818  * Revision 1.1  1993/08/24  12:50:40  matt
2819  * Initial revision
2820
2821 ------------------------------------------------------------------------
2822 include/rle.h:
2823
2824  * Revision 1.5  1995/01/14  11:32:20  john
2825  * Added rle_cache_flush function.
2826  *
2827  * Revision 1.4  1994/11/10  13:16:01  matt
2828  * Added includes
2829  *
2830  * Revision 1.3  1994/11/09  19:53:51  john
2831  * Added texture rle caching.
2832  *
2833  * Revision 1.2  1994/11/09  16:35:18  john
2834  * First version with working RLE bitmaps.
2835  *
2836  * Revision 1.1  1994/11/09  12:40:17  john
2837  * Initial revision
2838
2839 ------------------------------------------------------------------------
2840 include/texmap.h:
2841
2842  * Revision 1.2  1995/09/04  14:22:10  allender
2843  * #defines for fixed point limits on render buffer
2844  *
2845  * Revision 1.1  1995/05/04  20:14:50  allender
2846  * Initial revision
2847  *
2848  * Revision 1.17  1994/11/10  11:09:16  mike
2849  * detail level stuff.
2850  * 
2851  * Revision 1.16  1994/11/09  22:55:32  matt
2852  * Added variable Current_seg_depth for detail level optimization
2853  * 
2854  * Revision 1.15  1994/06/09  16:10:04  mike
2855  * Add prototype for SC2000
2856  * 
2857  * Revision 1.14  1994/05/25  18:46:16  matt
2858  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
2859  * 
2860  * Revision 1.13  1994/05/25  09:47:12  mike
2861  * Added interface support for linear texture mapper (Mike change, Matt commnet)
2862  * 
2863  * Revision 1.12  1994/05/24  17:30:43  mike
2864  * Prototype a bunch of linear, vertical scanning functions.
2865  * 
2866  * Revision 1.11  1994/05/19  23:26:14  mike
2867  * Add constants NUM_LIGHTING_VALUES, MAX_LIGHTING_VALUE, MIN_LIGHTING_VALUE,
2868  * all part of new lighting_values_in_0_to_1 system.
2869  * 
2870  * Revision 1.10  1994/05/14  17:19:21  matt
2871  * Added externs
2872  * 
2873  * Revision 1.9  1994/04/13  23:55:44  matt
2874  * Increased max_tmap_verts from 16 to 25
2875  * 
2876  * Revision 1.8  1994/03/31  08:35:43  mike
2877  * Prototype for gr_upoly_tmap.
2878  * 
2879  * Revision 1.7  1994/02/08  15:17:54  mike
2880  * define label for MAX_TMAP_VERTS
2881  * 
2882  * Revision 1.6  1994/01/31  15:41:51  mike
2883  * Add texture_map_lin_lin_sky_v
2884  * 
2885  * Revision 1.5  1994/01/18  10:49:40  mike
2886  * prototype for texture_map_lin_lin_sky
2887  * 
2888  * Revision 1.4  1993/11/30  17:09:46  mike
2889  * prototype for compute_lighting_value.
2890  * 
2891  * Revision 1.3  1993/11/22  10:50:38  matt
2892  * Add ifndef around body of file
2893  * 
2894  * Revision 1.2  1993/10/06  12:41:25  mike
2895  * Change prototype for draw_tmap.
2896  * 
2897  * Revision 1.1  1993/09/08  17:29:11  mike
2898  * Initial revision
2899
2900 ------------------------------------------------------------------------
2901 include/timer.h:
2902
2903  * Revision 1.8  1994/12/10  12:27:23  john
2904  * Added timer_get_approx_seconds.
2905  *
2906  * Revision 1.7  1994/12/10  12:10:25  john
2907  * Added types.h.
2908  *
2909  * Revision 1.6  1994/12/10  12:07:06  john
2910  * Added tick counter variable.
2911  *
2912  * Revision 1.5  1994/11/15  12:04:15  john
2913  * Cleaned up timer code a bit... took out unused functions
2914  * like timer_get_milliseconds, etc.
2915  *
2916  * Revision 1.4  1994/04/28  23:50:08  john
2917  * Changed calling for init_timer.  Made the function that the
2918  * timer calls be a far function. All of this was done to make
2919  * our timer system compatible with the HMI sound stuff.
2920  *
2921  * Revision 1.3  1994/02/17  15:57:12  john
2922  * Changed key libary to C.
2923  *
2924  * Revision 1.2  1994/01/18  10:58:34  john
2925  * Added timer_get_fixed_seconds
2926  *
2927  * Revision 1.1  1993/07/10  13:10:41  matt
2928  * Initial revision
2929
2930 ------------------------------------------------------------------------
2931 include/u_dpmi.h:
2932
2933  * Revision 1.9  1995/01/14  19:20:14  john
2934  * Added function to set a selector's base address.
2935  *
2936  * Revision 1.8  1994/11/28  20:22:03  john
2937  * Added some variables that return the amount of available
2938  * memory.
2939  *
2940  * Revision 1.7  1994/11/15  18:26:38  john
2941  * Added verbose flag.
2942  *
2943  * Revision 1.6  1994/11/07  11:35:05  john
2944  * Added prototype for real_free
2945  *
2946  * Revision 1.5  1994/10/27  19:54:48  john
2947  * Added unlock region function,.
2948  *
2949  * Revision 1.4  1994/09/27  18:27:56  john
2950  * Added pragma to make inp,outp,enable,disable intrinsic
2951  *
2952  * Revision 1.3  1994/09/27  11:54:45  john
2953  * Added DPMI init function.
2954  *
2955  * Revision 1.2  1994/08/24  18:53:51  john
2956  * Made Cyberman read like normal mouse; added dpmi module; moved
2957  * mouse from assembly to c. Made mouse buttons return time_down.
2958  *
2959  * Revision 1.1  1994/08/24  10:22:48  john
2960  * Initial revision
2961
2962 ------------------------------------------------------------------------
2963 include/vecmat.h:
2964
2965  * Revision 1.1  1995/04/17  16:18:05  allender
2966  * Initial revision
2967  *
2968  *
2969  * --- PC RCS Information ---
2970  * Revision 1.37  1995/02/22  13:23:22  john
2971  * Added the vms_vector_array structure, to access a vms_vector
2972  * with an array.
2973  *
2974  * Revision 1.36  1995/02/22  12:34:33  john
2975  * Took out anonymous unions.
2976  *
2977  * Revision 1.35  1994/12/13  14:44:20  matt
2978  * Added vm_vector_2_matrix_norm()
2979  *
2980  * Revision 1.34  1994/09/11  19:22:55  matt
2981  * Added vm_vec_normalized_dir_quick()
2982  *
2983  * Revision 1.33  1994/08/04  19:45:38  matt
2984  * Added option to make a bunch of functions (add, sub, dotprod) inline
2985  *
2986  * Revision 1.32  1994/07/19  18:52:36  matt
2987  * Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
2988  *
2989  * Revision 1.31  1994/06/16  18:24:30  matt
2990  * Added vm_vec_mag_quick()
2991  *
2992  * Revision 1.30  1994/06/10  23:19:00  matt
2993  * New register usage for vm_vec_ang_2_matrix()
2994  *
2995  * Revision 1.29  1994/06/01  17:32:06  matt
2996  * Fixed modify list for vm_vec_normalized_dir()
2997  *
2998  * Revision 1.28  1994/05/19  12:07:20  matt
2999  * Fixed globals and macros and added a constant
3000  *
3001  * Revision 1.27  1994/05/19  09:19:15  matt
3002  * Made vm_vec_normalized_dir() return mag of vector
3003  *
3004  * Revision 1.26  1994/05/18  22:28:57  matt
3005  * Added function vm_vec_normalized_dir()
3006  * Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
3007  * Added C global static vars vmd_zero_vector & vmd_identity_matrix
3008  *
3009  * Revision 1.25  1994/05/18  21:45:06  matt
3010  * Added functions:
3011  *   vm_extract_angles_vector()
3012  *   vm_extract_angles_vector_normalized()
3013  *   vm_vec_copy_normalize()
3014  *
3015  * Revision 1.24  1994/05/13  12:42:16  matt
3016  * Added new function, vm_vec_dist_quick(), which does an approximation.
3017  *
3018  * Revision 1.23  1994/03/30  13:37:34  matt
3019  * Added prototype for vm_vec_scale_add(), and fixed typos
3020  *
3021  * Revision 1.22  1994/03/30  13:29:42  matt
3022  * Header for vm_vec_scale_add2()
3023  *
3024  * Revision 1.21  1994/01/31  19:45:13  matt
3025  * Added function vm_extract_angles_matrix()
3026  *
3027  * Revision 1.20  1993/12/21  19:46:14  matt
3028  * Added function vm_dist_to_plane()
3029  *
3030  * Revision 1.19  1993/12/13  17:26:41  matt
3031  * Added vm_vec_dist()
3032  *
3033  * Revision 1.18  1993/12/02  12:45:11  matt
3034  * New functions: vm_vec_copy_scale(), vm_vec_scale2()
3035  * Aliases: vm_transpose(), vm_vec_dot(), vm_vec_cross(), vm_copy_transpose()
3036  *
3037  * Revision 1.17  1993/10/29  22:38:36  matt
3038  * Changed matrix order, making direction vectors the rows
3039  *
3040  * Revision 1.16  1993/10/25  11:49:57  matt
3041  * Made vm_vec_delta_ang() take optional forward vector to return signed delta
3042  *
3043  * Revision 1.15  1993/10/20  01:10:05  matt
3044  * Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
3045  *
3046  * Revision 1.14  1993/10/17  17:02:52  matt
3047  * vm_vector_2_matrix() now takes optional right vector
3048  *
3049  * Revision 1.13  1993/10/12  19:31:39  matt
3050  * Added IDENTITY_MATRIX constant
3051  *
3052  * Revision 1.12  1993/10/08  18:10:16  matt
3053  * Changed vm_vec_make() and vm_angvec_make() to be inline assembly
3054  * functions, to get rid of compiler warnings.  Did not change vm_mat_make(),
3055  * which could still get warnings if the return value is unused.
3056  *
3057  * Revision 1.11  1993/09/29  12:10:07  matt
3058  * Changed modified regs in pragmas to include return register
3059  *
3060  * Revision 1.10  1993/09/28  12:15:41  matt
3061  * Added func vm_vector_2_matrix()
3062  *
3063  * Revision 1.9  1993/09/24  21:18:38  matt
3064  * Added vm_vec_avg(), vm_vec_avg4(), and vm_angvec_make().
3065  * Documented which functions could have dest==source
3066  *
3067  * Revision 1.8  1993/09/20  14:56:11  matt
3068  * Added new function, vm_vec_perp()
3069  *
3070  * Revision 1.7  1993/09/20  14:27:42  mike
3071  * unfix last fix which introduced a bug
3072  *
3073  * Revision 1.6  1993/09/20  10:11:53  mike
3074  * no changes
3075  *
3076  * Revision 1.5  1993/09/20  09:58:58  mike
3077  * Re-fix vm_vec_make
3078  *
3079  * Revision 1.4  1993/09/20  09:41:21  mike
3080  * Correct vm_vec_make and vm_mat_make macros to return the destination
3081  * as the value of the macro.
3082  *
3083  * Revision 1.3  1993/09/17  11:23:47  matt
3084  * Added row access (via xrow,yrow,zrow) to vms_matrix
3085  * Added macro vm_mat_make(), like vm_vec_make()
3086  *
3087  * Revision 1.2  1993/09/17  11:10:32  matt
3088  * Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
3089  *
3090  * Revision 1.1  1993/09/16  20:10:01  matt
3091  * Initial revision
3092
3093 ------------------------------------------------------------------------
3094 main/ai.c:
3095
3096  * Revision 1.1  1995/12/05  14:15:37  allender
3097  * Initial revision
3098  *
3099  * Revision 1.10  1995/11/09  09:36:12  allender
3100  * cheats not active during demo playback
3101  *
3102  * Revision 1.9  1995/11/03  12:51:55  allender
3103  * shareware changes
3104  *
3105  * Revision 1.8  1995/10/31  10:25:07  allender
3106  * shareware stuff
3107  *
3108  * Revision 1.7  1995/10/26  14:01:38  allender
3109  * optimization for doing robot stuff only if anim angles done last frame
3110  *
3111  * Revision 1.6  1995/10/25  09:35:43  allender
3112  * prototype some functions causing mcc problems
3113  *
3114  * Revision 1.5  1995/10/17  13:11:40  allender
3115  * fix in ai code that makes bots only look for you every so often
3116  *
3117  * Revision 1.4  1995/10/10  11:48:10  allender
3118  * PC ai code
3119  *
3120  * Revision 2.11  1995/07/09  11:15:48  john
3121  * Put in Mike's code to fix bug where bosses don't gate in bots after
3122  * 32767 seconds of playing.
3123  *
3124  * Revision 2.10  1995/06/15  12:31:08  john
3125  * Fixed bug with cheats getting enabled when you type
3126  * the whole alphabet.
3127  *
3128  * Revision 2.9  1995/05/26  16:16:18  john
3129  * Split SATURN into define's for requiring cd, using cd, etc.
3130  * Also started adding all the Rockwell stuff.
3131  *
3132  * Revision 2.8  1995/04/06  15:12:27  john
3133  * Fixed bug with insane not working.
3134  *
3135  * Revision 2.7  1995/03/30  16:36:44  mike
3136  * text localization.
3137  *
3138  * Revision 2.6  1995/03/28  11:22:24  john
3139  * Added cheats to save file. Changed lunacy text.
3140  *
3141  * Revision 2.5  1995/03/27  16:45:07  john
3142  * Fixed some cheat bugs.  Added astral cheat.
3143  *
3144  * Revision 2.4  1995/03/24  15:29:17  mike
3145  * add new cheats.
3146  *
3147  * Revision 2.3  1995/03/21  14:39:45  john
3148  * Ifdef'd out the NETWORK code.
3149  *
3150  * Revision 2.2  1995/03/14  18:24:39  john
3151  * Force Destination Saturn to use CD-ROM drive.
3152  *
3153  * Revision 2.1  1995/03/06  16:47:14  mike
3154  * destination saturn
3155  *
3156  * Revision 2.0  1995/02/27  11:30:01  john
3157  * New version 2.0, which has no anonymous unions, builds with
3158  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3159  *
3160  * Revision 1.295  1995/02/22  13:23:04  allender
3161  * remove anonymous unions from object structure
3162  *
3163  * Revision 1.294  1995/02/13  11:00:43  rob
3164  * Make brain guys high enough to get an open slot.
3165  *
3166  * Revision 1.293  1995/02/13  10:31:55  mike
3167  * Make brains understand they can't open locked doors.
3168  *
3169  * Revision 1.292  1995/02/13  10:18:01  rob
3170  * Reduced brain guy's level of awareness to keep him from hogging slots.
3171  *
3172  * Revision 1.291  1995/02/11  12:27:12  mike
3173  * fix path-to-exit cheat.
3174  *
3175  * Revision 1.290  1995/02/11  01:56:30  mike
3176  * robots don't fire cheat.
3177  *
3178  * Revision 1.289  1995/02/10  17:15:09  rob
3179  * Fixed some stuff with 64 awareness stuff.
3180  *
3181  * Revision 1.288  1995/02/10  16:31:32  mike
3182  * oops.
3183  *
3184  * Revision 1.287  1995/02/10  16:24:45  mike
3185  * fix the network follow path fix.
3186  *
3187  * Revision 1.286  1995/02/10  16:11:40  mike
3188  * in serial or modem games, follow path guys don't move if far away and
3189  * can't see player.
3190  *
3191  * Revision 1.285  1995/02/09  13:11:35  mike
3192  * comment out a bunch of mprintfs.
3193  * add toaster (drops prox bombs, runs away) to boss gate list.
3194  *
3195  * Revision 1.284  1995/02/08  22:44:53  rob
3196  * Lowerd anger level for follow path of any sort.
3197  *
3198  * Revision 1.283  1995/02/08  22:30:43  mike
3199  * lower awareness on station guys if they are returning home (multiplayer).
3200  *
3201  * Revision 1.282  1995/02/08  17:01:06  rob
3202  * Fixed problem with toasters dropping of proximity bombs.
3203  *
3204  * Revision 1.281  1995/02/08  11:49:35  rob
3205  * Reduce Green-guy attack awareness level so we don't let him attack us too.
3206  *
3207  * Revision 1.280  1995/02/08  11:37:52  mike
3208  * Check for failures in call to obj_create.
3209  *
3210  * Revision 1.279  1995/02/07  20:38:46  mike
3211  * fix toasters in multiplayer
3212  *
3213  *
3214  * Revision 1.278  1995/02/07  16:51:07  mike
3215  * fix sound time play bug.
3216  *
3217  * Revision 1.277  1995/02/06  22:33:04  mike
3218  * make robots follow path better in cooperative/roboarchy.
3219  *
3220  * Revision 1.276  1995/02/06  18:15:42  rob
3221  * Added forced sends for evasion movemnet.
3222  *
3223  * Revision 1.275  1995/02/06  16:41:22  rob
3224  * Change some positioning calls.
3225  *
3226  * Revision 1.274  1995/02/06  11:40:33  mike
3227  * replace some lint-related hacks with clean, proper code.
3228  *
3229  * Revision 1.273  1995/02/04  17:28:19  mike
3230  * make station guys return better.
3231  *
3232  * Revision 1.272  1995/02/03  17:40:55  mike
3233  * fix problem with robots falling asleep if you sit in game overnight, not in pause...bah.
3234  *
3235  * Revision 1.271  1995/02/02  21:11:25  rob
3236  * Tweaking stuff for multiplayer ai.
3237  *
3238  * Revision 1.270  1995/02/02  17:32:06  john
3239  * Added Hack for Assert that Mike put in after using Lint to find
3240  * uninitialized variables.
3241  *
3242  * Revision 1.269  1995/02/02  16:46:31  mike
3243  * fix boss gating.
3244  *
3245  * Revision 1.268  1995/02/02  16:27:29  mike
3246  * make boss not put out infinite robots.
3247  *
3248  * Revision 1.267  1995/02/01  21:10:02  mike
3249  * lint found bug! player_visibility not initialized!
3250  *
3251  * Revision 1.266  1995/02/01  20:51:27  john
3252  * Lintized
3253  *
3254  * Revision 1.265  1995/02/01  17:14:05  mike
3255  * fix robot sounds.
3256  *
3257  * Revision 1.264  1995/01/31  16:16:40  mike
3258  * Comment out "Darn you, John" Int3().
3259  *
3260  * Revision 1.263  1995/01/30  20:55:04  mike
3261  * fix nonsense in robot firing when a player is cloaked.
3262  *
3263  * Revision 1.262  1995/01/30  17:15:10  rob
3264  * Fixed problems with bigboss eclip messages.
3265  * Tweaked robot position sending for modem purposes.
3266  *
3267  * Revision 1.261  1995/01/30  15:30:31  rob
3268  * Prevent non-master players from gating in robots.
3269  *
3270  * Revision 1.260  1995/01/30  13:30:55  mike
3271  * new cases for firing at other players were bogus, could send position
3272  * without permission.
3273  *
3274  * Revision 1.259  1995/01/30  13:01:17  mike
3275  * Make robots fire at player other than one they are controlled by sometimes.
3276  *
3277  * Revision 1.258  1995/01/29  16:09:17  rob
3278  * Trying to get robots to shoot at non-controlling players.
3279  *
3280  * Revision 1.257  1995/01/29  13:47:05  mike
3281  * Make boss have more fireballs on death, have until end (though silent at end).
3282  * Fix bug which was preventing him from teleporting until hit, so he'd always
3283  * be in the same place when the player enters the room.
3284  *
3285  * Revision 1.256  1995/01/28  17:40:18  mike
3286  * make boss teleport & gate before you see him.
3287  *
3288  * Revision 1.255  1995/01/27  17:02:08  mike
3289  * move code around, was sending one frame (or worse!) old robot information.
3290  *
3291  * Revision 1.254  1995/01/26  17:02:43  mike
3292  * make fusion cannon have more chrome, make fusion, mega rock you!
3293  *
3294  * Revision 1.253  1995/01/26  15:11:17  rob
3295  * Shutup!  I fixed it!
3296  *
3297  * Revision 1.252  1995/01/26  15:08:55  rob
3298  * Changed robot gating to accomodate multiplayer.
3299  *
3300  * Revision 1.251  1995/01/26  14:49:04  rob
3301  * Increase awareness level for firing to 94.
3302  *
3303  * Revision 1.250  1995/01/26  12:41:20  mike
3304  * fix bogus multiplayer code, would send permission without getting permission.
3305  *
3306  * Revision 1.249  1995/01/26  12:23:23  rob
3307  * Removed defines that were moved to ai.h
3308  *
3309  * Revision 1.248  1995/01/25  23:38:48  mike
3310  * modify list of robots gated in by super boss.
3311  *
3312  * Revision 1.247  1995/01/25  21:21:13  rob
3313  * Trying to let robots fire at a player even if they're not in control.
3314  *
3315  * Revision 1.246  1995/01/25  13:50:37  mike
3316  * Robots make angry sounds.
3317  *
3318  * Revision 1.245  1995/01/25  10:53:47  mike
3319  * better handling of robots which poke out of mine and try to recover.
3320  *
3321  * Revision 1.244  1995/01/24  22:03:02  mike
3322  * Tricky code to move a robot to a legal position if he is poking out of
3323  * the mine, even if it means moving him to another segment.
3324  *
3325  * Revision 1.243  1995/01/24  20:12:06  rob
3326  * Changed robot fire awareness level from 74 to 94.
3327  *
3328  * Revision 1.242  1995/01/24  13:22:32  mike
3329  * make robots accelerate faster, and Difficulty_level dependent.
3330  *
3331  * Revision 1.241  1995/01/24  12:09:39  mike
3332  * make robots animate in multiplayer.
3333  *
3334  * Revision 1.240  1995/01/21  21:21:10  mike
3335  * Make boss only gate robots into specified segments.
3336  *
3337  * Revision 1.239  1995/01/20  20:21:26  mike
3338  * prevent unnecessary boss cloaking.
3339
3340 ------------------------------------------------------------------------
3341 main/ai.h:
3342
3343  * Revision 1.3  1995/10/15  16:28:07  allender
3344  * added flag to player_is_visible function
3345  *
3346  * Revision 1.2  1995/10/10  11:48:32  allender
3347  * PC ai header
3348  *
3349  * Revision 1.1  1995/05/16  15:54:00  allender
3350  * Initial revision
3351  *
3352  * Revision 2.0  1995/02/27  11:33:07  john
3353  * New version 2.0, which has no anonymous unions, builds with
3354  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3355  *
3356  * Revision 1.57  1995/02/04  17:28:31  mike
3357  * make station guys return better.
3358  *
3359  * Revision 1.56  1995/02/04  10:03:23  mike
3360  * Fly to exit cheat.
3361  *
3362  * Revision 1.55  1995/02/01  19:23:52  rob
3363  * Externed a boss var.
3364  *
3365  * Revision 1.54  1995/01/30  13:00:58  mike
3366  * Make robots fire at player other than one they are controlled by sometimes.
3367  *
3368  * Revision 1.53  1995/01/26  15:09:16  rob
3369  * Changed robot gating to accomodate multiplayer.
3370  *
3371  * Revision 1.52  1995/01/26  12:23:12  rob
3372  * Added new externs needed for multiplayer.
3373  *
3374  * Revision 1.51  1995/01/21  21:22:14  mike
3375  * Kill prototype of init_boss_segments, which didn't need to be public
3376  * and had changed.
3377  *
3378  * Revision 1.50  1995/01/16  19:24:29  mike
3379  * Publicize BOSS_GATE_MATCEN_NUM and Boss_been_hit.
3380  *
3381  * Revision 1.49  1995/01/02  16:17:35  mike
3382  * prototype some super boss function for gameseq.
3383  *
3384  * Revision 1.48  1994/12/19  17:08:06  mike
3385  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3386  *
3387  * Revision 1.47  1994/12/12  17:18:04  mike
3388  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
3389  *
3390  * Revision 1.46  1994/12/08  15:46:16  mike
3391  * better robot behavior.
3392  *
3393  * Revision 1.45  1994/11/27  23:16:08  matt
3394  * Made debug code go away when debugging turned off
3395  *
3396  * Revision 1.44  1994/11/16  23:38:41  mike
3397  * new improved boss teleportation behavior.
3398  *
3399  * Revision 1.43  1994/11/10  17:45:11  mike
3400  * debugging.
3401  *
3402  * Revision 1.42  1994/11/07  10:37:42  mike
3403  * hooks for rob's network code.
3404  *
3405  * Revision 1.41  1994/11/06  15:10:50  mike
3406  * prototype a debug function for dumping ai info.
3407  *
3408  * Revision 1.40  1994/11/02  17:57:30  rob
3409  * Added extern of Believe_player_pos needed to get control centers
3410  * locating people.
3411  *
3412  * Revision 1.39  1994/10/28  19:43:39  mike
3413  * Prototype Boss_cloak_start_time, Boss_cloak_end_time.
3414  *
3415  * Revision 1.38  1994/10/22  14:14:42  mike
3416  * Prototype ai_reset_all_paths.
3417  *
3418  * Revision 1.37  1994/10/21  20:42:01  mike
3419  * Define MAX_PATH_LENGTH: maximum allowed length of a path.
3420  *
3421  * Revision 1.36  1994/10/20  09:49:18  mike
3422  * Prototype something.
3423  *
3424  *
3425  * Revision 1.35  1994/10/18  15:37:52  mike
3426  * Define ROBOT_BOSS1.
3427  *
3428  * Revision 1.34  1994/10/13  11:12:25  mike
3429  * Prototype some door functions.
3430  *
3431  * Revision 1.33  1994/10/12  21:28:51  mike
3432  * Prototype create_n_segment_path_to_door
3433  * Prototype ai_open_doors_in_segment
3434  * Prototype ai_door_is_openable.
3435  *
3436  * Revision 1.32  1994/10/11  15:59:41  mike
3437  * Prototype Robot_firing_enabled.
3438  *
3439  * Revision 1.31  1994/10/09  22:02:48  mike
3440  * Adapt create_path_points and create_n_segment_path prototypes to use avoid_seg for player evasion.
3441  *
3442  * Revision 1.30  1994/09/18  18:07:44  mike
3443  * Update prototypes for create_path_points and create_path_to_player.
3444  *
3445  * Revision 1.29  1994/09/15  16:34:08  mike
3446  * Prototype do_ai_robot_hit_attack.
3447  *
3448  * Revision 1.28  1994/09/12  19:12:35  mike
3449  * Prototype attempt_to_resume_path.
3450  *
3451  * Revision 1.27  1994/08/25  21:55:32  mike
3452  * Add some prototypes.
3453  *
3454  * Revision 1.26  1994/08/10  19:53:24  mike
3455  * Prototype create_path_to_player and init_robots_for_level.
3456  *
3457  * Revision 1.25  1994/08/04  16:32:58  mike
3458  * prototype create_path_to_player.
3459  *
3460  * Revision 1.24  1994/08/03  15:17:20  mike
3461  * Prototype make_random_vector.
3462  *
3463  * Revision 1.23  1994/07/31  18:10:34  mike
3464  * Update prototype for create_path_points.
3465  *
3466  * Revision 1.22  1994/07/28  12:36:14  matt
3467  * Cleaned up object bumping code
3468
3469 ------------------------------------------------------------------------
3470 main/ai2.c:
3471
3472  * Revision 1.1  1995/05/25  12:00:31  mike
3473  * Initial revision
3474
3475 ------------------------------------------------------------------------
3476 main/aipath.c:
3477
3478  * Revision 1.5  1995/10/26  14:12:03  allender
3479  * prototype functions for mcc compiler
3480  *
3481  * Revision 1.4  1995/10/25  09:38:22  allender
3482  * prototype some functions causing mcc grief
3483  *
3484  * Revision 1.3  1995/10/10  11:48:43  allender
3485  * PC ai code
3486  *
3487  * Revision 2.0  1995/02/27  11:30:48  john
3488  * New version 2.0, which has no anonymous unions, builds with
3489  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3490  *
3491  * Revision 1.101  1995/02/22  13:42:44  allender
3492  * remove anonymous unions for object structure
3493  *
3494  * Revision 1.100  1995/02/10  16:20:04  mike
3495  * fix bogosity in create_path_points, assumed all objects were robots.
3496  *
3497  * Revision 1.99  1995/02/07  21:09:30  mike
3498  * make run_from guys have diff level based speed.
3499  *
3500  * Revision 1.98  1995/02/04  17:28:29  mike
3501  * make station guys return better.
3502  *
3503  * Revision 1.97  1995/02/04  10:28:39  mike
3504  * fix compile error!
3505  *
3506  * Revision 1.96  1995/02/04  10:03:37  mike
3507  * Fly to exit cheat.
3508  *
3509  * Revision 1.95  1995/02/01  21:10:36  mike
3510  * Array name was dereferenced.  Not a bug, but unclean.
3511  *
3512  * Revision 1.94  1995/02/01  17:14:12  mike
3513  * comment out some common mprintfs which didn't matter.
3514  *
3515  * Revision 1.93  1995/01/30  13:01:23  mike
3516  * Make robots fire at player other than one they are controlled by sometimes.
3517  *
3518  * Revision 1.92  1995/01/29  22:29:32  mike
3519  * add more debug info for guys that get lost.
3520  *
3521  * Revision 1.91  1995/01/20  16:56:05  mike
3522  * station stuff.
3523  *
3524  * Revision 1.90  1995/01/18  10:59:45  mike
3525  * comment out some mprintfs.
3526  *
3527  * Revision 1.89  1995/01/17  16:58:34  mike
3528  * make path following work for multiplayer.
3529  *
3530  * Revision 1.88  1995/01/17  14:21:44  mike
3531  * make run_from guys run better.
3532  *
3533  * Revision 1.87  1995/01/14  17:09:04  mike
3534  * playing with crazy josh, he's kinda slow and dumb now.
3535  *
3536  * Revision 1.86  1995/01/13  18:52:28  mike
3537  * comment out int3.
3538  *
3539  * Revision 1.85  1995/01/05  09:42:11  mike
3540  * compile out code based on SHAREWARE.
3541  *
3542  * Revision 1.84  1995/01/02  12:38:32  mike
3543  * make crazy josh turn faster, therefore evade player better.
3544  *
3545  * Revision 1.83  1994/12/27  15:59:40  mike
3546  * tweak ai_multiplayer_awareness constants.
3547  *
3548  * Revision 1.82  1994/12/19  17:07:10  mike
3549  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3550  *
3551  * Revision 1.81  1994/12/15  13:04:30  mike
3552  * Replace Players[Player_num].time_total references with GameTime.
3553  *
3554  * Revision 1.80  1994/12/09  16:13:23  mike
3555  * remove debug code.
3556  *
3557  * Revision 1.79  1994/12/07  00:36:54  mike
3558  * make robots get out of matcens better and be aware of player.
3559  *
3560  * Revision 1.78  1994/11/30  00:59:05  mike
3561  * optimizations.
3562  *
3563  * Revision 1.77  1994/11/27  23:13:39  matt
3564  * Made changes for new mprintf calling convention
3565  *
3566  * Revision 1.76  1994/11/23  21:59:34  mike
3567  * comment out some mprintfs.
3568  *
3569  * Revision 1.75  1994/11/21  16:07:14  mike
3570  * flip PARALLAX flag, prevent annoying debug information.
3571  *
3572  * Revision 1.74  1994/11/19  15:13:28  mike
3573  * remove unused code and data.
3574  *
3575  * Revision 1.73  1994/11/17  14:53:15  mike
3576  * segment validation functions moved from editor to main.
3577  *
3578  * Revision 1.72  1994/11/16  23:38:42  mike
3579  * new improved boss teleportation behavior.
3580  *
3581  * Revision 1.71  1994/11/13  17:18:30  mike
3582  * debug code, then comment it out.
3583  *
3584  * Revision 1.70  1994/11/11  16:41:43  mike
3585  * flip the PARALLAX flag.
3586  *
3587  * Revision 1.69  1994/11/11  16:33:45  mike
3588  * twiddle the PARALLAX flag.
3589  *
3590  *
3591  * Revision 1.68  1994/11/10  21:32:29  mike
3592  * debug code.
3593  *
3594  * Revision 1.67  1994/11/10  20:15:07  mike
3595  * fix stupid bug: uninitialized pointer.
3596  *
3597  * Revision 1.66  1994/11/10  17:45:15  mike
3598  * debugging.
3599  *
3600  * Revision 1.65  1994/11/10  17:28:10  mike
3601  * debugging.
3602
3603 ------------------------------------------------------------------------
3604 main/aistruct.h:
3605
3606  * Revision 1.2  1995/10/10  11:49:04  allender
3607  * PC ai code
3608  *
3609  * Revision 1.1  1995/05/16  15:54:08  allender
3610  * Initial revision
3611  *
3612  * Revision 2.0  1995/02/27  11:30:19  john
3613  * New version 2.0, which has no anonymous unions, builds with
3614  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3615  *
3616  * Revision 1.34  1995/01/25  13:50:46  mike
3617  * Robots make angry sounds.
3618  *
3619  * Revision 1.33  1994/12/29  12:44:56  rob
3620  * Added new coop robot flag.
3621  *
3622  * Revision 1.32  1994/12/20  20:41:54  rob
3623  * Added new ai flag for multiplayer robots.
3624  *
3625  * Revision 1.31  1994/12/19  16:37:39  rob
3626  * Added a new flag for remote controlled objects.
3627  *
3628  * Revision 1.30  1994/12/07  00:36:07  mike
3629  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
3630  *
3631  * Revision 1.29  1994/12/02  22:06:28  mike
3632  * add fields to allow robots to make awareness sounds every so often, not every damn blasted frame
3633  *
3634  * Revision 1.28  1994/11/04  17:18:35  yuan
3635  * Increased MAX_SEG_POINTS to 2500.
3636  *
3637  * Revision 1.27  1994/10/17  21:19:22  mike
3638  * robot cloaking.
3639  *
3640  * Revision 1.26  1994/10/12  21:28:38  mike
3641  * Add new ai mode: AIM_OPEN_DOOR.
3642  * Add GOALSIDE to aip.
3643  *
3644  * Revision 1.25  1994/09/25  23:41:08  matt
3645  * Changed the object load & save code to read/write the structure fields one
3646  * at a time (rather than the whole structure at once).  This mean that the
3647  * object structure can be changed without breaking the load/save functions.
3648  * As a result of this change, the local_object data can be and has been
3649  * incorporated into the object array.  Also, timeleft is now a property
3650  * of all objects, and the object structure has been otherwise cleaned up.
3651  *
3652  * Revision 1.24  1994/09/21  12:28:11  mike
3653  * Change AI behavior for when player cloaked
3654  *
3655  * Revision 1.23  1994/09/19  21:43:00  mike
3656  * Add follow_path_start_seg and follow_path_end_seg to aistruct.h.
3657  *
3658  * Revision 1.22  1994/09/18  18:06:14  mike
3659  * Add Last_uncloaked_time and Last_uncloaked_position variables.
3660  *
3661  * Revision 1.21  1994/09/15  16:31:38  mike
3662  * Define GREEN_GUY
3663  * Add previous_visibility to ai_local struct.
3664  *
3665  * Revision 1.20  1994/09/12  19:12:45  mike
3666  * Change some bytes to ints in ai_local so I could set watchpoints.
3667  *
3668  * Revision 1.19  1994/08/25  21:53:31  mike
3669  * Add behavior, taking place of what used to be mode.
3670  *
3671  * Revision 1.18  1994/08/23  16:38:09  mike
3672  * rapidfire_count in ai_local.
3673  *
3674  * Revision 1.17  1994/08/19  17:38:23  mike
3675  * *** empty log message ***
3676  *
3677  * Revision 1.16  1994/08/17  22:18:58  mike
3678  * add time_since_processed to ai_local.
3679  *
3680  * Revision 1.15  1994/08/10  19:52:25  mike
3681  * Add Overall_agitation.
3682  *
3683  * Revision 1.14  1994/08/04  16:32:32  mike
3684  * Add time_player_seen.
3685  *
3686  * Revision 1.13  1994/07/28  16:58:11  mike
3687  * Move constants from ai.c
3688  *
3689  * Revision 1.12  1994/07/19  15:26:24  mike
3690  * New ai_static and ai_local structures.
3691  *
3692  * Revision 1.11  1994/07/15  15:17:19  matt
3693  * Changes MAX_AI_FLAGS for better alignment
3694
3695 ------------------------------------------------------------------------
3696 main/automap.c:
3697
3698  * Revision 1.8  1995/10/31  10:24:54  allender
3699  * shareware stuff
3700  *
3701  * Revision 1.7  1995/10/21  16:18:20  allender
3702  * blit pcx background directly to Page canvas instead of creating
3703  * seperate bitmap for it -- hope to solve VM bug on some macs
3704  *
3705  * Revision 1.6  1995/10/20  00:49:16  allender
3706  * added redbook check during automap
3707  *
3708  * Revision 1.5  1995/09/13  08:44:07  allender
3709  * Dave Denhart's changes to speed up the automap
3710  *
3711  * Revision 1.4  1995/08/18  15:46:00  allender
3712  * put text all on upper bar -- and fixed background since
3713  * changing xparency color
3714  *
3715  * Revision 1.3  1995/08/03  15:15:18  allender
3716  * fixed edge hashing problem causing automap to crash
3717  *
3718  * Revision 1.2  1995/07/12  12:49:27  allender
3719  * works in 640x480 mode
3720  *
3721  * Revision 1.1  1995/05/16  15:22:59  allender
3722  * Initial revision
3723  *
3724  * Revision 2.2  1995/03/21  14:41:26  john
3725  * Ifdef'd out the NETWORK code.
3726  *
3727  * Revision 2.1  1995/03/20  18:16:06  john
3728  * Added code to not store the normals in the segment structure.
3729  *
3730  * Revision 2.0  1995/02/27  11:32:55  john
3731  * New version 2.0, which has no anonymous unions, builds with
3732  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3733  *
3734  * Revision 1.117  1995/02/22  14:11:31  allender
3735  * remove anonymous unions from object structure
3736  *
3737  * Revision 1.116  1995/02/22  13:24:39  john
3738  * Removed the vecmat anonymous unions.
3739  *
3740  * Revision 1.115  1995/02/09  14:57:02  john
3741  * Reduced mem usage. Made automap slide farther.
3742  *
3743  * Revision 1.114  1995/02/07  20:40:44  rob
3744  * Allow for anarchy automap of player pos by option.
3745  *
3746  * Revision 1.113  1995/02/07  15:45:33  john
3747  * Made automap memory be static.
3748  *
3749  * Revision 1.112  1995/02/02  12:24:00  adam
3750  * played with automap labels
3751  *
3752  * Revision 1.111  1995/02/02  01:52:52  john
3753  * Made the automap use small font.
3754  *
3755  * Revision 1.110  1995/02/02  01:34:34  john
3756  * Made Reset in automap not change segmentlimit.
3757  *
3758  * Revision 1.109  1995/02/02  01:23:11  john
3759  * Finalized the new automap partial viewer.
3760  *
3761  * Revision 1.108  1995/02/02  00:49:45  mike
3762  * new automap segment-depth functionality.
3763  *
3764  * Revision 1.107  1995/02/02  00:23:04  john
3765  * Half of the code for new connected distance stuff in automap.
3766  *
3767  * Revision 1.106  1995/02/01  22:54:00  john
3768  * Made colored doors not fade in automap. Made default
3769  * viewing area be maxxed.
3770  *
3771  * Revision 1.105  1995/02/01  13:16:13  john
3772  * Added great grates.
3773  *
3774  * Revision 1.104  1995/01/31  12:47:06  john
3775  * Made Alt+F only work with cheats enabled.
3776  *
3777  * Revision 1.103  1995/01/31  12:41:23  john
3778  * Working with new controls.
3779  *
3780  * Revision 1.102  1995/01/31  12:04:19  john
3781  * Version 2 of new key control.
3782  *
3783  * Revision 1.101  1995/01/31  11:32:00  john
3784  * First version of new automap system.
3785  *
3786  * Revision 1.100  1995/01/28  16:55:48  john
3787  * Made keys draw in automap in the segments that you have
3788  * visited.
3789  *
3790  * Revision 1.99  1995/01/28  14:44:51  john
3791  * Made hostage doors show up on automap.
3792  *
3793  * Revision 1.98  1995/01/22  17:03:49  rob
3794  * Fixed problem drawing playerships in automap coop/team mode
3795  *
3796  * Revision 1.97  1995/01/21  17:23:11  john
3797  * Limited S movement in map. Made map bitmap load from disk
3798  * and then freed it.
3799  *
3800  * Revision 1.96  1995/01/19  18:55:38  john
3801  * Don't draw players in automap if not obj_player.
3802  *
3803  * Revision 1.95  1995/01/19  18:48:13  john
3804  * Made player colors better in automap.
3805  *
3806  * Revision 1.94  1995/01/19  17:34:52  rob
3807  * Added team colorizations in automap.
3808  *
3809  * Revision 1.93  1995/01/19  17:15:36  rob
3810  * Trying to add player ships into map for coop and team mode.
3811  *
3812  * Revision 1.92  1995/01/19  17:11:09  john
3813  * Added code for Rob to draw Multiplayer ships in automap.
3814  *
3815  * Revision 1.91  1995/01/12  13:35:20  john
3816  * Fixed bug with Segment 0 not getting displayed
3817  * in automap if you have EDITOR compiled in.
3818  *
3819  * Revision 1.90  1995/01/08  16:17:14  john
3820  * Added code to draw player's up vector while in automap.
3821  *
3822  * Revision 1.89  1995/01/08  16:09:41  john
3823  * Fixed problems with grate.
3824  *
3825  * Revision 1.88  1994/12/14  22:54:17  john
3826  * Fixed bug that didn't show hostages in automap.
3827  *
3828  * Revision 1.87  1994/12/09  00:41:03  mike
3829  * fix hang in automap print screen
3830  *
3831  * Revision 1.86  1994/12/05  23:37:15  matt
3832  * Took out calls to warning() function
3833  *
3834  * Revision 1.85  1994/12/03  22:35:28  yuan
3835  * Localization 412
3836  *
3837  * Revision 1.84  1994/12/02  15:05:45  matt
3838  * Added new "official" cheats
3839  *
3840  * Revision 1.83  1994/11/30  12:10:49  adam
3841  * added support for PCX titles/brief screens
3842  *
3843  * Revision 1.82  1994/11/27  23:15:12  matt
3844  * Made changes for new mprintf calling convention
3845  *
3846  * Revision 1.81  1994/11/27  15:35:52  matt
3847  * Enable screen shots even when debugging is turned off
3848  *
3849  * Revision 1.80  1994/11/26  22:51:43  matt
3850  * Removed editor-only fields from segment structure when editor is compiled
3851  * out, and padded segment structure to even multiple of 4 bytes.
3852  *
3853  * Revision 1.79  1994/11/26  16:22:48  matt
3854  * Reduced leave_time
3855  *
3856  * Revision 1.78  1994/11/23  22:00:10  mike
3857  * show level number.
3858  *
3859  * Revision 1.77  1994/11/21  11:40:33  rob
3860  * Tweaked the game-loop for automap in multiplayer games.
3861  *
3862  * Revision 1.76  1994/11/18  16:42:06  adam
3863  * removed a font
3864  *
3865  * Revision 1.75  1994/11/17  13:06:48  adam
3866  * changed font
3867  *
3868  * Revision 1.74  1994/11/14  20:47:17  john
3869  * Attempted to strip out all the code in the game
3870  * directory that uses any ui code.
3871
3872 ------------------------------------------------------------------------
3873 main/automap.h:
3874
3875  * Revision 1.2  1995/07/12  12:48:33  allender
3876  * moved edge_list structure into here for mallocing in mglobal
3877  *
3878  * Revision 1.1  1995/05/16  15:54:31  allender
3879  * Initial revision
3880  *
3881  * Revision 2.0  1995/02/27  11:29:35  john
3882  * New version 2.0, which has no anonymous unions, builds with
3883  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3884  *
3885  * Revision 1.5  1994/12/09  00:41:21  mike
3886  * fix hang in automap print screen
3887  *
3888  * Revision 1.4  1994/07/14  11:25:29  john
3889  * Made control centers destroy better; made automap use Tab key.
3890  *
3891  * Revision 1.3  1994/07/12  15:45:51  john
3892  * Made paritial map.
3893  *
3894  * Revision 1.2  1994/07/07  18:35:05  john
3895  * First version of automap
3896  *
3897  * Revision 1.1  1994/07/07  15:12:13  john
3898  * Initial revision
3899
3900 ------------------------------------------------------------------------
3901 main/bm.c:
3902
3903  * Revision 1.1  1995/05/16  15:23:08  allender
3904  * Initial revision
3905  *
3906  * Revision 2.3  1995/03/14  16:22:04  john
3907  * Added cdrom alternate directory stuff.
3908  *
3909  * Revision 2.2  1995/03/07  16:51:48  john
3910  * Fixed robots not moving without edtiro bug.
3911  *
3912  * Revision 2.1  1995/03/06  15:23:06  john
3913  * New screen techniques.
3914  *
3915  * Revision 2.0  1995/02/27  11:27:05  john
3916  * New version 2.0, which has no anonymous unions, builds with
3917  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3918
3919 ------------------------------------------------------------------------
3920 main/bm.h:
3921
3922  * Revision 1.1  1995/05/16  15:54:39  allender
3923  * Initial revision
3924  *
3925  * Revision 2.0  1995/02/27  11:32:59  john
3926  * New version 2.0, which has no anonymous unions, builds with
3927  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3928  *
3929  * Revision 1.60  1994/12/06  13:24:58  matt
3930  * Made exit model come out of bitmaps.tbl
3931  *
3932  * Revision 1.59  1994/11/10  14:02:48  matt
3933  * Hacked in support for player ships with different textures
3934  *
3935  * Revision 1.58  1994/10/27  13:32:17  john
3936  * Made TmapList only be in if editor
3937  *
3938  * Revision 1.57  1994/10/11  12:25:20  matt
3939  * Added "hot rocks" that create badass explosion when hit by weapons
3940  *
3941  * Revision 1.56  1994/09/29  12:38:13  matt
3942  * Took out include of digi.h, saving hours of unneeded compiles
3943  *
3944  * Revision 1.55  1994/09/25  00:39:51  matt
3945  * Added the ability to make eclips (monitors, fans) which can be blown up
3946  *
3947  * Revision 1.54  1994/09/17  01:40:59  matt
3948  * Added status bar/sizable window mode, and in the process revamped the
3949  * whole cockpit mode system.
3950  *
3951  * Revision 1.53  1994/09/08  16:20:48  matt
3952  * Gave textures the ability to cause damage when scraped
3953  *
3954  * Revision 1.52  1994/08/30  22:23:43  matt
3955  * Added cabability for player ship to have alternate model to use to
3956  * create debris.
3957  *
3958  * Revision 1.51  1994/08/26  15:35:57  matt
3959  * Made eclips usable on more than one object at a time
3960  *
3961  * Revision 1.50  1994/08/23  16:59:51  john
3962  * Added 3 cockpuits
3963  *
3964  * Revision 1.49  1994/08/19  20:09:43  matt
3965  * Added end-of-level cut scene with external scene
3966  *
3967  * Revision 1.48  1994/08/12  22:20:45  matt
3968  * Generalized polygon objects (such as control center)
3969  *
3970  * Revision 1.47  1994/08/09  16:04:21  john
3971  * Added network players to editor.
3972  *
3973  * Revision 1.46  1994/08/09  09:01:31  john
3974  * Increase MAX_TEXTURES
3975  *
3976  * Revision 1.45  1994/07/13  00:14:57  matt
3977  * Moved all (or nearly all) of the values that affect player movement to
3978  * bitmaps.tbl
3979  *
3980  * Revision 1.44  1994/06/20  21:33:15  matt
3981  * Made bm.h not include sounds.h, to reduce dependencies
3982  *
3983  * Revision 1.43  1994/06/15  11:55:58  matt
3984  * Added 3d model for player
3985  *
3986  * Revision 1.42  1994/06/13  16:09:11  adam
3987  * increased max textures to 600
3988  *
3989  * Revision 1.41  1994/06/06  15:38:58  john
3990  * Made fullscreen view be just another cockpit, but the "hole"
3991  * in the cockpit is just bigger.
3992  *
3993  * Revision 1.40  1994/05/26  21:08:59  matt
3994  * Moved robot stuff out of polygon model and into robot_info struct
3995  * Made new file, robot.c, to deal with robots
3996  *
3997  * Revision 1.39  1994/05/18  11:00:05  mike
3998  * Add robot_info stuff.
3999  *
4000  * Revision 1.38  1994/05/17  14:44:56  mike
4001  * Get object type and id from ObjType and ObjId.
4002  *
4003  * Revision 1.37  1994/05/17  12:04:45  mike
4004  * Deal with little known fact that polygon object != robot.
4005  *
4006  * Revision 1.36  1994/05/16  16:17:35  john
4007  * Bunch of stuff on my Inferno Task list May16-23
4008  *
4009  * Revision 1.35  1994/04/27  11:43:42  john
4010  * First version of sound! Yay!
4011  *
4012  * Revision 1.34  1994/04/22  10:53:48  john
4013  * Increased MAX_TEXTURES to 500.
4014  *
4015  * Revision 1.33  1994/04/01  11:15:05  yuan
4016  * Added multiple bitmap functionality to all objects...
4017  * (hostages, powerups, lasers, etc.)
4018  * Hostages and powerups are implemented in the object system,
4019  * just need to finish function call to "affect" player.
4020  *
4021  * Revision 1.32  1994/03/25  17:30:37  yuan
4022  * Checking in hostage stuff.
4023  *
4024  * Revision 1.31  1994/03/17  18:07:28  yuan
4025  * Removed switch code... Now we just have Walls, Triggers, and Links...
4026  *
4027  * Revision 1.30  1994/03/15  17:03:51  yuan
4028  * Added Robot/object bitmap capability
4029  *
4030  * Revision 1.29  1994/03/15  16:32:58  yuan
4031  * Cleaned up bm-loading code.
4032  * (Fixed structures too)
4033  *
4034  * Revision 1.28  1994/03/04  17:09:13  yuan
4035  * New door stuff.
4036  *
4037  * Revision 1.27  1994/01/31  14:50:09  yuan
4038  * Added Robotex
4039  *
4040  * Revision 1.26  1994/01/31  12:27:14  yuan
4041  * Added demo stuff (menu, etc.)
4042  *
4043  * Revision 1.25  1994/01/25  17:11:43  john
4044  * New texmaped lasers.
4045  *
4046  * Revision 1.24  1994/01/24  11:48:06  yuan
4047  * Lighting stuff
4048  *
4049  * Revision 1.23  1994/01/22  13:40:15  yuan
4050  * Modified the bmd_bitmap structure a bit.
4051  * (Saves some memory, and added reflection)
4052  *
4053  * Revision 1.22  1994/01/11  10:58:38  yuan
4054  * Added effects system
4055  *
4056  * Revision 1.21  1994/01/06  17:13:12  john
4057  * Added Video clip functionality
4058  *
4059  * Revision 1.20  1993/12/21  20:00:15  john
4060  * moved selector stuff to grs_bitmap
4061  *
4062  * Revision 1.19  1993/12/21  19:33:58  john
4063  * Added selector to bmd_bitmap.
4064  *
4065  * Revision 1.18  1993/12/07  12:28:48  john
4066  * moved bmd_palette to gr_palette
4067  *
4068  * Revision 1.17  1993/12/06  18:40:37  matt
4069  * Changed object loading & handling
4070  *
4071  * Revision 1.16  1993/12/05  23:05:03  matt
4072  * Added include of gr.h
4073  *
4074  * Revision 1.15  1993/12/03  17:38:04  yuan
4075  * Ooops. meant to say:
4076  * Moved MAX variables to bm.c, Arrays left open.
4077  *
4078  * Revision 1.14  1993/12/03  17:37:26  yuan
4079  * Added Asserts.
4080  *
4081  * Revision 1.13  1993/12/02  17:22:54  yuan
4082  * New global var. Num_object_types
4083  *
4084  * Revision 1.12  1993/12/02  16:34:39  yuan
4085  * Added fireball hack stuff.
4086  *
4087  * Revision 1.11  1993/12/02  15:45:14  yuan
4088  * Added a buncha constants, variables, and function prototypes
4089  * for the new bitmaps.tbl format.
4090  *
4091  * Revision 1.10  1993/12/01  11:25:11  yuan
4092  * Changed MALLOC'd buffers for filename and type in
4093  * the bmd_bitmap structure into arrays... Saves time
4094  * at load up.
4095  *
4096  * Revision 1.9  1993/12/01  00:28:09  yuan
4097  * New bitmap system structure.
4098  *
4099  * Revision 1.8  1993/11/03  11:34:08  john
4100  * made it use bitmaps.tbl
4101  *
4102  * Revision 1.7  1993/10/26  18:11:03  john
4103  * made all palette data be statically allocated
4104  *
4105  * Revision 1.6  1993/10/19  12:17:51  john
4106  * *** empty log message ***
4107  *
4108  * Revision 1.5  1993/10/16  20:02:41  matt
4109  * Changed name of backdrop bitmap file
4110  *
4111  * Revision 1.4  1993/10/12  15:08:52  matt
4112  * Added a bunch of new textures
4113  *
4114  * Revision 1.3  1993/10/12  12:30:41  john
4115  * *** empty log message ***
4116  *
4117  * Revision 1.2  1993/10/12  11:27:58  john
4118  * added more bitmaps
4119  *
4120  * Revision 1.1  1993/09/23  13:09:10  john
4121  * Initial revision
4122
4123 ------------------------------------------------------------------------
4124 main/bmread.c:
4125
4126  * Revision 2.4  1995/03/28  18:05:29  john
4127  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
4128  *
4129  * Revision 2.3  1995/03/07  16:52:03  john
4130  * Fixed robots not moving without edtiro bug.
4131  *
4132  * Revision 2.2  1995/03/06  16:10:20  mike
4133  * Fix compile errors if building without editor.
4134  *
4135  * Revision 2.1  1995/03/02  14:55:40  john
4136  * Fixed bug with EDITOR never defined.
4137  *
4138  * Revision 2.0  1995/02/27  11:33:10  john
4139  * New version 2.0, which has no anonymous unions, builds with
4140  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4141  *
4142  * Revision 1.1  1995/02/25  14:02:36  john
4143  * Initial revision
4144
4145 ------------------------------------------------------------------------
4146 main/ctrlcen.c:
4147
4148  * Revision 1.2  1995/10/17  13:12:13  allender
4149  * added param to ai call
4150  *
4151  * Revision 1.1  1995/05/16  15:23:27  allender
4152  * Initial revision
4153  *
4154  * Revision 2.1  1995/03/21  14:40:25  john
4155  * Ifdef'd out the NETWORK code.
4156  *
4157  * Revision 2.0  1995/02/27  11:31:25  john
4158  * New version 2.0, which has no anonymous unions, builds with
4159  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4160  *
4161  * Revision 1.22  1995/02/11  01:56:14  mike
4162  * robots don't fire cheat.
4163  *
4164  * Revision 1.21  1995/02/05  13:39:39  mike
4165  * fix stupid bug in control center firing timing.
4166  *
4167  * Revision 1.20  1995/02/03  17:41:21  mike
4168  * fix control cen next fire time in multiplayer.
4169  *
4170  * Revision 1.19  1995/01/29  13:46:41  mike
4171  * adapt to new create_small_fireball_on_object prototype.
4172  *
4173  * Revision 1.18  1995/01/18  16:12:13  mike
4174  * Make control center aware of a cloaked playerr when he fires.
4175  *
4176  * Revision 1.17  1995/01/12  12:53:44  rob
4177  * Trying to fix a bug with having cntrlcen in robotarchy games.
4178  *
4179  * Revision 1.16  1994/12/11  12:37:22  mike
4180  * make control center smarter about firing at cloaked player, don't fire through self, though
4181  * it still looks that way due to prioritization problems.
4182  *
4183  * Revision 1.15  1994/12/01  11:34:33  mike
4184  * fix control center shield strength in multiplayer team games.
4185  *
4186  * Revision 1.14  1994/11/30  15:44:29  mike
4187  * make cntrlcen harder at higher levels.
4188  *
4189  * Revision 1.13  1994/11/29  22:26:23  yuan
4190  * Fixed boss bug.
4191  *
4192  * Revision 1.12  1994/11/27  23:12:31  matt
4193  * Made changes for new mprintf calling convention
4194  *
4195  * Revision 1.11  1994/11/23  17:29:38  mike
4196  * deal with peculiarities going between net and regular game on boss level.
4197  *
4198  * Revision 1.10  1994/11/18  18:27:15  rob
4199  * Fixed some bugs with the last version.
4200  *
4201  * Revision 1.9  1994/11/18  17:13:59  mike
4202  * special case handling for level 8.
4203  *
4204  * Revision 1.8  1994/11/15  12:45:28  mike
4205  * don't let cntrlcen know where a cloaked player is.
4206  *
4207  * Revision 1.7  1994/11/08  12:18:37  mike
4208  * small explosions on control center.
4209  *
4210  * Revision 1.6  1994/11/02  17:59:18  rob
4211  * Changed control centers so they can find people in network games.
4212  * Side effect of this is that control centers can find cloaked players.
4213  * (see in-code comments for explanation).
4214  * Also added network hooks so control center shots 'sync up'.
4215  *
4216  * Revision 1.5  1994/10/22  14:13:21  mike
4217  * Make control center stop firing shortly after player dies.
4218  * Fix bug: If play from editor and die, tries to initialize non-control center object.
4219  *
4220  * Revision 1.4  1994/10/20  15:17:30  mike
4221  * Hack for control center inside boss robot.
4222  *
4223  * Revision 1.3  1994/10/20  09:47:46  mike
4224  * lots stuff.
4225  *
4226  * Revision 1.2  1994/10/17  21:35:09  matt
4227  * Added support for new Control Center/Main Reactor
4228  *
4229  * Revision 1.1  1994/10/17  20:24:01  matt
4230  * Initial revision
4231
4232 ------------------------------------------------------------------------
4233 main/ctrlcen.h:
4234
4235  * Revision 2.0  1995/02/27  11:30:40  john
4236  * New version 2.0, which has no anonymous unions, builds with
4237  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4238  *
4239  * Revision 1.7  1995/02/01  16:34:14  john
4240  * Linted.
4241  *
4242  * Revision 1.6  1995/01/03  20:19:14  john
4243  * Pretty good working version of game save.
4244  *
4245  * Revision 1.5  1994/11/08  12:18:28  mike
4246  * small explosions on control center.
4247  *
4248  * Revision 1.4  1994/11/02  18:00:12  rob
4249  * Added extern for Gun_pos array for network hooks.
4250  *
4251  * Revision 1.3  1994/10/20  09:47:37  mike
4252  * *** empty log message ***
4253  *
4254  * Revision 1.2  1994/10/17  21:35:10  matt
4255  * Added support for new Control Center/Main Reactor
4256  *
4257  * Revision 1.1  1994/10/17  20:24:28  matt
4258  * Initial revision
4259
4260 ------------------------------------------------------------------------
4261 main/collide.c:
4262
4263  * Revision 1.3  1995/11/08  17:15:21  allender
4264  * make collide_player_and_weapon play player_hit_sound if
4265  * shareware and not my playernum
4266  *
4267  * Revision 1.2  1995/10/31  10:24:37  allender
4268  * shareware stuff
4269  *
4270  * Revision 1.1  1995/05/16  15:23:34  allender
4271  * Initial revision
4272  *
4273  * Revision 2.5  1995/07/26  12:07:46  john
4274  * Made code that pages in weapon_info->robot_hit_vclip not
4275  * page in unless it is a badass weapon.  Took out old functionallity
4276  * of using this if no robot exp1_vclip, since all robots have these.
4277  *
4278  * Revision 2.4  1995/03/30  16:36:09  mike
4279  * text localization.
4280  *
4281  * Revision 2.3  1995/03/24  15:11:13  john
4282  * Added ugly robot cheat.
4283  *
4284  * Revision 2.2  1995/03/21  14:41:04  john
4285  * Ifdef'd out the NETWORK code.
4286  *
4287  * Revision 2.1  1995/03/20  18:16:02  john
4288  * Added code to not store the normals in the segment structure.
4289  *
4290  * Revision 2.0  1995/02/27  11:32:20  john
4291  * New version 2.0, which has no anonymous unions, builds with
4292  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4293  *
4294  * Revision 1.289  1995/02/22  13:56:06  allender
4295  * remove anonymous unions from object structure
4296  *
4297  * Revision 1.288  1995/02/11  15:52:45  rob
4298  * Included text.h.
4299  *
4300  * Revision 1.287  1995/02/11  15:04:11  rob
4301  * Localized a string.
4302  *
4303  * Revision 1.286  1995/02/11  14:25:41  rob
4304  * Added invul. controlcen option.
4305  *
4306  * Revision 1.285  1995/02/06  15:53:00  mike
4307  * create awareness event for player:wall collision.
4308  *
4309  * Revision 1.284  1995/02/05  23:18:17  matt
4310  * Deal with objects (such as fusion blobs) that get created already
4311  * poking through a wall
4312  *
4313  * Revision 1.283  1995/02/01  17:51:33  mike
4314  * fusion bolt can now toast multiple proximity bombs.
4315  *
4316  * Revision 1.282  1995/02/01  17:29:20  john
4317  * Lintized
4318  *
4319  * Revision 1.281  1995/02/01  15:04:00  rob
4320  * Changed sound of weapons hitting invulnerable players.
4321  *
4322  * Revision 1.280  1995/01/31  16:16:35  mike
4323  * Separate smart blobs for robot and player.
4324  *
4325  * Revision 1.279  1995/01/29  15:57:10  rob
4326  * Fixed another bug with robot_request_change calls.
4327  *
4328  * Revision 1.278  1995/01/28  18:15:06  rob
4329  * Fixed a bug in multi_request_robot_change.
4330  *
4331  * Revision 1.277  1995/01/27  15:15:44  rob
4332  * Fixing problems with controlcen damage.
4333  *
4334  * Revision 1.276  1995/01/27  15:13:10  mike
4335  * comment out mprintf.
4336  *
4337  * Revision 1.275  1995/01/26  22:11:51  mike
4338  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4339  *
4340  * Revision 1.274  1995/01/26  18:57:55  rob
4341  * Changed two uses of digi_play_sample to digi_link_sound_to_pos which
4342  * made more sense.
4343  *
4344  * Revision 1.273  1995/01/25  23:37:58  mike
4345  * make persistent objects not hit player more than once.
4346  * Also, make them hit player before degrading them, else they often did 0 damage.
4347  *
4348  * Revision 1.272  1995/01/25  18:23:54  rob
4349  * Don't let players pick up powerups in exit tunnel.
4350  *
4351  * Revision 1.271  1995/01/25  13:43:18  rob
4352  * Added robot transfer for player collisions.
4353  * Removed mprintf from collide.c on Mike's request.
4354  *
4355  * Revision 1.270  1995/01/25  10:24:01  mike
4356  * Make sizzle and rock happen in lava even if you're invulnerable.
4357  *
4358  * Revision 1.269  1995/01/22  17:05:33  mike
4359  * Call multi_robot_request_change when a robot gets whacked by a player or
4360  * player weapon, if player_num != Player_num
4361  *
4362  * Revision 1.268  1995/01/21  21:20:28  matt
4363  * Fixed stupid bug
4364  *
4365  * Revision 1.267  1995/01/21  18:47:47  rob
4366  * Fixed a really dumb bug with player keys.
4367  *
4368  * Revision 1.266  1995/01/21  17:39:30  matt
4369  * Cleaned up laser/player hit wall confusions
4370  *
4371  * Revision 1.265  1995/01/19  17:44:42  mike
4372  * damage_force removed, that information coming from strength field.
4373  *
4374  * Revision 1.264  1995/01/18  17:12:56  rob
4375  * Fixed control stuff for multiplayer.
4376  *
4377  * Revision 1.263  1995/01/18  16:12:33  mike
4378  * Make control center aware of a cloaked playerr when he fires.
4379  *
4380  * Revision 1.262  1995/01/17  17:48:42  rob
4381  * Added key syncing for coop players.
4382  *
4383  * Revision 1.261  1995/01/16  19:30:28  rob
4384  * Fixed an assert error in fireball.c
4385  *
4386  * Revision 1.260  1995/01/16  19:23:51  mike
4387  * Say Boss_been_hit if he been hit so he gates appropriately.
4388  *
4389  * Revision 1.259  1995/01/16  11:55:16  mike
4390  * make enemies become aware of player if he damages control center.
4391  *
4392  * Revision 1.258  1995/01/15  16:42:00  rob
4393  * Fixed problem with robot bumping damage.
4394  *
4395  * Revision 1.257  1995/01/14  19:16:36  john
4396  * First version of new bitmap paging code.
4397  *
4398  * Revision 1.256  1995/01/03  17:58:37  rob
4399  * Fixed scoring problems.
4400  *
4401  * Revision 1.255  1994/12/29  12:41:11  rob
4402  * Tweaking robot exploding in coop.
4403  *
4404  * Revision 1.254  1994/12/28  10:37:59  rob
4405  * Fixed ifdef of multibot stuff.
4406  *
4407  * Revision 1.253  1994/12/21  19:03:14  rob
4408  * Fixing score accounting for multiplayer robots
4409  *
4410  * Revision 1.252  1994/12/21  17:36:31  rob
4411  * Fix hostage pickup problem in network.
4412  * tweaking robot powerup drops.
4413  *
4414  * Revision 1.251  1994/12/19  20:32:34  rob
4415  * Remove awareness events from player collisions and lasers that are not the console player.
4416  *
4417  * Revision 1.250  1994/12/19  20:01:22  rob
4418  * Added multibot.h include.
4419  *
4420  * Revision 1.249  1994/12/19  16:36:41  rob
4421  * Patches damaging of multiplayer robots.
4422  *
4423  * Revision 1.248  1994/12/14  21:15:18  rob
4424  * play lava hiss across network.
4425  *
4426  * Revision 1.247  1994/12/14  17:09:09  matt
4427  * Fixed problem with no sound when lasers hit closed walls, like grates.
4428  *
4429  * Revision 1.246  1994/12/14  09:51:49  mike
4430  * make any weapon cause proximity bomb detonation.
4431  *
4432  * Revision 1.245  1994/12/13  12:55:25  mike
4433  * change number of proximity bomb powerups which get dropped.
4434  *
4435  * Revision 1.244  1994/12/12  17:17:53  mike
4436  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
4437  *
4438  * Revision 1.243  1994/12/12  12:07:51  rob
4439  * Don't take damage if we're in endlevel sequence.
4440  *
4441  * Revision 1.242  1994/12/11  23:44:52  mike
4442  * less phys_apply_rot() at higher skill levels.
4443  *
4444  * Revision 1.241  1994/12/11  12:37:02  mike
4445  * remove stupid robot spinning code.  it was really stupid.  (actually, call here, code in ai.c).
4446  *
4447  * Revision 1.240  1994/12/10  16:44:51  matt
4448  * Added debugging code to track down door that turns into rock
4449  *
4450  * Revision 1.239  1994/12/09  14:59:19  matt
4451  * Added system to attach a fireball to another object for rendering purposes,
4452  * so the fireball always renders on top of (after) the object.
4453  *
4454  * Revision 1.238  1994/12/09  09:57:02  mike
4455  * Don't allow robots or their weapons to pass through control center.
4456  *
4457  * Revision 1.237  1994/12/08  15:46:03  mike
4458  * better robot behavior.
4459  *
4460  * Revision 1.236  1994/12/08  12:32:56  mike
4461  * make boss dying more interesting.
4462  *
4463  * Revision 1.235  1994/12/07  22:49:15  mike
4464  * tweak rotation due to collision.
4465  *
4466  * Revision 1.234  1994/12/07  16:44:50  mike
4467  * make bump sound if supposed to, even if not taking damage.
4468  *
4469  * Revision 1.233  1994/12/07  12:55:08  mike
4470  * tweak rotvel applied from collisions.
4471  *
4472  * Revision 1.232  1994/12/05  19:30:48  matt
4473  * Fixed horrible segment over-dereferencing
4474  *
4475  * Revision 1.231  1994/12/05  00:32:15  mike
4476  * do rotvel on badass and bump collisions.
4477  *
4478  * Revision 1.230  1994/12/03  12:49:22  mike
4479  * don't play bonk sound when you collide with a volatile wall (like lava).
4480  *
4481  * Revision 1.229  1994/12/02  16:51:09  mike
4482  * make lava sound only happen at 4 Hz.
4483  *
4484  * Revision 1.228  1994/11/30  23:55:27  rob
4485  * Fixed a bug where a laser hitting a wall was making 2 sounds.
4486  *
4487  * Revision 1.227  1994/11/30  20:11:00  rob
4488  * Fixed # of dropped laser powerups.
4489  *
4490  * Revision 1.226  1994/11/30  19:19:03  rob
4491  * Transmit collission sounds for net games.
4492  *
4493  * Revision 1.225  1994/11/30  16:33:01  mike
4494  * new boss behavior.
4495  *
4496  * Revision 1.224  1994/11/30  15:44:17  mike
4497  * /2 on boss smart children damage.
4498  *
4499  * Revision 1.223  1994/11/30  14:03:03  mike
4500  * hook for claw sounds
4501  *
4502  * Revision 1.222  1994/11/29  20:41:09  matt
4503  * Deleted a bunch of commented-out lines
4504  *
4505  * Revision 1.221  1994/11/27  23:15:08  matt
4506  * Made changes for new mprintf calling convention
4507  *
4508  * Revision 1.220  1994/11/19  16:11:28  rob
4509  * Collision damage with walls or lava is counted as suicides in net games
4510  *
4511  * Revision 1.219  1994/11/19  15:20:41  mike
4512  * rip out unused code and data
4513  *
4514  * Revision 1.218  1994/11/17  18:44:27  rob
4515  * Added OBJ_GHOST to list of valid player types to create eggs.
4516  *
4517  * Revision 1.217  1994/11/17  14:57:59  mike
4518  * moved segment validation functions from editor to main.
4519  *
4520  * Revision 1.216  1994/11/16  23:38:36  mike
4521  * new improved boss teleportation behavior.
4522  *
4523  * Revision 1.215  1994/11/16  12:16:29  mike
4524  * Enable collisions between robots.  A hack in fvi.c only does this for robots which lunge to attack (eg, green guy)
4525  *
4526  * Revision 1.214  1994/11/15  16:51:50  mike
4527  * bump player when he hits a volatile wall.
4528  *
4529  * Revision 1.213  1994/11/12  16:38:44  mike
4530  * allow flares to open doors.
4531  *
4532  * Revision 1.212  1994/11/10  13:09:19  matt
4533  * Added support for new run-length-encoded bitmaps
4534  *
4535  * Revision 1.211  1994/11/09  17:05:43  matt
4536  * Fixed problem with volatile walls
4537  *
4538  * Revision 1.210  1994/11/09  12:11:46  mike
4539  * only award points if ConsoleObject killed robot.
4540  *
4541  * Revision 1.209  1994/11/09  11:11:03  yuan
4542  * Made wall volatile if either tmap_num1 or tmap_num2 is a volatile wall.
4543  *
4544  * Revision 1.208  1994/11/08  12:20:15  mike
4545  * moved do_controlcen_destroyed_stuff from here to cntrlcen.c
4546  *
4547  * Revision 1.207  1994/11/02  23:22:08  mike
4548  * Make ` (backquote, KEY_LAPOSTRO) tell what wall was hit by laser.
4549  *
4550  * Revision 1.206  1994/11/02  18:03:00  rob
4551  * Fix control_center_been_hit logic so it only cares about the local player.
4552  * Other players take care of their own control center 'ai'.
4553  *
4554  * Revision 1.205  1994/11/01  19:37:33  rob
4555  * Changed the max # of consussion missiles to 4.
4556  * (cause they're lame and clutter things up)
4557  *
4558  * Revision 1.204  1994/11/01  18:06:35  john
4559  * Tweaked wall banging sound constant.
4560  *
4561  * Revision 1.203  1994/11/01  18:01:40  john
4562  * Made wall bang less obnoxious, but volume based.
4563  *
4564  * Revision 1.202  1994/11/01  17:11:05  rob
4565  * Changed some stuff in drop_player_eggs.
4566  *
4567  * Revision 1.201  1994/11/01  12:18:23  john
4568  * Added sound volume support. Made wall collisions be louder/softer.
4569  *
4570  * Revision 1.200  1994/10/31  13:48:44  rob
4571  * Fixed bug in opening doors over network/modem.  Added a new message
4572  * type to multi.c that communicates door openings across the net.
4573  * Changed includes in multi.c and wall.c to accomplish this.
4574  *
4575  * Revision 1.199  1994/10/28  14:42:52  john
4576  * Added sound volumes to all sound calls.
4577  *
4578  * Revision 1.198  1994/10/27  16:58:37  allender
4579  * added demo recording of monitors blowing up
4580  *
4581  * Revision 1.197  1994/10/26  23:20:52  matt
4582  * Tone down flash even more
4583  *
4584  * Revision 1.196  1994/10/26  23:01:50  matt
4585  * Toned down red flash when damaged
4586  *
4587  * Revision 1.195  1994/10/26  15:56:29  yuan
4588  * Tweaked some palette flashes.
4589  *
4590  * Revision 1.194  1994/10/25  11:32:26  matt
4591  * Fixed bugs with vulcan powerups in mutliplayer
4592  *
4593  * Revision 1.193  1994/10/25  10:51:18  matt
4594  * Vulcan cannon powerups now contain ammo count
4595  *
4596  * Revision 1.192  1994/10/24  14:14:05  matt
4597  * Fixed bug in bump_two_objects()
4598  *
4599  * Revision 1.191  1994/10/23  19:17:04  matt
4600  * Fixed bug with "no key" messages
4601  *
4602  * Revision 1.190  1994/10/22  00:08:46  matt
4603  * Fixed up problems with bonus & game sequencing
4604  * Player doesn't get credit for hostages unless he gets them out alive
4605  *
4606  * Revision 1.189  1994/10/21  20:42:34  mike
4607  * Clear number of hostages on board between levels.
4608  *
4609  * Revision 1.188  1994/10/20  15:17:43  mike
4610  * control center in boss handling.
4611  *
4612  * Revision 1.187  1994/10/20  10:09:47  mike
4613  * Only ever drop 1 shield powerup in multiplayer (as an egg).
4614  *
4615  * Revision 1.186  1994/10/20  09:47:11  mike
4616  * Fix bug in dropping vulcan ammo in multiplayer.
4617  * Also control center stuff.
4618  *
4619  * Revision 1.185  1994/10/19  15:14:32  john
4620  * Took % hits out of player structure, made %kills work properly.
4621  *
4622  * Revision 1.184  1994/10/19  11:33:16  john
4623  * Fixed hostage rescued percent.
4624  *
4625  * Revision 1.183  1994/10/19  11:16:49  mike
4626  * Don't allow crazy josh to open locked doors.
4627  * Don't allow weapons to harm parent.
4628  *
4629  * Revision 1.182  1994/10/18  18:37:01  mike
4630  * No more hostage killing.  Too much stuff to do to integrate into game.
4631  *
4632  * Revision 1.181  1994/10/18  16:37:35  mike
4633  * Debug function for Yuan: Show seg:side when hit by puny laser if Show_seg_and_side != 0.
4634  *
4635  * Revision 1.180  1994/10/18  10:53:17  mike
4636  * Support attack type as a property of a robot, not of being == GREEN_GUY.
4637  *
4638  * Revision 1.179  1994/10/17  21:18:36  mike
4639  * diminish damage player does to robot due to collision, only took 2-3 hits to kill a josh.
4640  *
4641  * Revision 1.178  1994/10/17  20:30:40  john
4642  * Made player_hostages_rescued or whatever count properly.
4643  *
4644  * Revision 1.177  1994/10/16  12:42:56  mike
4645  * Trap bogus amount of vulcan ammo dropping.
4646  *
4647  * Revision 1.176  1994/10/15  19:06:51  mike
4648  * Drop vulcan ammo if player has it, but no vulcan cannon (when he dies).
4649  *
4650  * Revision 1.175  1994/10/13  15:42:06  mike
4651  * Remove afterburner.
4652  *
4653  * Revision 1.174  1994/10/13  11:12:57  mike
4654  * Apply damage to robots.  I hosed it a couple weeks ago when I made the green guy special.
4655
4656 ------------------------------------------------------------------------
4657 main/collide.h:
4658
4659  * Revision 1.1  1995/05/16  15:55:09  allender
4660  * Initial revision
4661  *
4662  * Revision 2.0  1995/02/27  11:28:59  john
4663  * New version 2.0, which has no anonymous unions, builds with
4664  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4665  *
4666  * Revision 1.23  1995/01/26  22:11:47  mike
4667  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4668  *
4669  * Revision 1.22  1994/12/21  19:03:24  rob
4670  * Fixing score accounting for multiplayer robots
4671  *
4672  * Revision 1.21  1994/12/21  11:34:56  mike
4673  * make control center take badass damage.
4674  *
4675  * Revision 1.20  1994/10/29  16:53:16  allender
4676  * added check_effect_blowup for demo recording to record monitor explosions
4677  *
4678  * Revision 1.19  1994/10/09  13:46:48  mike
4679  * Make public collide_player_and_powerup.
4680  *
4681  * Revision 1.18  1994/10/05  14:54:29  rob
4682  * Added serial game support in control center sequence..
4683  *
4684  * Revision 1.17  1994/09/15  16:32:12  mike
4685  * Prototype collide_player_and_nasty_robot.
4686  *
4687  * Revision 1.16  1994/09/11  15:49:04  mike
4688  * Prototype for maybe_detonate_weapon.
4689  *
4690  * Revision 1.15  1994/09/09  14:20:07  matt
4691  * Added prototype for scrape function
4692  *
4693  * Revision 1.14  1994/09/02  14:00:44  matt
4694  * Simplified explode_object() & mutliple-stage explosions
4695  *
4696  * Revision 1.13  1994/08/18  10:47:35  john
4697  * Cleaned up game sequencing and player death stuff
4698  * in preparation for making the player explode into
4699  * pieces when dead.
4700  *
4701  * Revision 1.12  1994/08/17  16:50:08  john
4702  * Added damaging fireballs, missiles.
4703  *
4704  * Revision 1.11  1994/08/03  16:45:31  mike
4705  * Prototype a function.
4706  *
4707  * Revision 1.10  1994/08/03  15:17:41  mike
4708  * make matcen whack on you if it's ready to make a robot.
4709  *
4710  * Revision 1.9  1994/07/22  12:08:03  mike
4711  * Make robot hit vclip and sound weapon-based until robot dies, then robot-based.
4712  *
4713  * Revision 1.8  1994/07/09  17:36:31  mike
4714  * Prototype apply_damage_to_robot.
4715  *
4716  * Revision 1.7  1994/07/09  13:20:36  mike
4717  * Prototype apply_damage_to_player.
4718  *
4719  * Revision 1.6  1994/06/20  23:35:52  john
4720  * Bunch of stuff.
4721  *
4722  * Revision 1.5  1994/06/17  18:04:03  yuan
4723  * Added Immaterialization...
4724  * Fixed Invulnerability to allow being hit.
4725  *
4726  * Revision 1.4  1994/05/13  20:28:02  john
4727  * Version II of John's new object code.
4728  *
4729  * Revision 1.3  1994/05/13  12:20:35  john
4730  * Fixed some potential problems with code using global variables
4731  * that are set in fvi.
4732  *
4733  * Revision 1.2  1994/05/12  23:20:32  john
4734  * Moved all object collision handling into collide.c.
4735  *
4736  * Revision 1.1  1994/05/12  20:39:09  john
4737  * Initial revision
4738
4739 ------------------------------------------------------------------------
4740 main/compbit.h:
4741
4742  * Revision 1.1  1995/05/16  15:55:16  allender
4743  * Initial revision
4744  *
4745  * Revision 2.0  1995/02/27  11:28:46  john
4746  * New version 2.0, which has no anonymous unions, builds with
4747  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4748  *
4749  * Revision 1.3  1994/12/05  15:10:28  allender
4750  * changed extern prototype definition
4751  *
4752  * Revision 1.2  1994/10/19  15:43:33  allender
4753  * header file which contains the xor value which is used when encrypting
4754  * bitmaps.tbl
4755  *
4756  * Revision 1.1  1994/10/19  13:22:19  allender
4757  * Initial revision
4758
4759 ------------------------------------------------------------------------
4760 main/config.c:
4761
4762  * Revision 1.8  1995/10/27  10:52:20  allender
4763  * call digi_set_master_volume when prefs are read in to
4764  * set the master volume of the mac
4765  *
4766  * Revision 1.7  1995/10/24  17:08:39  allender
4767  * Config_master_volume added for saving sound manager volume
4768  * across games
4769  *
4770  * Revision 1.6  1995/10/20  00:49:31  allender
4771  * use default values when no prefs file
4772  *
4773  * Revision 1.5  1995/09/21  10:06:58  allender
4774  * set digi and midi volume appropriately
4775  *
4776  * Revision 1.4  1995/09/13  08:49:38  allender
4777  * prefs file stuff
4778  *
4779  * Revision 1.3  1995/09/05  08:47:37  allender
4780  * prefs file working
4781  *
4782  * Revision 1.2  1995/05/26  06:54:14  allender
4783  * removed midi and digi references from config file
4784  *
4785  * Revision 1.1  1995/05/16  15:23:45  allender
4786  * Initial revision
4787  *
4788  * Revision 2.2  1995/03/27  09:42:59  john
4789  * Added VR Settings in config file.
4790  *
4791  * Revision 2.1  1995/03/16  11:20:40  john
4792  * Put in support for Crystal Lake soundcard.
4793  *
4794  * Revision 2.0  1995/02/27  11:30:13  john
4795  * New version 2.0, which has no anonymous unions, builds with
4796  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4797  *
4798  * Revision 1.14  1995/02/11  16:19:36  john
4799  * Added code to make the default mission be the one last played.
4800  *
4801  * Revision 1.13  1995/01/18  13:23:24  matt
4802  * Made curtom detail level vars initialize properly at load
4803  *
4804  * Revision 1.12  1995/01/04  22:15:36  matt
4805  * Fixed stupid bug using scanf() to read bytes
4806  *
4807  * Revision 1.11  1995/01/04  13:14:21  matt
4808  * Made custom detail level settings save in config file
4809  *
4810  * Revision 1.10  1994/12/12  21:35:09  john
4811  * *** empty log message ***
4812  *
4813  * Revision 1.9  1994/12/12  21:31:51  john
4814  * Made volume work better by making sure volumes are valid
4815  * and set correctly at program startup.
4816  *
4817  * Revision 1.8  1994/12/12  13:58:01  john
4818  * MAde -nomusic work.
4819  * Fixed GUS hang at exit by deinitializing digi before midi.
4820  *
4821  * Revision 1.7  1994/12/08  10:01:33  john
4822  * Changed the way the player callsign stuff works.
4823  *
4824  * Revision 1.6  1994/12/01  11:24:07  john
4825  * Made volume/gamma/joystick sliders all be the same length.  0-->8.
4826  *
4827  * Revision 1.5  1994/11/29  02:01:07  john
4828  * Added code to look at -volume command line arg.
4829  *
4830  * Revision 1.4  1994/11/14  20:14:11  john
4831  * Fixed some warnings.
4832  *
4833  * Revision 1.3  1994/11/14  19:51:01  john
4834  * Added joystick cal values to descent.cfg.
4835  *
4836  * Revision 1.2  1994/11/14  17:53:09  allender
4837  * read and write descent.cfg file
4838  *
4839  * Revision 1.1  1994/11/14  16:28:08  allender
4840  * Initial revision
4841
4842 ------------------------------------------------------------------------
4843 main/config.h:
4844
4845  * Revision 1.3  1995/09/08  17:12:26  allender
4846  * added modem tool stuff for prefs file
4847  *
4848  * Revision 1.2  1995/09/05  08:47:48  allender
4849  * prefs file working
4850  *
4851  * Revision 1.1  1995/05/16  15:55:23  allender
4852  * Initial revision
4853  *
4854  * Revision 2.0  1995/02/27  11:32:48  john
4855  * New version 2.0, which has no anonymous unions, builds with
4856  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4857  *
4858  * Revision 1.4  1995/02/11  16:20:06  john
4859  * Added code to make the default mission be the one last played.
4860  *
4861  * Revision 1.3  1994/12/08  10:01:41  john
4862  * Changed the way the player callsign stuff works.
4863  *
4864  * Revision 1.2  1994/11/14  17:53:17  allender
4865  * extern definitions for ReadConfigFile and WriteConfigFile
4866  *
4867  * Revision 1.1  1994/11/14  16:56:17  allender
4868  * Initial revision
4869
4870 ------------------------------------------------------------------------
4871 main/controls.c:
4872
4873  * Revision 1.3  1995/11/20  17:17:27  allender
4874  * call fix_fastsincos with tmp variable to prevent
4875  * writing to NULL
4876  *
4877  * Revision 1.2  1995/08/11  16:00:04  allender
4878  * fixed bug we think we never saw (overflow on max_rotthrust
4879  *
4880  * Revision 1.1  1995/05/16  15:23:53  allender
4881  * Initial revision
4882  *
4883  * Revision 2.0  1995/02/27  11:27:11  john
4884  * New version 2.0, which has no anonymous unions, builds with
4885  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4886  *
4887  * Revision 1.50  1995/02/22  14:11:19  allender
4888  * remove anonymous unions from object structure
4889  *
4890  * Revision 1.49  1994/12/15  13:04:10  mike
4891  * Replace Players[Player_num].time_total references with GameTime.
4892  *
4893  * Revision 1.48  1994/11/27  23:12:13  matt
4894  * Made changes for new mprintf calling convention
4895  *
4896  * Revision 1.47  1994/11/25  22:15:54  matt
4897  * Added asserts to try to trap frametime < 0 bug
4898  *
4899  * Revision 1.46  1994/11/16  11:25:40  matt
4900  * Took out int3's since I determined that the errors are caused by neg frametime
4901  *
4902  * Revision 1.45  1994/11/15  13:07:23  matt
4903  * Added int3's to try to trap bug
4904  *
4905  * Revision 1.44  1994/10/14  16:18:12  john
4906  * Made Assert that the object was player just nicely exit
4907  * the function.
4908  *
4909  * Revision 1.43  1994/10/13  11:35:25  john
4910  * Made Thrustmaster FCS Hat work.  Put a background behind the
4911  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
4912  * menu to new menu. Made F6 be calibrate joystick.
4913  *
4914  * Revision 1.42  1994/09/29  11:22:02  mike
4915  * Zero thrust when player dies.
4916  *
4917  * Revision 1.41  1994/09/16  13:10:30  mike
4918  * Hook in afterburner stuff.
4919  *
4920  * Revision 1.40  1994/09/14  22:21:54  matt
4921  * Avoid post-death assert
4922  *
4923  * Revision 1.39  1994/09/11  20:30:27  matt
4924  * Cleaned up thrust vars, changing a few names
4925  *
4926  * Revision 1.38  1994/09/10  15:46:31  john
4927  * First version of new keyboard configuration.
4928  *
4929  * Revision 1.37  1994/09/07  15:58:12  mike
4930  * Check for player dead in controls so you can't fire or move after dead, logical, huh?
4931  *
4932  * Revision 1.36  1994/09/06  14:51:56  john
4933  * Added sensitivity adjustment, fixed bug with joystick button not
4934  * staying down.
4935  *
4936  * Revision 1.35  1994/09/01  15:43:26  john
4937  * Put pitch bak like it was.
4938  *
4939  * Revision 1.34  1994/08/31  18:59:35  john
4940  * Made rotthrust back like it was.
4941  *
4942  * Revision 1.33  1994/08/31  18:49:17  john
4943  * Slowed Maxrothrust a bit,
4944  * ..
4945  *
4946  * Revision 1.32  1994/08/31  18:32:05  john
4947  * Lower max rotational thrust
4948  *
4949  * Revision 1.31  1994/08/29  21:18:27  john
4950  * First version of new keyboard/oystick remapping stuff.
4951  *
4952  * Revision 1.30  1994/08/29  16:18:30  mike
4953  * trap divide overflow.
4954  *
4955  * Revision 1.29  1994/08/26  14:40:45  john
4956  * *** empty log message ***
4957  *
4958  * Revision 1.28  1994/08/26  12:23:50  john
4959  * MAde joystick read up to 15 times per second max.
4960  *
4961  * Revision 1.27  1994/08/26  10:50:59  john
4962  * Took out Controls_always_stopped.
4963  *
4964  * Revision 1.26  1994/08/26  10:47:27  john
4965  * *** empty log message ***
4966  *
4967  * Revision 1.25  1994/08/26  10:46:50  john
4968  * New version of controls.
4969  *
4970  * Revision 1.24  1994/08/25  19:41:44  john
4971  * *** empty log message ***
4972  *
4973  * Revision 1.23  1994/08/25  18:44:55  john
4974  * *** empty log message ***
4975  *
4976  * Revision 1.22  1994/08/25  18:43:46  john
4977  * First revision of new control code.
4978  *
4979  * Revision 1.21  1994/08/24  20:02:46  john
4980  * Added cyberman support; made keys work key_down_time
4981  * returning seconds instead of milliseconds,.
4982  *
4983  *
4984  * Revision 1.20  1994/08/24  19:00:27  john
4985  * Changed key_down_time to return fixed seconds instead of
4986  * milliseconds.
4987  *
4988  * Revision 1.19  1994/08/19  15:22:12  mike
4989  * Fix divide overflow in sliding.
4990  *
4991  * Revision 1.18  1994/08/19  14:42:50  john
4992  * Added joystick sensitivity.
4993  *
4994  * Revision 1.17  1994/08/17  16:50:01  john
4995  * Added damaging fireballs, missiles.
4996  *
4997  * Revision 1.16  1994/08/12  22:41:54  john
4998  * Took away Player_stats; added Players array.
4999  *
5000  * Revision 1.15  1994/08/09  16:03:56  john
5001  * Added network players to editor.
5002  *
5003  * Revision 1.14  1994/07/28  12:33:31  matt
5004  * Made sliding use thrust, rather than changing velocity directly
5005  *
5006  * Revision 1.13  1994/07/27  20:53:21  matt
5007  * Added rotational drag & thrust, so turning now has momemtum like moving
5008  *
5009  * Revision 1.12  1994/07/25  10:24:06  john
5010  * Victor stuff.
5011  *
5012  * Revision 1.11  1994/07/22  17:53:16  john
5013  * Added better victormax support
5014  *
5015  * Revision 1.10  1994/07/21  21:31:29  john
5016  * First cheapo version of VictorMaxx tracking.
5017  *
5018  * Revision 1.9  1994/07/15  15:16:18  john
5019  * Fixed some joystick stuff.
5020  *
5021  * Revision 1.8  1994/07/15  09:32:09  john
5022  * Changes player movement.
5023  *
5024  * Revision 1.7  1994/07/13  00:14:58  matt
5025  * Moved all (or nearly all) of the values that affect player movement to
5026  * bitmaps.tbl
5027  *
5028  * Revision 1.6  1994/07/12  12:40:14  matt
5029  * Revamped physics system
5030  *
5031  * Revision 1.5  1994/07/02  13:50:39  matt
5032  * Cleaned up includes
5033  *
5034  * Revision 1.4  1994/07/01  10:55:25  john
5035  * Added analog joystick throttle
5036  *
5037  * Revision 1.3  1994/06/30  20:04:28  john
5038  * Added -joydef support.
5039  *
5040  * Revision 1.2  1994/06/30  19:01:58  matt
5041  * Moved flying controls code from physics.c to controls.c
5042  *
5043  * Revision 1.1  1994/06/30  18:41:25  matt
5044  * Initial revision
5045
5046 ------------------------------------------------------------------------
5047 main/controls.h:
5048
5049  * Revision 1.1  1995/05/16  15:55:31  allender
5050  * Initial revision
5051  *
5052  * Revision 2.0  1995/02/27  11:27:17  john
5053  * New version 2.0, which has no anonymous unions, builds with
5054  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5055  *
5056  * Revision 1.4  1994/07/21  18:15:33  matt
5057  * Ripped out a bunch of unused stuff
5058  *
5059  * Revision 1.3  1994/07/15  09:32:08  john
5060  * Changes player movement.
5061  *
5062  * Revision 1.2  1994/06/30  19:02:22  matt
5063  * Moved flying controls code from physics.c to controls.c
5064  *
5065  * Revision 1.1  1994/06/30  18:41:36  matt
5066  * Initial revision
5067
5068 ------------------------------------------------------------------------
5069 main/credits.c:
5070
5071  * Revision 1.8  1995/11/07  13:54:56  allender
5072  * loop shareware song since it is too short
5073  *
5074  * Revision 1.7  1995/10/31  10:24:25  allender
5075  * shareware stuff
5076  *
5077  * Revision 1.6  1995/10/27  15:17:57  allender
5078  * minor fix to get them to look right at top and bottom
5079  * of screens
5080  *
5081  * Revision 1.5  1995/10/21  22:50:49  allender
5082  * credits is way cool!!!!
5083  *
5084  * Revision 1.3  1995/08/08  13:45:26  allender
5085  * added macsys header file
5086  *
5087  * Revision 1.2  1995/07/17  08:49:48  allender
5088  * make work in 640x480 -- still needs major work!!
5089  *
5090  * Revision 1.1  1995/05/16  15:24:01  allender
5091  * Initial revision
5092  *
5093  * Revision 2.2  1995/06/14  17:26:08  john
5094  * Fixed bug with VFX palette not getting loaded for credits, titles.
5095  *
5096  * Revision 2.1  1995/03/06  15:23:30  john
5097  * New screen techniques.
5098  *
5099  * Revision 2.0  1995/02/27  11:29:25  john
5100  * New version 2.0, which has no anonymous unions, builds with
5101  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5102  *
5103  * Revision 1.33  1995/02/11  12:41:56  john
5104  * Added new song method, with FM bank switching..
5105  *
5106  * Revision 1.32  1995/02/03  14:18:06  john
5107  * Added columns.
5108  *
5109  * Revision 1.31  1994/12/28  10:43:00  john
5110  * More VFX tweaking.
5111  *
5112  * Revision 1.30  1994/12/20  18:22:31  john
5113  * Added code to support non-looping songs, and put
5114  * it in for endlevel and credits.
5115  *
5116  * Revision 1.29  1994/12/15  14:23:00  adam
5117  * fixed timing.
5118  *
5119  * Revision 1.28  1994/12/14  16:56:33  adam
5120  * *** empty log message ***
5121  *
5122  * Revision 1.27  1994/12/14  12:18:11  adam
5123  * messed w/timing
5124  *
5125  * Revision 1.26  1994/12/12  22:52:59  matt
5126  * Fixed little bug
5127  *
5128  * Revision 1.25  1994/12/12  22:49:35  adam
5129  * *** empty log message ***
5130  *
5131  * Revision 1.24  1994/12/09  23:16:50  john
5132  * Make credits.txb load.
5133  *
5134  * Revision 1.23  1994/12/09  00:41:54  mike
5135  * fix hang in automap print screen.
5136  *
5137  * Revision 1.22  1994/12/09  00:34:22  matt
5138  * Added support for half-height lines
5139  *
5140  * Revision 1.21  1994/12/08  18:36:03  yuan
5141  * More HOGfile support.
5142  *
5143  * Revision 1.20  1994/12/04  14:48:17  john
5144  * Made credits restore playing descent.hmp.
5145  *
5146  * Revision 1.19  1994/12/04  14:30:20  john
5147  * Added hooks for music..
5148  *
5149  * Revision 1.18  1994/12/04  12:06:46  matt
5150  * Put in support for large font
5151  *
5152  * Revision 1.17  1994/12/01  10:47:27  john
5153  * Took out code that allows keypresses to change scroll rate.
5154  *
5155  * Revision 1.16  1994/11/30  12:10:52  adam
5156  * added support for PCX titles/brief screens
5157  *
5158  * Revision 1.15  1994/11/27  23:12:17  matt
5159  * Made changes for new mprintf calling convention
5160  *
5161  * Revision 1.14  1994/11/27  19:51:46  matt
5162  * Made screen shots work in a few more places
5163  *
5164  * Revision 1.13  1994/11/18  16:41:51  adam
5165  * trimmed some more meat for shareware
5166  *
5167  * Revision 1.12  1994/11/10  20:38:29  john
5168  * Made credits not loop.
5169  *
5170  * Revision 1.11  1994/11/05  15:04:06  john
5171  * Added non-popup menu for the main menu, so that scores and credits don't have to save
5172  * the background.
5173  *
5174  * Revision 1.10  1994/11/05  14:05:52  john
5175  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
5176  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
5177  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
5178  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
5179  *
5180  * Revision 1.9  1994/11/04  12:02:32  john
5181  * Fixed fading transitions a bit more.
5182  *
5183  * Revision 1.8  1994/11/04  11:30:44  john
5184  * Fixed fade transitions between game/menu/credits.
5185  *
5186  * Revision 1.7  1994/11/04  11:06:32  john
5187  * Added code to support credit fade table.
5188  *
5189  * Revision 1.6  1994/11/04  10:16:13  john
5190  * Made the credits fade in/out smoothly on top of a bitmap background.
5191  *
5192  * Revision 1.5  1994/11/03  21:24:12  john
5193  * Made credits exit the instant a key is pressed.
5194  * Made it scroll a bit slower.
5195  *
5196  * Revision 1.4  1994/11/03  21:20:28  john
5197  * Working.
5198  *
5199  * Revision 1.3  1994/11/03  21:01:24  john
5200  * First version of credits that works.
5201  *
5202  * Revision 1.2  1994/11/03  20:17:39  john
5203  * Added initial code for showing credits.
5204  *
5205  * Revision 1.1  1994/11/03  20:09:05  john
5206  * Initial revision
5207
5208 ------------------------------------------------------------------------
5209 main/credits.h:
5210
5211  * Revision 1.1  1995/05/16  15:55:39  allender
5212  * Initial revision
5213  *
5214  * Revision 2.0  1995/02/27  11:32:30  john
5215  * New version 2.0, which has no anonymous unions, builds with
5216  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5217  *
5218  * Revision 1.2  1994/11/03  20:17:40  john
5219  * Added initial code for showing credits.
5220  *
5221  * Revision 1.1  1994/11/03  20:09:19  john
5222  * Initial revision
5223
5224 ------------------------------------------------------------------------
5225 main/desc_id.h:
5226
5227  * Revision 1.1  1995/05/16  15:55:53  allender
5228  * Initial revision
5229  *
5230  * Revision 2.0  1995/02/27  11:29:38  john
5231  * New version 2.0, which has no anonymous unions, builds with
5232  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5233  *
5234  * Revision 1.3  1994/10/19  09:52:57  allender
5235  * Added variable for bogus error number return when game exits
5236  *
5237  * Revision 1.2  1994/10/18  16:43:52  allender
5238  * Added constants for id and time stamping
5239  *
5240  * Revision 1.1  1994/10/17  09:56:47  allender
5241  * Initial revision
5242  * Header for checksum stuff - No idea what for.
5243
5244 ------------------------------------------------------------------------
5245 main/digi.h:
5246
5247  * Revision 2.0  1995/02/27  11:28:40  john
5248  * New version 2.0, which has no anonymous unions, builds with
5249  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5250  *
5251  * Revision 1.29  1995/02/11  12:42:00  john
5252  * Added new song method, with FM bank switching..
5253  *
5254  * Revision 1.28  1995/02/03  17:08:26  john
5255  * Changed sound stuff to allow low memory usage.
5256  * Also, changed so that Sounds isn't an array of digi_sounds, it
5257  * is a ubyte pointing into GameSounds, this way the digi.c code that
5258  * locks sounds won't accidentally unlock a sound that is already playing, but
5259  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
5260  *
5261  * Revision 1.27  1995/02/01  22:20:31  john
5262  * Added digi_is_sound_playing.
5263  *
5264  * Revision 1.26  1994/12/20  18:03:51  john
5265  * Added loop midi flag.
5266  *
5267  * Revision 1.25  1994/12/13  00:46:14  john
5268  * Split digi and midi volume into 2 seperate functions.
5269  *
5270  * Revision 1.24  1994/12/10  20:34:53  john
5271  * Added digi_kill_sound_linked_to_object.
5272  *
5273  * Revision 1.23  1994/12/10  15:59:39  mike
5274  * Fixed bug.
5275  *
5276  * Revision 1.22  1994/12/10  15:44:35  john
5277  * Added max_distance passing for sound objects.
5278  *
5279  * Revision 1.21  1994/12/05  12:17:40  john
5280  * Added code that locks/unlocks digital sounds on demand.
5281  *
5282  * Revision 1.20  1994/11/28  18:34:57  john
5283  * Made the digi_max_channels cut of an old sound instead of
5284  * not playing a new sound.
5285  *
5286  * Revision 1.19  1994/11/14  17:53:56  allender
5287  * made some digi variables extern
5288  *
5289  * Revision 1.18  1994/10/28  14:42:58  john
5290  * Added sound volumes to all sound calls.
5291  *
5292  * Revision 1.17  1994/10/11  15:25:37  john
5293  * Added new function to play a sound once...
5294  *
5295  * Revision 1.16  1994/10/03  20:51:44  john
5296  * Started added pause sound function; for the network I changed to
5297  * packet structure a bit; never tested, though.
5298  *
5299  *
5300  * Revision 1.15  1994/10/03  13:09:43  john
5301  * Added Pause function, but never tested it yet.
5302  *
5303  * Revision 1.14  1994/09/30  10:09:24  john
5304  * Changed sound stuff... made it so the reseting card doesn't hang,
5305  * made volume change only if sound is installed.
5306  *
5307  * Revision 1.13  1994/09/29  21:13:43  john
5308  * Added Master volumes for digi and midi. Also took out panning,
5309  * because it doesn't work with MasterVolume stuff.
5310  *
5311  * Revision 1.12  1994/09/29  12:42:34  john
5312  * Added sidenum to keep track of sound pos. Made sound functions
5313  * not do anything if nosound. Made sounds_init delete currently
5314  * playing sounds.
5315  *
5316  * Revision 1.11  1994/09/29  12:23:42  john
5317  * Added digi_kill_sound_linked_to_segment function.
5318  *
5319  * Revision 1.10  1994/09/29  11:59:04  john
5320  * Added digi_kill_sound
5321  *
5322  * Revision 1.9  1994/09/29  10:37:38  john
5323  * Added sound objects that dynamicaly change volume,pan.
5324  *
5325  * Revision 1.8  1994/09/28  16:18:37  john
5326  * Added capability to play midi song.
5327  *
5328  * Revision 1.7  1994/06/17  18:01:41  john
5329  * A bunch of new stuff by John
5330  *
5331  * Revision 1.6  1994/06/15  19:00:58  john
5332  * Added the capability to make 3d sounds play just once for the
5333  * laser hit wall effects.
5334  *
5335  * Revision 1.5  1994/06/07  10:54:30  john
5336  * Made key S reinit the sound system.
5337  *
5338  * Revision 1.4  1994/05/09  21:11:39  john
5339  * Sound changes; pass index instead of pointer to digi routines.
5340  * Made laser sound cut off the last laser sound.
5341  *
5342  * Revision 1.3  1994/04/27  11:44:25  john
5343  * First version of sound! Yay!
5344  *
5345  * Revision 1.2  1994/04/20  21:58:50  john
5346  * First version of sound stuff... hopefully everything
5347  * is commented out because it hangs..
5348  *
5349  * Revision 1.1  1994/04/15  14:25:02  john
5350  * Initial revision
5351
5352 ------------------------------------------------------------------------
5353 main/dumpmine.c:
5354
5355  * Revision 1.1  1995/05/16  15:24:16  allender
5356  * Initial revision
5357  *
5358  * Revision 2.1  1995/04/06  12:21:50  mike
5359  * Add texture map information to txm files.
5360  *
5361  * Revision 2.0  1995/02/27  11:26:41  john
5362  * New version 2.0, which has no anonymous unions, builds with
5363  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5364  *
5365  * Revision 1.24  1995/01/23  15:34:43  mike
5366  * New diagnostic code, levels.all stuff.
5367  *
5368  * Revision 1.23  1994/12/20  17:56:36  yuan
5369  * Multiplayer object capability.
5370  *
5371  * Revision 1.22  1994/11/27  23:12:19  matt
5372  * Made changes for new mprintf calling convention
5373  *
5374  * Revision 1.21  1994/11/23  12:19:04  mike
5375  * move out level names, stick in gamesave.
5376  *
5377  * Revision 1.20  1994/11/21  16:54:36  mike
5378  * oops.
5379  *
5380  *
5381  * Revision 1.19  1994/11/20  22:12:55  mike
5382  * Lotsa new stuff in this fine debug file.
5383  *
5384  * Revision 1.18  1994/11/17  14:58:09  mike
5385  * moved segment validation functions from editor to main.
5386  *
5387  * Revision 1.17  1994/11/15  21:43:02  mike
5388  * texture usage system.
5389  *
5390  * Revision 1.16  1994/11/15  12:45:59  mike
5391  * debug code for dumping texture info.
5392  *
5393  * Revision 1.15  1994/11/14  20:47:50  john
5394  * Attempted to strip out all the code in the game
5395  * directory that uses any ui code.
5396  *
5397  * Revision 1.14  1994/10/14  17:33:38  mike
5398  * Fix error reporting for number of multiplayer objects in mine.
5399  *
5400  * Revision 1.13  1994/10/14  13:37:46  mike
5401  * Forgot parameter in fprintf, was getting bogus number of excess keys.
5402  *
5403  * Revision 1.12  1994/10/12  08:05:33  mike
5404  * Detect keys contained in objects for error checking (txm file).
5405  *
5406  * Revision 1.11  1994/10/10  17:02:08  mike
5407  * fix fix.
5408  *
5409  * Revision 1.10  1994/10/10  17:00:37  mike
5410  * Add checking for proper number of players.
5411  *
5412  * Revision 1.9  1994/10/03  23:37:19  mike
5413  * Adapt to clear and rational understanding of matcens as related to fuelcens as related to something that might work.
5414  *
5415  * Revision 1.8  1994/09/30  17:15:29  mike
5416  * Fix error message, was telling bogus filename.
5417  *
5418  * Revision 1.7  1994/09/30  11:50:55  mike
5419  * More diagnostics.
5420  *
5421  * Revision 1.6  1994/09/28  17:31:19  mike
5422  * More error checking.
5423  *
5424  * Revision 1.5  1994/09/28  11:14:05  mike
5425  * Better checking on bogus walls.
5426  *
5427  * Revision 1.4  1994/09/28  09:23:50  mike
5428  * Change some Error messages to Warnings.
5429  *
5430  * Revision 1.3  1994/09/27  17:08:31  mike
5431  * More mine validation stuff.
5432  *
5433  * Revision 1.2  1994/09/27  15:43:22  mike
5434  * The amazing code to tell you everything and more about our mines!
5435  *
5436  * Revision 1.1  1994/09/27  10:51:15  mike
5437  * Initial revision
5438
5439 ------------------------------------------------------------------------
5440 main/editor/autosave.c:
5441
5442  * Revision 2.0  1995/02/27  11:34:53  john
5443  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5444  * for bitmaps.tbl.
5445  * 
5446  * Revision 1.25  1994/11/19  00:04:40  john
5447  * Changed some shorts to ints.
5448  * 
5449  * Revision 1.24  1994/11/17  11:38:59  matt
5450  * Ripped out code to load old mines
5451  * 
5452  * Revision 1.23  1994/07/28  17:00:01  mike
5453  * fix diagnostic_message erasing.
5454  * 
5455  * Revision 1.22  1994/07/21  12:48:28  mike
5456  * Make time of day a global, fix clock so it doesn't show 10:2 instead of 10:02
5457  * 
5458  * Revision 1.21  1994/05/14  17:17:58  matt
5459  * Got rid of externs in source (non-header) files
5460  * 
5461  * Revision 1.20  1994/05/02  18:04:14  yuan
5462  * Fixed warning.
5463  * 
5464  * Revision 1.19  1994/05/02  17:59:04  yuan
5465  * Changed undo_status into an array rather than malloced pointers.
5466  * 
5467  * Revision 1.18  1994/03/16  09:55:48  mike
5468  * Flashing : in time.
5469  * 
5470  * Revision 1.17  1994/02/11  10:27:36  matt
5471  * Changed 'if !DEMO' to 'ifndef DEMO'
5472  * 
5473  * Revision 1.16  1994/02/08  12:43:18  yuan
5474  * Crippled save game function from demo version
5475  * 
5476  * Revision 1.15  1994/02/01  13:27:26  yuan
5477  * autosave default off.
5478  * 
5479  * Revision 1.14  1994/01/05  09:57:37  yuan
5480  * Fixed calendar/clock problem.
5481  * 
5482  * Revision 1.13  1993/12/17  16:09:59  yuan
5483  * Changed clock font from Red to Black.
5484  * 
5485  * Revision 1.12  1993/12/15  13:08:38  yuan
5486  * Fixed :0x times, so that the 0 shows up.
5487  * 
5488  * Revision 1.11  1993/12/15  11:19:52  yuan
5489  * Added code to display clock in upper right.
5490  * 
5491  * Revision 1.10  1993/12/14  21:18:51  yuan
5492  * Added diagnostic message to display
5493  * 
5494  * Revision 1.9  1993/12/14  18:32:59  yuan
5495  * Added timed autosave code
5496  * 
5497  * Revision 1.8  1993/12/13  17:23:25  yuan
5498  * Fixed bugs with undo.
5499  * They were caused by badly changed extensions.
5500  * 
5501  * Revision 1.7  1993/12/09  16:42:32  yuan
5502  * Changed extension of temp mines from .mi? -> .mn? 
5503  * and now to .m? (So it doesn't interfere with .mnu)
5504  * 
5505  * Revision 1.6  1993/12/09  16:27:06  yuan
5506  * Added toggle for autosave
5507  * 
5508  * Revision 1.5  1993/11/29  19:46:32  matt
5509  * Changed includes
5510  * 
5511  * Revision 1.4  1993/11/11  15:54:11  yuan
5512  * Added display message for Undo...
5513  * Eg. Attach Segment UNDONE.
5514  * 
5515  * Revision 1.3  1993/11/09  18:53:11  yuan
5516  * Autosave/Undo works up to 10 moves.
5517  * 
5518  * Revision 1.2  1993/11/08  19:14:03  yuan
5519  * Added Undo command (not working yet)
5520  * 
5521  * Revision 1.1  1993/11/08  16:57:59  yuan
5522  * Initial revision
5523
5524 ------------------------------------------------------------------------
5525 main/editor/centers.c:
5526
5527  * Revision 2.0  1995/02/27  11:35:30  john
5528  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5529  * for bitmaps.tbl.
5530  * 
5531  * Revision 1.9  1994/11/27  23:17:28  matt
5532  * Made changes for new mprintf calling convention
5533  * 
5534  * Revision 1.8  1994/10/05  22:13:46  mike
5535  * Clean up Centers dialog.
5536  * 
5537  * Revision 1.7  1994/10/03  23:39:55  mike
5538  * Call fuelcen_activate instead of fuelcen_create.
5539  * 
5540  * Revision 1.6  1994/08/02  12:16:35  mike
5541  * Change materialization center functionality.
5542  * 
5543  * Revision 1.5  1994/08/01  11:04:42  yuan
5544  * New materialization centers.
5545  * 
5546  * Revision 1.4  1994/07/22  17:19:10  yuan
5547  * Working on dialog box for refuel/repair/material/control centers.
5548  * 
5549  * Revision 1.3  1994/07/21  19:35:09  yuan
5550  * Fixed #include problem
5551  * 
5552  * Revision 1.2  1994/07/21  19:02:41  yuan
5553  * *** empty log message ***
5554  * 
5555  * Revision 1.1  1994/07/18  16:00:54  yuan
5556  * Initial revision
5557
5558 ------------------------------------------------------------------------
5559 main/editor/centers.h:
5560
5561  * Revision 2.0  1995/02/27  11:35:02  john
5562  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5563  * for bitmaps.tbl.
5564  * 
5565  * Revision 1.3  1994/08/02  12:16:27  mike
5566  * Prototype Center_names.
5567  * 
5568  * Revision 1.2  1994/07/21  19:35:20  yuan
5569  * Fixed #include problem
5570  * 
5571  * Revision 1.1  1994/07/21  19:11:36  yuan
5572  * Initial revision
5573
5574 ------------------------------------------------------------------------
5575 main/editor/eglobal.c:
5576
5577  * Revision 2.0  1995/02/27  11:35:52  john
5578  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5579  * for bitmaps.tbl.
5580  * 
5581  * Revision 1.35  1994/05/23  14:48:15  mike
5582  * make current segment be add segment.
5583  * 
5584  * Revision 1.34  1994/05/19  12:10:30  matt
5585  * Use new vecmat macros and globals
5586  * 
5587  * Revision 1.33  1994/05/04  19:16:27  mike
5588  * Add Degenerate_segment_found.
5589  * 
5590  * Revision 1.32  1994/05/03  11:02:57  mike
5591  * Add SegSizeMode.
5592  * 
5593  * Revision 1.31  1994/02/16  13:49:12  mike
5594  * enable editor to compile out.
5595  * 
5596  * Revision 1.30  1994/02/10  15:36:35  matt
5597  * Various changes to make editor compile out.
5598  * 
5599  * Revision 1.29  1993/12/16  14:00:33  mike
5600  * Add Curvert and Curedge.
5601  * 
5602  * Revision 1.28  1993/12/10  14:48:28  mike
5603  * Kill orthogonal views.
5604  * 
5605  * Revision 1.27  1993/12/08  10:58:49  mike
5606  * Add Cur_object_index.
5607  * 
5608  * Revision 1.26  1993/12/06  18:45:45  matt
5609  * Changed object loading & handling
5610  * 
5611  * Revision 1.25  1993/12/02  17:51:49  john
5612  * Changed my variable to match Mike's.
5613  * 
5614  * Revision 1.24  1993/12/02  17:36:13  john
5615  * Added cur_obj_type
5616  * 
5617  * Revision 1.23  1993/11/24  14:41:16  mike
5618  * Add variable Num_tilings.
5619  * 
5620  * Revision 1.22  1993/11/12  16:40:55  mike
5621  * Add Identity_matrix, which is an identity matrix.
5622  * 
5623  * Revision 1.21  1993/11/02  13:08:17  mike
5624  * Add N_warning_segs and Warning_segs
5625  * 
5626  * Revision 1.20  1993/11/02  10:31:53  mike
5627  * Document some variables,
5628  * Add Been_visited, removing it from editor.c
5629  * Add Selected_segs[] and N_selected_segs.
5630  * 
5631  * Revision 1.19  1993/10/31  18:07:48  mike
5632  * Add variable Lock_view_to_cursegp.
5633  * 
5634  * Revision 1.18  1993/10/19  20:54:51  matt
5635  * Changed/cleaned up window updates
5636  * 
5637  * Revision 1.17  1993/10/18  18:35:43  mike
5638  * Move Highest_vertex_index and Highest_segment_index here because they need
5639  * to be globals.
5640  * 
5641  * Revision 1.16  1993/10/15  13:10:00  mike
5642  * Move globals from editor.c to eglobal.c
5643  * 
5644  * Revision 1.15  1993/10/14  18:08:55  mike
5645  * Change use of CONNECTIVITY to MAX_SIDES_PER_SEGMENT
5646  * 
5647  * Revision 1.14  1993/10/13  11:11:38  matt
5648  * Made coordinate axes off by default
5649  * 
5650  * Revision 1.13  1993/10/12  09:59:27  mike
5651  * Remove definition of Side_to_verts, which belongs in the game, not in the editor.
5652  * 
5653  * Revision 1.12  1993/10/09  15:48:07  mike
5654  * Change type of Vertex_active and Side_to_verts from char to byte
5655  * Move N_found_segs and Found_segs here from render.c
5656  * Add Show_axes_flag.
5657  * 
5658  * Revision 1.11  1993/10/06  11:29:58  mike
5659  * Add prototype for Side_opposite
5660  * 
5661  * Revision 1.10  1993/10/05  17:00:17  mike
5662  * Add Vertex_active.
5663  * 
5664  * Revision 1.9  1993/10/04  17:18:16  mike
5665  * Add variables Markedsegp, Markedside
5666  * 
5667  * Revision 1.8  1993/10/02  18:18:02  mike
5668  * Added Draw_all_segments.  If !0, then all segments are drawn in draw_world.  If not set, then only those segments which
5669  * are connected to the first segment are drawn.
5670  * 
5671  * Revision 1.7  1993/10/01  10:03:15  mike
5672  * Fix ordering of vertices on front face: Used to be 0,1,2,3 made it 3,2,1,0
5673  * 
5674  * Revision 1.6  1993/09/27  16:04:28  mike
5675  * Add Side_to_verts to replace _verts, which was local to segment.c
5676  * 
5677  * Revision 1.5  1993/09/27  15:20:52  mike
5678  * Add Curside, which is current side, so we can make a certain side active.
5679  * 
5680  * Revision 1.4  1993/09/23  15:01:13  mike
5681  * Remove game specific variables, put in mglobal.c
5682  * 
5683  * Revision 1.3  1993/09/22  10:52:17  mike
5684  * Add global New_segment
5685  * 
5686  * Revision 1.2  1993/09/22  09:41:21  mike
5687  * Change constand and variable names to conform to coding standards.
5688  * 
5689  * Revision 1.1  1993/09/20  17:06:09  mike
5690  * Initial revision
5691
5692 ------------------------------------------------------------------------
5693 main/editor/ehostage.c:
5694
5695  * Revision 2.0  1995/02/27  11:35:45  john
5696  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5697  * for bitmaps.tbl.
5698  * 
5699  * Revision 1.17  1995/01/14  19:18:05  john
5700  * First version of object paging.
5701  * 
5702  * Revision 1.16  1994/11/20  14:11:41  matt
5703  * Show object number in hostage window
5704  * 
5705  * Revision 1.15  1994/11/19  19:55:46  matt
5706  * Added code to full support different hostage head clip & message for
5707  * each hostage.
5708  * 
5709  * 
5710  * Revision 1.14  1994/10/28  15:03:27  john
5711  * Made digi_play_sample use volume.
5712  * 
5713  * 
5714  * Revision 1.13  1994/10/23  02:11:39  matt
5715  * Got rid of obsolete hostage_info stuff
5716  * 
5717  * Revision 1.12  1994/10/04  13:15:44  john
5718  * Changed PLAY_SOUND to digi_play_sample.
5719  * 
5720  * Revision 1.11  1994/08/02  14:17:28  mike
5721  * Clean up dialog boxes.
5722  * 
5723  * Revision 1.10  1994/07/22  17:19:17  yuan
5724  * Working on dialog box for refuel/repair/material/control centers.
5725  * 
5726  * Revision 1.9  1994/07/06  15:22:34  john
5727  * Added new sound.
5728  * 
5729  * 
5730  * Revision 1.8  1994/07/06  14:26:07  john
5731  * Added vclip.
5732  * 
5733  * Revision 1.7  1994/07/06  13:25:52  john
5734  * Added compress hostages functions.
5735  * 
5736  * Revision 1.6  1994/07/06  12:52:27  john
5737  * Fixed warnings.
5738  * 
5739  * Revision 1.5  1994/07/06  12:43:04  john
5740  * Made generic messages for hostages.
5741  * 
5742  * Revision 1.4  1994/07/06  11:49:01  john
5743  * Made adding hostage update current object.
5744  * 
5745  * Revision 1.3  1994/07/06  10:56:00  john
5746  * New structures for hostages.
5747  * 
5748  * Revision 1.2  1994/07/01  17:57:13  john
5749  * First version of not-working hostage system
5750  * 
5751  * 
5752  * Revision 1.1  1994/07/01  14:21:44  john
5753  * Initial revision
5754
5755 ------------------------------------------------------------------------
5756 main/editor/ehostage.h:
5757
5758  * Revision 2.0  1995/02/27  11:35:13  john
5759  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5760  * for bitmaps.tbl.
5761  * 
5762  * Revision 1.2  1994/07/01  17:57:14  john
5763  * First version of not-working hostage system
5764  * 
5765  * 
5766  * Revision 1.1  1994/07/01  14:24:41  john
5767  * Initial revision
5768
5769 ------------------------------------------------------------------------
5770 main/editor/elight.c:
5771
5772  * Revision 2.0  1995/02/27  11:35:16  john
5773  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5774  * for bitmaps.tbl.
5775  * 
5776  * Revision 1.21  1994/06/14  16:59:23  mike
5777  * Fix references to tmap_num2, must strip off orientation bits.
5778  * 
5779  * Revision 1.20  1994/05/31  12:31:57  mike
5780  * fix bug in lighting -- WALL_IS_DOORWAY return value getting ignored,
5781  * almost never recursively propagated light.
5782  * 
5783  * Revision 1.19  1994/05/19  23:35:12  mike
5784  * Support uv coordinates in range 0..1.0.
5785  * 
5786  * Revision 1.18  1994/05/16  12:05:29  john
5787  * Made texturemap light be a fix from 0 to 1.
5788  * 
5789  * Revision 1.17  1994/05/14  18:00:38  matt
5790  * Got rid of externs in source (non-header) files
5791  * 
5792  * Revision 1.16  1994/05/03  11:04:27  mike
5793  * Add function to select edge.
5794  * 
5795  * Revision 1.15  1994/04/20  17:29:11  yuan
5796  * Fixed bug where tmaps above 256 don't light properly.
5797  * (duh!)
5798  * 
5799  * Revision 1.14  1994/03/22  14:20:46  yuan
5800  * Made texture map 1 also cast light.  (Cumulative with tmap_num2)
5801  * 
5802  * Revision 1.13  1994/03/15  16:34:14  yuan
5803  * Fixed bm loader (might have some changes in walls and switches)
5804  * 
5805  * Revision 1.12  1994/02/22  18:55:10  yuan
5806  * Ambient lighting "shines" on doors too!
5807  * 
5808  * Revision 1.11  1994/02/17  12:05:55  matt
5809  * Got rid of warnings
5810  * 
5811  * Revision 1.10  1994/02/16  22:28:03  mike
5812  * fix ambient lighting and smoothing.
5813  * 
5814  * Revision 1.9  1994/02/14  12:05:42  mike
5815  * change segment data structure.
5816  * 
5817  * Revision 1.8  1994/01/26  17:27:45  yuan
5818  * Still not perfected ambient lighting
5819  * 
5820  * Revision 1.7  1994/01/25  17:58:08  yuan
5821  * Added ambient lighting, and also added fixing bogus segments
5822  * functions to the editor... (they don't work fully... need to
5823  * check out seguvs.c
5824  * 
5825  * Revision 1.6  1994/01/24  11:46:10  yuan
5826  * *** empty log message ***
5827  * 
5828  * Revision 1.5  1994/01/24  11:03:05  yuan
5829  * Set lgiht maximum added... Changes are still in progress
5830  * 
5831  * Revision 1.4  1994/01/18  19:16:07  yuan
5832  * Added assign default to lighting pad.
5833  * 
5834  * Revision 1.3  1993/12/17  12:26:00  mike
5835  * Add functions for setting light values on whole segment at once.
5836  * 
5837  * Revision 1.2  1993/12/16  16:56:12  mike
5838  * Add new texture map lighting control functions.
5839  * 
5840  * Revision 1.1  1993/12/16  13:21:50  mike
5841  * Initial revision
5842
5843 ------------------------------------------------------------------------
5844 main/editor/eobject.c:
5845
5846  * Revision 2.0  1995/02/27  11:35:14  john
5847  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5848  * for bitmaps.tbl.
5849  * 
5850  * Revision 1.93  1995/02/22  15:09:04  allender
5851  * remove anonymous unions from object structure
5852  * 
5853  * Revision 1.92  1995/01/12  12:10:32  yuan
5854  * Added coop object capability.
5855  * 
5856  * Revision 1.91  1994/12/20  17:57:02  yuan
5857  * Multiplayer object stuff.
5858  * 
5859  * Revision 1.90  1994/11/27  23:17:49  matt
5860  * Made changes for new mprintf calling convention
5861  * 
5862  * Revision 1.89  1994/11/17  14:48:06  mike
5863  * validation functions moved from editor to game.
5864  * 
5865  * Revision 1.88  1994/11/14  11:40:03  mike
5866  * fix default robot behavior.
5867  * 
5868  * Revision 1.87  1994/10/25  10:51:31  matt
5869  * Vulcan cannon powerups now contain ammo count
5870  * 
5871  * Revision 1.86  1994/10/23  02:11:40  matt
5872  * Got rid of obsolete hostage_info stuff
5873  * 
5874  * Revision 1.85  1994/10/17  21:35:32  matt
5875  * Added support for new Control Center/Main Reactor
5876  * 
5877  * Revision 1.84  1994/10/10  17:23:13  mike
5878  * Verify that not placing too many player objects.
5879  * 
5880  * Revision 1.83  1994/09/24  14:15:35  mike
5881  * Custom colored object support.
5882  * 
5883  * Revision 1.82  1994/09/15  22:58:12  matt
5884  * Made new objects be oriented to their segment
5885  * Added keypad function to flip an object upside-down
5886  * 
5887  * Revision 1.81  1994/09/01  10:58:41  matt
5888  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
5889  * correctly if width & height of bitmap are different.
5890  * 
5891  * Revision 1.80  1994/08/25  21:58:14  mike
5892  * Write ObjectSelectPrevInMine and something else, I think...
5893  * 
5894  * Revision 1.79  1994/08/16  20:19:54  mike
5895  * Make STILL default (from CHASE_OBJECT).
5896  * 
5897  * Revision 1.78  1994/08/14  23:15:45  matt
5898  * Added animating bitmap hostages, and cleaned up vclips a bit
5899  * 
5900  * Revision 1.77  1994/08/13  14:58:43  matt
5901  * Finished adding support for miscellaneous objects
5902  * 
5903  * Revision 1.76  1994/08/12  22:24:58  matt
5904  * Generalized polygon objects (such as control center)
5905  * 
5906  * Revision 1.75  1994/08/09  16:06:11  john
5907  * Added the ability to place players.  Made old
5908  * Player variable be ConsoleObject.
5909  * 
5910  * Revision 1.74  1994/08/05  18:18:55  matt
5911  * Made object rotation have 4x resolution, and SHIFT+rotate do old resolution.
5912  * 
5913  * Revision 1.73  1994/08/01  13:30:56  matt
5914  * Made fvi() check holes in transparent walls, and changed fvi() calling
5915  * parms to take all input data in query structure.
5916
5917 ------------------------------------------------------------------------
5918 main/editor/eobject.h:
5919
5920  * Revision 2.0  1995/02/27  11:35:30  john
5921  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5922  * for bitmaps.tbl.
5923  * 
5924  * Revision 1.5  1994/09/15  22:57:46  matt
5925  * Made new objects be oriented to their segment
5926  * Added keypad function to flip an object upside-down
5927  * 
5928  * Revision 1.4  1994/08/25  21:57:23  mike
5929  * Prototype ObjectSelectPrevInMine, and probably wrote it too, though not in this file.
5930  * 
5931  * Revision 1.3  1994/08/05  18:17:48  matt
5932  * Made object rotation have 4x resolution, and SHIFT+rotate do old resolution.
5933  * 
5934  * Revision 1.2  1994/05/14  18:00:59  matt
5935  * Got rid of externs in source (non-header) files
5936  * 
5937  * Revision 1.1  1994/05/14  17:36:30  matt
5938  * Initial revision
5939
5940 ------------------------------------------------------------------------
5941 main/editor/eswitch.c:
5942
5943  * Revision 2.0  1995/02/27  11:35:18  john
5944  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5945  * for bitmaps.tbl.
5946  * 
5947  * Revision 1.33  1995/01/14  19:18:04  john
5948  * First version of object paging.
5949  * 
5950  * Revision 1.32  1994/11/27  23:18:01  matt
5951  * Made changes for new mprintf calling convention
5952  * 
5953  * Revision 1.31  1994/11/07  10:55:42  yuan
5954  * *** empty log message ***
5955  * 
5956  * Revision 1.30  1994/10/13  13:15:06  yuan
5957  * Fixed trigger removal bug.
5958  * 
5959  * Revision 1.29  1994/10/06  21:24:16  matt
5960  * Added switch for exit to secret level
5961  * 
5962  * Revision 1.28  1994/09/29  17:06:10  matt
5963  * Took out references to obsolete external triggers
5964  * 
5965  * Revision 1.27  1994/09/28  13:40:34  yuan
5966  * Fixed control center trigger bug.
5967  * 
5968  * Revision 1.26  1994/09/26  16:25:04  yuan
5969  * Only allow one binding of each matcen .
5970  * 
5971  * Revision 1.25  1994/09/24  17:10:19  yuan
5972  * Added Matcen triggers.
5973  * 
5974  * Revision 1.24  1994/09/20  18:23:58  yuan
5975  * Killed the BOGIFYING WALL DRAGON...
5976  * 
5977  * There was a problem with triggers being created that had bogus
5978  * pointers back to their segments.
5979  * 
5980  * Revision 1.23  1994/08/25  21:56:33  mike
5981  * IS_CHILD stuff.
5982  * 
5983  * Revision 1.22  1994/08/15  18:06:54  yuan
5984  * Added external trigger.
5985  * 
5986  * Revision 1.21  1994/07/22  17:18:47  yuan
5987  * Working on dialog box for refuel/repair/material/control centers.
5988  * 
5989  * Revision 1.20  1994/07/06  10:55:55  john
5990  * New structures for hostages.
5991  * 
5992  * Revision 1.19  1994/07/01  16:36:20  yuan
5993  * Working on triggers that aren't always on.
5994  * 
5995  * Revision 1.18  1994/06/21  18:50:14  john
5996  * Made ESC key exit dialog.
5997  * 
5998  * Revision 1.17  1994/06/20  22:30:36  yuan
5999  * Fixed crazy runaway trigger bug that Adam found
6000  * 
6001  * Revision 1.16  1994/05/31  10:03:48  yuan
6002  * Fixed compiler warnings...
6003  * 
6004  * 
6005  * Revision 1.15  1994/05/30  20:22:30  yuan
6006  * New triggers.
6007  * 
6008  * Revision 1.14  1994/05/27  12:33:50  yuan
6009  * Fixed some bugs when adding trigger.
6010  * 
6011  * Revision 1.13  1994/05/27  10:34:29  yuan
6012  * Added new Dialog boxes for Walls and Triggers.
6013  * 
6014  * Revision 1.12  1994/05/25  18:15:02  yuan
6015  * Fixed make warnings to save 10 cents!
6016  * 
6017  * Revision 1.11  1994/05/25  18:08:03  yuan
6018  * Revamping walls and triggers interface.
6019  * Wall interface complete, but triggers are still in progress.
6020  * 
6021  * Revision 1.10  1994/04/29  15:05:50  yuan
6022  * Trigger/Link removing stuff still needs to be fixed.
6023  * 
6024  * Revision 1.9  1994/04/28  23:25:34  yuan
6025  * Obliterated warnings.
6026  * 
6027  * Revision 1.8  1994/04/28  18:08:06  yuan
6028  * Fixed trigger bug.
6029
6030 ------------------------------------------------------------------------
6031 main/editor/eswitch.h:
6032
6033  * Revision 2.0  1995/02/27  11:35:40  john
6034  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6035  * for bitmaps.tbl.
6036  * 
6037  * Revision 1.6  1994/05/30  20:22:35  yuan
6038  * New triggers.
6039  * 
6040  * Revision 1.5  1994/05/27  10:34:35  yuan
6041  * Added new Dialog boxes for Walls and Triggers.
6042  * 
6043  * Revision 1.4  1994/05/25  18:08:39  yuan
6044  * Revamping walls and triggers interface.
6045  * Wall interface complete, but triggers are still in progress.
6046  * 
6047  * Revision 1.3  1994/04/28  23:46:56  yuan
6048  * Added prototype for remove_trigger.
6049  * 
6050  * Revision 1.2  1994/03/15  16:34:20  yuan
6051  * Fixed bm loader (might have some changes in walls and switches)
6052  * 
6053  * Revision 1.1  1994/03/10  14:49:03  yuan
6054  * Initial revision
6055
6056 ------------------------------------------------------------------------
6057 main/editor/fixseg.c:
6058
6059  * Revision 2.0  1995/02/27  11:36:25  john
6060  * Version 2.0. Ansi-fied.
6061  * 
6062  * Revision 1.7  1994/11/27  23:18:01  matt
6063  * Made changes for new mprintf calling convention
6064  * 
6065  * Revision 1.6  1994/11/17  14:48:00  mike
6066  * validation functions moved from editor to game.
6067  * 
6068  * Revision 1.5  1994/08/04  19:13:26  matt
6069  * Changed a bunch of vecmat calls to use multiple-function routines, and to
6070  * allow the use of C macros for some functions
6071  * 
6072  * Revision 1.4  1994/02/10  15:36:31  matt
6073  * Various changes to make editor compile out.
6074  * 
6075  * Revision 1.3  1993/12/03  18:45:09  mike
6076  * initial stuff.
6077  * 
6078  * Revision 1.2  1993/11/30  17:05:09  mike
6079  * Added part of code to make a side planar.
6080  * 
6081  * Revision 1.1  1993/11/30  10:05:36  mike
6082  * Initial revision
6083
6084 ------------------------------------------------------------------------
6085 main/editor/func.c:
6086
6087  * Revision 1.1  1994/11/21  14:13:17  matt
6088  * Initial revision
6089  * 
6090  * Revision 1.1  1993/11/15  12:28:17  john
6091  * Initial revision
6092
6093 ------------------------------------------------------------------------
6094 main/editor/group.c:
6095
6096  * Revision 2.0  1995/02/27  11:35:05  john
6097  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6098  * for bitmaps.tbl.
6099  * 
6100  * Revision 1.65  1994/11/27  23:17:21  matt
6101  * Made changes for new mprintf calling convention
6102  * 
6103  * Revision 1.64  1994/11/17  14:48:08  mike
6104  * validation functions moved from editor to game.
6105  * 
6106  * Revision 1.63  1994/11/17  11:38:56  matt
6107  * Ripped out code to load old mines
6108  * 
6109  * Revision 1.62  1994/10/27  10:06:20  mike
6110  * adapt to no inverse table.
6111  * 
6112  * Revision 1.61  1994/10/03  23:40:08  mike
6113  * New fuelcen_activate parameters.
6114  * 
6115  * Revision 1.60  1994/09/28  17:32:01  mike
6116  * Make group copying work for copying a group's walls.
6117  * 
6118  * Revision 1.59  1994/09/20  14:35:28  mike
6119  * Fix bugs in group subtraction code.  Don't allow to attach a group if the attach side is unfree.
6120  * 
6121  * Revision 1.58  1994/08/25  21:58:07  mike
6122  * IS_CHILD stuff.
6123  * 
6124  * Revision 1.57  1994/08/04  19:12:58  matt
6125  * Changed a bunch of vecmat calls to use multiple-function routines, and to
6126  * allow the use of C macros for some functions
6127  * 
6128  * Revision 1.56  1994/08/03  15:40:01  mike
6129  * Enable calls to compress_mine to get rid of bugs in group
6130  * copying -- was creating invalid segments.
6131  * 
6132  * Revision 1.55  1994/06/30  10:59:13  yuan
6133  * Fixed texture translations.
6134  * 
6135  * Revision 1.54  1994/06/22  17:36:00  mike
6136  * Fix bug in group creation, was stuffing first two group segs over number
6137  * of segments in group (then number would overwrite them), so there would
6138  * be two bogus segments in group, one of which was always 0, the other
6139  * would be a small number.
6140  * 
6141  * Revision 1.53  1994/06/14  17:07:15  john
6142  * *** empty log message ***
6143  * 
6144  * Revision 1.52  1994/06/14  16:59:09  mike
6145  * Fix references to tmap_num2, must strip off orientation bits.
6146  * 
6147  * Revision 1.51  1994/05/23  14:56:37  mike
6148  * make current segment be add segment.
6149  * 
6150  * Revision 1.50  1994/05/19  12:10:01  matt
6151  * Use new vecmat macros and globals
6152  * 
6153  * Revision 1.49  1994/05/17  10:33:59  matt
6154  * Deleted unused get_free_object_num() func.
6155  * 
6156  * Revision 1.48  1994/05/09  23:34:17  mike
6157  * Punch all sloppy sides in a group, speed up segment rotation.
6158  * 
6159  * Revision 1.47  1994/05/06  14:39:56  mike
6160  * Make objects move and copy with groups.
6161  * 
6162  * Revision 1.46  1994/05/05  16:05:54  yuan
6163  * Added fuelcen/repaircens to groups...
6164  * 
6165  * Eventually, walls will be added too...
6166  * 
6167  * Revision 1.45  1994/05/05  12:56:25  yuan
6168  * Fixed a bunch of group bugs.
6169  * 
6170  * Revision 1.44  1994/05/04  14:10:04  mike
6171  * Assert added to prevent bombing out when current_group = -1
6172  * 
6173  * Revision 1.43  1994/05/02  17:59:18  yuan
6174  * Changed undo_status into an array rather than malloced pointers.
6175  * 
6176  * Revision 1.42  1994/05/02  15:23:19  mike
6177  * Call med_combine_duplicate_vertices in med_copy_group and med_move_group.
6178  * 
6179  * Revision 1.41  1994/04/27  12:11:23  mike
6180  * Fix bug in group rotation.
6181  * 
6182  * Revision 1.40  1994/04/22  10:07:37  yuan
6183  * Make sure we don't get obj->next equal itself error.
6184  * 
6185  * Revision 1.39  1994/04/18  17:15:13  yuan
6186  * Added error checking for select prev, and next group.
6187
6188 ------------------------------------------------------------------------
6189 main/editor/info.c:
6190
6191  * Revision 2.0  1995/02/27  11:35:34  john
6192  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6193  * for bitmaps.tbl.
6194  * 
6195  * Revision 1.42  1995/02/22  15:12:50  allender
6196  * remove anonymous unions from object structure
6197  * 
6198  * Revision 1.41  1994/12/08  13:59:39  matt
6199  * *** empty log message ***
6200  * 
6201  * Revision 1.40  1994/09/30  00:38:30  mike
6202  * Fix some diagnostic messages
6203  * 
6204  * Revision 1.39  1994/09/29  20:13:12  mike
6205  * Clean up some text, prevent it from writing outside canvas.
6206  * 
6207  * Revision 1.38  1994/09/29  09:32:17  mike
6208  * Fix text clipping problem in UI keypad info text.
6209  * 
6210  * Revision 1.37  1994/09/25  23:42:20  matt
6211  * Took out references to obsolete constants
6212  * 
6213  * Revision 1.36  1994/08/25  21:57:05  mike
6214  * IS_CHILD stuff.
6215  * 
6216  * Revision 1.35  1994/08/23  16:39:50  mike
6217  * mode replaced by behavior in ai_info.
6218  * 
6219  * Revision 1.34  1994/07/18  10:45:23  mike
6220  * Fix erase window in texture pads after adding more click-boxes.
6221  * 
6222  * Revision 1.33  1994/07/15  12:34:10  mike
6223  * Remove use of AIM_FOLLOW_PATH_CIRCULAR.
6224  * 
6225  * Revision 1.32  1994/06/17  17:13:46  yuan
6226  * Fixed text so it doesn't overflow screen
6227  * 
6228  * Revision 1.31  1994/06/01  17:22:31  matt
6229  * Set font color before drawing info; got rid of superfluous %d
6230  * 
6231  * Revision 1.30  1994/05/29  23:40:29  matt
6232  * Killed reference to now-unused movement type
6233  * 
6234  * Revision 1.29  1994/05/29  22:52:32  matt
6235  * Deleted unused stuff
6236  * 
6237  * Revision 1.28  1994/05/27  10:34:16  yuan
6238  * Added new Dialog boxes for Walls and Triggers.
6239  * 
6240  * Revision 1.27  1994/05/17  10:34:35  matt
6241  * Changed Num_objects to num_objects, since it's not really global anymore
6242  * 
6243  * Revision 1.26  1994/05/14  17:17:59  matt
6244  * Got rid of externs in source (non-header) files
6245  * 
6246  * Revision 1.25  1994/05/12  14:47:07  mike
6247  * Adjust for Ai_states killed, replaced by field in object structure.
6248  * 
6249  * Revision 1.24  1994/05/06  12:52:11  yuan
6250  * Adding some gamesave checks...
6251  * 
6252  * Revision 1.23  1994/05/03  19:21:28  matt
6253  * Removed reference to robot flythrough mode, which doesn't exist anymore
6254  * 
6255  * Revision 1.22  1994/05/03  11:03:06  mike
6256  * Customize text for segment sizing keypad.
6257  * 
6258  * Revision 1.21  1994/04/29  15:05:40  yuan
6259  * More info added...
6260  * 
6261  * Revision 1.20  1994/04/22  17:45:58  john
6262  * MAde top 2 bits of paste-ons pick the 
6263  * orientation of the bitmap.
6264  * 
6265  * Revision 1.19  1994/04/20  17:29:30  yuan
6266  * Added tmap_num info.
6267  * 
6268  * Revision 1.18  1994/04/13  19:12:55  mike
6269  * Fix font color problems in keypads.
6270  * 
6271  * Revision 1.17  1994/04/13  13:26:37  mike
6272  * Kill a mprintf.
6273  * 
6274  * Revision 1.16  1994/04/13  13:24:44  mike
6275  * Separate info display, customize for each keypad.
6276  * 
6277  * Revision 1.15  1994/03/19  17:21:31  yuan
6278  * Wall system implemented until specific features need to be added...
6279  * (Needs to be hammered on though.)
6280  * 
6281  * Revision 1.14  1994/02/22  18:13:13  yuan
6282  * Added tmap number field.
6283  * 
6284  * Revision 1.13  1994/02/17  09:46:27  matt
6285  * Removed include of slew.h
6286  * 
6287  * Revision 1.12  1994/02/16  19:58:56  yuan
6288  * Added type to info
6289  * 
6290  * Revision 1.11  1994/02/16  16:48:08  yuan
6291  * Added Curside.
6292  * 
6293  * Revision 1.10  1994/02/03  17:26:43  yuan
6294  * Fixed formatting of vertex numbering.
6295  * 
6296  * Revision 1.9  1994/01/31  12:17:06  yuan
6297  * Make sure Num_segments, etc. are drawn.
6298  * 
6299  * Revision 1.8  1994/01/22  13:43:12  yuan
6300  * Cosmetic fixes.
6301  * 
6302  * Revision 1.7  1994/01/21  12:14:59  yuan
6303  * Fixed cosmetic problem
6304  * 
6305  * Revision 1.6  1994/01/21  12:01:03  yuan
6306  * Added segment and vertex info
6307  * 
6308  * Revision 1.5  1994/01/20  11:28:11  john
6309  * *** empty log message ***
6310  * 
6311  * Revision 1.4  1994/01/19  10:44:42  john
6312  * *** empty log message ***
6313  * 
6314  * Revision 1.3  1994/01/19  10:32:36  john
6315  * *** empty log message ***
6316  * 
6317  * Revision 1.2  1994/01/19  09:34:31  john
6318  * First version.
6319  * 
6320  * Revision 1.1  1994/01/19  09:30:43  john
6321  * Initial revision
6322
6323 ------------------------------------------------------------------------
6324 main/editor/info.h:
6325
6326  * Revision 2.0  1995/02/27  11:34:32  john
6327  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6328  * for bitmaps.tbl.
6329  * 
6330  * Revision 1.2  1994/05/14  17:18:17  matt
6331  * Got rid of externs in source (non-header) files
6332  * 
6333  * Revision 1.1  1994/05/14  16:30:39  matt
6334  * Initial revision
6335
6336 ------------------------------------------------------------------------
6337 main/editor/kbuild.c:
6338
6339  * Revision 2.0  1995/02/27  11:35:43  john
6340  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6341  * for bitmaps.tbl.
6342  * 
6343  * Revision 1.20  1995/02/22  11:00:47  yuan
6344  * prototype include.
6345  * 
6346  * Revision 1.19  1995/02/22  10:59:01  yuan
6347  * Save sloppy mine before punching.
6348  * 
6349  * Revision 1.18  1994/08/25  21:57:56  mike
6350  * IS_CHILD stuff.
6351  * 
6352  * Revision 1.17  1994/05/16  12:00:52  mike
6353  * Call med_combine_duplicate_vertices before various build functions.
6354  * 
6355  * Revision 1.16  1994/05/09  23:34:31  mike
6356  * Punch all sloppy sides in a group.
6357  * 
6358  * Revision 1.15  1994/02/16  15:23:06  yuan
6359  * Checking in for editor make.
6360  * 
6361  * Revision 1.14  1994/01/21  12:01:31  yuan
6362  * Added clearer editor_status messages (sloppy joint vs. joint)
6363  * 
6364  * Revision 1.13  1994/01/14  11:59:52  yuan
6365  * New function in build menu. 
6366  * "Punch" through walls to force a joint formation with
6367  * closest segment:side, if the closest segment:side allows
6368  * a connection.
6369  * 
6370  * Revision 1.12  1994/01/07  17:45:05  yuan
6371  * Just changed some tabs and formatting I believe.
6372  * 
6373  * Revision 1.11  1993/12/06  19:33:36  yuan
6374  * Fixed autosave stuff so that undo restores Cursegp and
6375  * Markedsegp
6376  * 
6377  * Revision 1.10  1993/12/02  12:39:15  matt
6378  * Removed extra includes
6379  * 
6380  * Revision 1.9  1993/11/12  14:31:31  yuan
6381  * Added warn_if_concave_segments.
6382  * 
6383  * Revision 1.8  1993/11/11  17:12:45  yuan
6384  * Fixed display of messages, so that concave segment
6385  * warning doesn't wipe them out immediately.
6386  * 
6387  * Revision 1.7  1993/11/09  12:09:28  mike
6388  * Remove extern for mine_filename, put it in editor.h
6389  * 
6390  * Revision 1.6  1993/11/08  19:14:06  yuan
6391  * Added Undo command (not working yet)
6392  * 
6393  * Revision 1.5  1993/11/05  17:32:36  john
6394  * added funcs
6395  * .,
6396  * 
6397  * Revision 1.4  1993/11/01  16:53:51  mike
6398  * Add CreateAdjacentJointsSegment and CreateAdjacentJointsAll
6399  * 
6400  * Revision 1.3  1993/11/01  11:24:59  mike
6401  * Add CreateJointAdjacent
6402  * 
6403  * Revision 1.2  1993/10/29  19:13:11  yuan
6404  * Added diagnostic messages
6405  * 
6406  * Revision 1.1  1993/10/13  18:53:27  john
6407  * Initial revision
6408
6409 ------------------------------------------------------------------------
6410 main/editor/kcurve.c:
6411
6412  * Revision 2.0  1995/02/27  11:35:29  john
6413  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6414  * for bitmaps.tbl.
6415  * 
6416  * Revision 1.17  1994/08/25  21:56:43  mike
6417  * IS_CHILD stuff.
6418  * 
6419  * Revision 1.16  1994/05/14  17:17:54  matt
6420  * Got rid of externs in source (non-header) files
6421  * 
6422  * Revision 1.15  1994/01/28  10:52:24  mike
6423  * Bind set_average_light_on_curside to DeleteCurve
6424  * 
6425  * Revision 1.14  1994/01/25  17:34:47  mike
6426  * Stupidly bound fix_bogus_uvs_all to delete curve.
6427  * 
6428  * Revision 1.13  1993/12/06  19:34:15  yuan
6429  * Fixed autosave so that undo restores Cursegp
6430  * and Markedsegp
6431  * 
6432  * Revision 1.12  1993/12/02  12:39:28  matt
6433  * Removed extra includes
6434  * 
6435  * Revision 1.11  1993/11/12  13:08:38  yuan
6436  * Fixed warning for concave segment so it appears after any
6437  * "less important" diagnostic messages.
6438  * 
6439  * Revision 1.10  1993/11/11  17:03:25  yuan
6440  * Fixed undo-status display
6441  * 
6442  * Revision 1.9  1993/11/11  15:55:11  yuan
6443  * Added undo messages.
6444  * 
6445  * Revision 1.8  1993/11/08  19:13:30  yuan
6446  * Added Undo command (not working yet)
6447  * 
6448  * Revision 1.7  1993/11/05  17:32:51  john
6449  * added funcs
6450  * .,
6451  * 
6452  * Revision 1.6  1993/10/29  19:12:41  yuan
6453  * Added diagnostic messages
6454  * 
6455  * Revision 1.5  1993/10/29  16:26:30  yuan
6456  * Added diagnostic messages for curve generation
6457  * 
6458  * Revision 1.4  1993/10/22  19:47:30  yuan
6459  * Can't build curve if Marked Seg has a segment attached.
6460  * 
6461  * Revision 1.3  1993/10/19  20:54:50  matt
6462  * Changed/cleaned up window updates
6463  * 
6464  * Revision 1.2  1993/10/14  13:52:17  mike
6465  * Add return value to AssignTexture
6466  * 
6467  * Revision 1.1  1993/10/13  18:53:11  john
6468  * Initial revision
6469
6470 ------------------------------------------------------------------------
6471 main/editor/kfuncs.c:
6472
6473  * Revision 2.1  1995/03/08  16:07:23  yuan
6474  * Added segment sizing default functions.
6475  * 
6476  * Revision 2.0  1995/02/27  11:34:45  john
6477  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6478  * for bitmaps.tbl.
6479  * 
6480  * Revision 1.112  1995/01/12  12:10:31  yuan
6481  * Added coop object capability.
6482  * 
6483  * Revision 1.111  1994/11/27  23:17:16  matt
6484  * Made changes for new mprintf calling convention
6485  * 
6486  * Revision 1.110  1994/11/23  12:17:22  mike
6487  * bind retmap functions.
6488  * 
6489  * Revision 1.109  1994/11/19  15:20:54  mike
6490  * rip out unused code and data.
6491  * 
6492  * Revision 1.108  1994/11/17  11:39:02  matt
6493  * Ripped out code to load old mines
6494  * 
6495  * Revision 1.107  1994/10/27  10:06:12  mike
6496  * kill macro stuff.
6497  * 
6498  * Revision 1.106  1994/10/18  15:31:43  mike
6499  * Bind mine correction function to test keypad, key=1.
6500  * 
6501  * Revision 1.105  1994/09/26  23:22:06  matt
6502  * Added functions to keep player's starting position from getting messed up
6503  * 
6504  * Revision 1.104  1994/09/24  14:15:41  mike
6505  * Custom colored object support.
6506  * 
6507  * Revision 1.103  1994/09/23  18:03:54  yuan
6508  * Finished wall checking code.
6509  * 
6510  * Revision 1.102  1994/09/22  19:03:52  mike
6511  * Test function test_shortpos on ctrl-keypad3
6512  * 
6513  * Revision 1.101  1994/09/20  14:35:56  mike
6514  * Bind functions to keypad 2, 3.
6515  * 
6516  * Revision 1.100  1994/09/15  22:58:10  matt
6517  * Made new objects be oriented to their segment
6518  * Added keypad function to flip an object upside-down
6519  * 
6520  * Revision 1.99  1994/09/14  16:50:50  yuan
6521  * Added load mine only function
6522  * 
6523  * Revision 1.98  1994/08/25  21:57:52  mike
6524  * IS_CHILD stuff.
6525  * 
6526  * Revision 1.97  1994/08/16  18:10:52  yuan
6527  * Maded C place you in the center of a segment.
6528  * 
6529  * Revision 1.96  1994/08/15  17:48:01  yuan
6530  * Added external walls.
6531  * 
6532  * Revision 1.95  1994/08/13  17:32:38  mike
6533  * test function.
6534  * 
6535  * Revision 1.94  1994/08/05  21:17:57  matt
6536  * Allow two doors to be linked together
6537  * 
6538  * Revision 1.93  1994/08/05  18:18:52  matt
6539  * Made object rotation have 4x resolution, and SHIFT+rotate do old resolution.
6540  * 
6541  * Revision 1.92  1994/08/03  10:31:06  mike
6542  * Add texture map propagation without uv assignment.
6543  * 
6544  * Revision 1.91  1994/08/02  14:17:00  mike
6545  * Clean up dialog boxes, add one for Matt.
6546  * 
6547  * Revision 1.90  1994/07/30  17:04:47  mike
6548  * Bind key for max_depth on path testing.
6549
6550 ------------------------------------------------------------------------
6551 main/editor/kfuncs.h:
6552
6553  * Revision 2.0  1995/02/27  11:34:33  john
6554  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6555  * for bitmaps.tbl.
6556  * 
6557  * Revision 1.2  1994/05/14  17:18:18  matt
6558  * Got rid of externs in source (non-header) files
6559  * 
6560  * Revision 1.1  1994/05/14  16:37:14  matt
6561  * Initial revision
6562
6563 ------------------------------------------------------------------------
6564 main/editor/kgame.c:
6565
6566  * Revision 2.0  1995/02/27  11:34:55  john
6567  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6568  * for bitmaps.tbl.
6569  * 
6570  * Revision 1.25  1995/02/23  10:18:05  allender
6571  * fixed parameter mismatch with compute_segment_center
6572  * 
6573  * Revision 1.24  1994/11/17  11:38:59  matt
6574  * Ripped out code to load old mines
6575  * 
6576  * Revision 1.23  1994/11/09  11:58:56  matt
6577  * Fixed small bug
6578  * 
6579  * Revision 1.22  1994/10/20  12:48:02  matt
6580  * Replaced old save files (MIN/SAV/HOT) with new LVL files
6581  * 
6582  * Revision 1.21  1994/10/15  19:08:47  mike
6583  * Fix bug if player object out of mine at save.
6584  * 
6585  * Revision 1.20  1994/10/13  13:15:43  matt
6586  * Properly relink player object when bashed for "permanant" position save
6587  * 
6588  * Revision 1.19  1994/10/11  17:07:23  matt
6589  * Fixed problem that sometimes caused bad player segnum after compress
6590  * 
6591  * Revision 1.18  1994/10/08  17:10:40  matt
6592  * Correctly set current_level_num when loading/creating mine in editor
6593  * 
6594  * Revision 1.17  1994/09/26  23:46:13  matt
6595  * Improved player position save code
6596  * 
6597  * Revision 1.16  1994/09/26  23:22:50  matt
6598  * Added functions to keep player's starting position from getting messed up
6599  * 
6600  * Revision 1.15  1994/09/14  16:50:51  yuan
6601  * Added load mine only function
6602  * 
6603  * Revision 1.14  1994/07/22  12:36:50  matt
6604  * Cleaned up editor/game interactions some more.
6605  * 
6606  * Revision 1.13  1994/07/21  17:26:26  matt
6607  * When new mine created, the default save filename is now reset
6608  * 
6609  * Revision 1.12  1994/06/03  12:27:05  yuan
6610  * Fixed restore game state.
6611  * 
6612  * 
6613  * Revision 1.11  1994/05/30  11:36:09  yuan
6614  * Do gamesave if new mine is loaded and game is entered...
6615  * 
6616  * Revision 1.10  1994/05/14  18:00:33  matt
6617  * Got rid of externs in source (non-header) files
6618  * 
6619  * Revision 1.9  1994/05/10  12:15:44  yuan
6620  * Fixed load_game functions to match prototype.
6621  * 
6622  * Revision 1.8  1994/05/06  12:52:15  yuan
6623  * Adding some gamesave checks...
6624  * 
6625  * Revision 1.7  1994/05/04  17:32:05  yuan
6626  * med_load_game changed to load_game
6627  * med_save_game changed to save_game
6628
6629 ------------------------------------------------------------------------
6630 main/editor/khelp.c:
6631
6632  * Revision 2.0  1995/02/27  11:34:27  john
6633  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6634  * for bitmaps.tbl.
6635  * 
6636  * Revision 1.5  1993/12/02  12:39:30  matt
6637  * Removed extra includes
6638  * 
6639  * Revision 1.4  1993/11/05  17:32:57  john
6640  * added funcs
6641  * .,
6642  * 
6643  * Revision 1.3  1993/11/03  13:42:41  yuan
6644  * Updated help commands
6645  * 
6646  * Revision 1.2  1993/10/22  19:48:07  yuan
6647  * added ctrl-shift-keypad comment in help.
6648  * 
6649  * Revision 1.1  1993/10/13  18:53:16  john
6650  * Initial revision
6651
6652 ------------------------------------------------------------------------
6653 main/editor/kmine.c:
6654
6655  * Revision 2.0  1995/02/27  11:34:22  john
6656  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6657  * for bitmaps.tbl.
6658  * 
6659  * Revision 1.53  1995/02/22  15:04:52  allender
6660  * remove anonymous unions from vecmat stuff
6661  * 
6662  * Revision 1.52  1994/11/27  23:17:13  matt
6663  * Made changes for new mprintf calling convention
6664  * 
6665  * Revision 1.51  1994/11/17  14:48:05  mike
6666  * validation functions moved from editor to game.
6667  * 
6668  * Revision 1.50  1994/11/17  11:38:49  matt
6669  * Ripped out code to load old mines
6670  * 
6671  * Revision 1.49  1994/10/08  17:10:22  matt
6672  * Correctly set current_level_num when loading/creating mine in editor
6673  * 
6674  * Revision 1.48  1994/10/03  11:30:45  matt
6675  * Fixed problem with permanant player position when creating a new mine
6676  * 
6677  * Revision 1.47  1994/09/29  17:42:19  matt
6678  * Cleaned up game_mode a little
6679  * 
6680  * Revision 1.46  1994/08/18  10:48:21  john
6681  * Cleaned up game sequencing.
6682  * 
6683  * Revision 1.45  1994/08/09  16:05:36  john
6684  * Added the ability to place players.  Made old
6685  * Player variable be ConsoleObject.
6686  * 
6687  * Revision 1.44  1994/07/22  12:37:06  matt
6688  * Cleaned up editor/game interactions some more.
6689  * 
6690  * Revision 1.43  1994/07/21  17:26:50  matt
6691  * When new mine created, the default save filename is now reset
6692  * 
6693  * Revision 1.42  1994/06/08  14:29:25  matt
6694  * Took out support for old mine versions
6695  * 
6696  * Revision 1.41  1994/06/03  12:28:04  yuan
6697  * Fixed game restore state.
6698  * 
6699  * Revision 1.40  1994/05/19  12:10:29  matt
6700  * Use new vecmat macros and globals
6701  * 
6702  * Revision 1.39  1994/05/14  17:17:56  matt
6703  * Got rid of externs in source (non-header) files
6704  * 
6705  * Revision 1.38  1994/05/12  14:47:47  mike
6706  * New previous mine structure and object structure.
6707  * 
6708  * Revision 1.37  1994/05/06  12:52:12  yuan
6709  * Adding some gamesave checks...
6710  * 
6711  * Revision 1.36  1994/05/05  20:37:02  yuan
6712  * Added gamesave checks when entering and leaving the game.
6713  * 
6714  * Removed Load Game Save Game functions...
6715  * Now there is only Load/Save Mine... (equivalent to old Load/Save Game)
6716  * 
6717  * Revision 1.35  1994/04/27  22:57:54  matt
6718  * Made sit mine load from path of sit file
6719  * 
6720  * Revision 1.34  1994/04/21  18:29:55  matt
6721  * Don't use same variable for mine filename & sit filename
6722  * 
6723  * Revision 1.33  1994/04/21  18:21:43  matt
6724  * Strip path from mine filename in sit file
6725  * 
6726  * Revision 1.32  1994/04/18  10:54:35  mike
6727  * Add situation save/load
6728  * 
6729  * Revision 1.31  1994/02/16  16:47:54  yuan
6730  * Removed temp.min.
6731  * 
6732  * Revision 1.30  1994/02/16  15:22:51  yuan
6733  * Checking in for editor make.
6734  * 
6735  * Revision 1.29  1994/02/09  15:04:23  yuan
6736  * brought back save ability
6737  * 
6738  * Revision 1.28  1994/02/08  12:42:45  yuan
6739  * fixed log.
6740  * 
6741  * Revision 1.27  1994/02/08  12:41:47  yuan
6742  *      Crippled save mine function from demo version.
6743  * 
6744  * Revision 1.26  1994/01/13  13:26:05  yuan
6745  * Added med_compress_mine when creating new mine or
6746  * when loading mine
6747  * 
6748  * Revision 1.25  1994/01/11  12:03:23  yuan
6749  * Fixed so that when old mine implementation not in,
6750  * message is displayed when you try to load an old mine
6751  * 
6752  * Revision 1.24  1994/01/11  11:47:57  yuan
6753  * *** empty log message ***
6754  * 
6755  * Revision 1.23  1994/01/05  09:59:56  yuan
6756  * Added load old mine funciton
6757  * 
6758  * Revision 1.22  1993/12/16  15:58:08  john
6759  * moved texture selection page to texpage.c
6760  * ,
6761  * 
6762  * Revision 1.21  1993/12/10  14:48:55  mike
6763  * Kill orthogonal views.
6764  * 
6765  * Revision 1.20  1993/12/03  16:44:06  yuan
6766  * Changed some 0.0 return values to 0
6767  * 
6768  * 
6769  * Revision 1.19  1993/12/02  12:39:34  matt
6770  * Removed extra includes
6771  * 
6772  * Revision 1.18  1993/11/17  13:14:48  yuan
6773  * Moved Save Group to group.c
6774  * 
6775  * Revision 1.17  1993/11/16  17:25:48  yuan
6776  * Unworking group function added... 
6777  * 
6778  * Revision 1.16  1993/11/15  14:46:25  john
6779  * Changed Menu to MenuX
6780  * 
6781  * Revision 1.15  1993/11/08  19:13:45  yuan
6782  * Added Undo command (not working yet)
6783
6784 ------------------------------------------------------------------------
6785 main/editor/ksegmove.c:
6786
6787  * Revision 2.0  1995/02/27  11:33:37  john
6788  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6789  * for bitmaps.tbl.
6790  * 
6791  * Revision 1.5  1993/12/02  12:39:36  matt
6792  * Removed extra includes
6793  * 
6794  * Revision 1.4  1993/11/12  16:40:23  mike
6795  * Use rotate_segment_new in place of med_rotate_segment_ang.
6796  * 
6797  * Revision 1.3  1993/11/05  17:32:54  john
6798  * added funcs
6799  * .,
6800  * 
6801  * Revision 1.2  1993/10/26  11:28:41  mike
6802  * Write common routine SegOrientCommon so all movement can pass
6803  * through the same routine to check for concavity, among other things.
6804  * 
6805  * Revision 1.1  1993/10/13  18:53:21  john
6806  * Initial revision
6807
6808 ------------------------------------------------------------------------
6809 main/editor/ksegsel.c:
6810
6811  * Revision 2.0  1995/02/27  11:35:33  john
6812  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6813  * for bitmaps.tbl.
6814  * 
6815  * Revision 1.12  1994/08/25  21:57:02  mike
6816  * IS_CHILD stuff.
6817  * 
6818  * Revision 1.11  1994/05/23  14:48:35  mike
6819  * make current segment be add segment.
6820  * 
6821  * Revision 1.10  1993/12/06  19:33:43  yuan
6822  * Fixed autosave stuff so that undo restores Cursegp and
6823  * Markedsegp
6824  * 
6825  * Revision 1.9  1993/12/02  12:39:37  matt
6826  * Removed extra includes
6827  * 
6828  * Revision 1.8  1993/11/12  13:08:17  yuan
6829  * Fixed warning for concave segment so it appears after any
6830  * "less important" diagnostic messages.
6831  * 
6832  * Revision 1.7  1993/11/05  17:32:49  john
6833  * added funcs
6834  * .,
6835  * 
6836  * Revision 1.6  1993/11/01  09:53:18  mike
6837  * Write functions get_next_segment and get_previous_segment.
6838  * 
6839  * Revision 1.5  1993/10/31  18:06:56  mike
6840  * Only set_view_target_from_segment if in that mode.
6841  * 
6842  * Revision 1.4  1993/10/28  15:01:09  matt
6843  * Mucked with update flags
6844  * 
6845  * Revision 1.3  1993/10/14  18:07:47  mike
6846  * Change use of CONNECTIVITY to MAX_SIDES_PER_SEGMENT
6847  * 
6848  * Revision 1.2  1993/10/14  11:47:34  john
6849  * *** empty log message ***
6850  * 
6851  * Revision 1.1  1993/10/13  18:53:39  john
6852  * Initial revision
6853
6854 ------------------------------------------------------------------------
6855 main/editor/ksegsize.c:
6856
6857  * Revision 2.1  1995/03/08  16:07:21  yuan
6858  * Added segment sizing default functions.
6859  * 
6860  * Revision 2.0  1995/02/27  11:35:46  john
6861  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6862  * for bitmaps.tbl.
6863  * 
6864  * Revision 1.15  1994/11/17  14:47:42  mike
6865  * validation functions moved from editor to game.
6866  * 
6867  * Revision 1.14  1994/08/25  21:57:45  mike
6868  * IS_CHILD stuff.
6869  * 
6870  * Revision 1.13  1994/07/18  10:44:43  mike
6871  * Fix uv propagation after segment sizing.
6872  * 
6873  * Revision 1.12  1994/05/04  19:16:34  mike
6874  * *** empty log message ***
6875  * 
6876  * Revision 1.11  1994/05/03  18:31:00  mike
6877  * Add PerturbCurside.
6878  * 
6879  * Revision 1.10  1994/05/03  11:05:14  mike
6880  * Overhaul segment sizing system to allow sizing of non-free vertices,
6881  * and also sizing of vertices on a side, edge or a single vertex.
6882  * 
6883  * Revision 1.9  1993/12/12  17:16:00  mike
6884  * Kill some mprintf code.
6885  * 
6886  * 
6887  * Revision 1.8  1993/12/10  11:10:53  mike
6888  * Fix bugs in tmap propagation in segment sizing.
6889  * 
6890  * Revision 1.7  1993/12/06  13:25:30  mike
6891  * Fix bug in setting size of New_segment after segment scale.
6892  * 
6893  * Revision 1.6  1993/11/17  18:57:52  mike
6894  * Change scaling to be additive.
6895  * 
6896  * Revision 1.5  1993/11/12  16:52:57  mike
6897  * *** empty log message ***
6898  * 
6899  * Revision 1.4  1993/11/05  17:32:47  john
6900  * added funcs
6901  * .,
6902  * 
6903  * Revision 1.3  1993/10/19  11:22:11  matt
6904  * Removed extra includes
6905  * 
6906  * Revision 1.2  1993/10/17  14:17:52  mike
6907  * Add big scale changes for segment.
6908  * 
6909  * Revision 1.1  1993/10/13  18:53:01  john
6910  * Initial revision
6911
6912 ------------------------------------------------------------------------
6913 main/editor/ktmap.c:
6914
6915  * Revision 2.0  1995/02/27  11:35:37  john
6916  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6917  * for bitmaps.tbl.
6918  * 
6919  * Revision 1.26  1994/08/25  21:57:12  mike
6920  * IS_CHILD stuff.
6921  * 
6922  * Revision 1.25  1994/08/03  10:32:41  mike
6923  * Texture map stretching.
6924  * 
6925  * Revision 1.24  1994/05/14  17:17:35  matt
6926  * Got rid of externs in source (non-header) files
6927  * 
6928  * Revision 1.23  1994/04/28  10:48:38  yuan
6929  * Fixed undo message for Clear Texture.
6930  * 
6931  * Revision 1.22  1994/04/22  17:45:42  john
6932  * MAde top 2 bits of paste-ons pick the 
6933  * orientation of the bitmap.
6934  * 
6935  * Revision 1.21  1994/04/01  14:36:08  yuan
6936  * Fixed propogate function so you can propogate and move.
6937  * 
6938  * Revision 1.20  1994/03/19  17:22:08  yuan
6939  * Wall system implemented until specific features need to be added...
6940  * (Needs to be hammered on though.)
6941  * 
6942  * Revision 1.19  1994/02/14  12:06:12  mike
6943  * change segment data structure.
6944  * 
6945  * Revision 1.18  1994/01/25  17:58:47  yuan
6946  * Added ambient lighting, and also added fixing bogus segments
6947  * functions to the editor... (they don't work fully... need to
6948  * check out seguvs.c
6949  * 
6950  * Revision 1.17  1994/01/24  11:54:52  yuan
6951  * Checking everything in
6952  * 
6953  * Revision 1.16  1994/01/18  16:05:57  yuan
6954  * Added clear texture 2 function (shift 0)
6955  * 
6956  * Revision 1.15  1994/01/18  10:15:01  yuan
6957  * added texture stuff
6958  * 
6959  * Revision 1.14  1993/12/06  19:33:57  yuan
6960  * Fixed autosave stuff so that undo restores Cursegp and
6961  * Markedsegp
6962  * 
6963  * Revision 1.13  1993/12/02  12:39:39  matt
6964  * Removed extra includes
6965  * 
6966  * Revision 1.12  1993/11/28  17:31:34  mike
6967  * Use new segment data structure.
6968  * 
6969  * Revision 1.11  1993/11/12  16:38:37  mike
6970  * Change call to med_propagate_tmaps_to_segments to include new uv_only_flag parameter.
6971  * 
6972  * Revision 1.10  1993/11/11  15:53:30  yuan
6973  * Fixed undo display message
6974  * 
6975  * Revision 1.9  1993/11/08  19:13:46  yuan
6976  * Added Undo command (not working yet)
6977  * 
6978  * Revision 1.8  1993/11/05  17:32:48  john
6979  * added funcs
6980  * .,
6981  * 
6982  * Revision 1.7  1993/11/02  10:31:08  mike
6983  * Add PropagateTexturesSelected.
6984  * 
6985  * Revision 1.6  1993/10/29  11:43:15  mike
6986  * Write PropagateTextures
6987  * 
6988  * Revision 1.5  1993/10/25  13:26:39  mike
6989  * Force redraw whenever a texture map is assigned.
6990  * 
6991  * Revision 1.4  1993/10/15  17:42:53  mike
6992  * Make AssignTexture also assign texture maps to New_segment.
6993  * 
6994  * Revision 1.3  1993/10/15  13:10:24  mike
6995  * Adapt AssignTexture to new segment structure.
6996  * 
6997  * Revision 1.2  1993/10/14  18:09:17  mike
6998  * Debug code for AssignTexture and comment out code.
6999  * 
7000  * Revision 1.1  1993/10/14  14:01:49  mike
7001  * Initial revision
7002
7003 ------------------------------------------------------------------------
7004 main/editor/kview.c:
7005
7006  * Revision 2.0  1995/02/27  11:34:21  john
7007  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7008  * for bitmaps.tbl.
7009  * 
7010  * Revision 1.11  1993/12/02  12:39:41  matt
7011  * Removed extra includes
7012  * 
7013  * Revision 1.10  1993/11/16  13:47:54  john
7014  * Xchanged move away/closer
7015  * 
7016  * Revision 1.9  1993/11/16  13:45:32  john
7017  * Exchanged zoom in/out.
7018  * 
7019  * Revision 1.8  1993/11/05  17:32:56  john
7020  * added funcs
7021  * .,
7022  * 
7023  * Revision 1.7  1993/11/03  12:10:21  yuan
7024  * No keypress associated with chase mode
7025  * 
7026  * Revision 1.6  1993/11/02  17:06:55  yuan
7027  * Icon stuff added.
7028  * 
7029  * Revision 1.5  1993/11/01  12:48:59  yuan
7030  * Added Chase mode icon to status bar.
7031  * 
7032  * Revision 1.4  1993/10/29  19:12:55  yuan
7033  * Added diagnostic messages
7034  * 
7035  * Revision 1.3  1993/10/27  18:26:16  matt
7036  * Made zoom & related keys not do anything if no current view
7037  * 
7038  * Revision 1.2  1993/10/19  20:54:33  matt
7039  * Changed/cleaned up window updates
7040  * 
7041  * Revision 1.1  1993/10/13  18:53:34  john
7042  * Initial revision
7043
7044 ------------------------------------------------------------------------
7045 main/editor/macro.c:
7046
7047  * Revision 2.0  1995/02/27  11:35:09  john
7048  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7049  * for bitmaps.tbl.
7050  * 
7051  * Revision 1.12  1993/11/15  14:46:37  john
7052  * Changed Menu to MenuX
7053  * 
7054  * Revision 1.11  1993/11/05  17:32:44  john
7055  * added funcs
7056  * .,
7057  * 
7058  * Revision 1.10  1993/10/28  16:23:20  john
7059  * *** empty log message ***
7060  * 
7061  * Revision 1.9  1993/10/28  13:03:12  john
7062  * ..
7063  * 
7064  * Revision 1.8  1993/10/25  16:02:35  john
7065  * *** empty log message ***
7066  * 
7067  * Revision 1.7  1993/10/22  13:35:29  john
7068  * *** empty log message ***
7069  * 
7070  * Revision 1.6  1993/10/21  17:10:09  john
7071  * Fixed bug w/ load macro.
7072  * 
7073  * Revision 1.5  1993/10/19  12:58:47  john
7074  * *** empty log message ***
7075  * 
7076  * Revision 1.4  1993/10/19  12:55:02  john
7077  * *** empty log message ***
7078  * 
7079  * Revision 1.3  1993/10/19  12:49:49  john
7080  * made EventBuffer dynamic, use ReadFile, WriteFile
7081  * 
7082  * Revision 1.2  1993/10/15  17:42:20  john
7083  * *** empty log message ***
7084  * 
7085  * Revision 1.1  1993/10/15  17:28:06  john
7086  * Initial revision
7087
7088 ------------------------------------------------------------------------
7089 main/editor/macro.h:
7090
7091  * Revision 2.0  1995/02/27  11:34:32  john
7092  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7093  * for bitmaps.tbl.
7094  * 
7095  * Revision 1.2  1994/05/14  17:18:19  matt
7096  * Got rid of externs in source (non-header) files
7097  * 
7098  * Revision 1.1  1994/05/14  16:38:50  matt
7099  * Initial revision
7100
7101 ------------------------------------------------------------------------
7102 main/editor/med.c:
7103
7104  * Revision 2.3  1995/03/06  18:23:52  john
7105  * Fixed bug with font screwing up.
7106  * 
7107  * Revision 2.2  1995/03/06  16:34:55  john
7108  * Fixed bug with previous.
7109  * 
7110  * Revision 2.1  1995/03/06  15:20:57  john
7111  * New screen mode method.
7112  * 
7113  * Revision 2.0  1995/02/27  11:35:54  john
7114  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7115  * for bitmaps.tbl.
7116  * 
7117  * Revision 1.192  1994/11/30  12:33:55  mike
7118  * set window clearing mode for editor.
7119  * 
7120  * Revision 1.191  1994/11/27  23:17:02  matt
7121  * Made changes for new mprintf calling convention
7122  * 
7123  * Revision 1.190  1994/11/19  00:04:33  john
7124  * Changed some shorts to ints.
7125  * 
7126  * Revision 1.189  1994/11/17  14:47:57  mike
7127  * validation functions moved from editor to game.
7128  * 
7129  * Revision 1.188  1994/11/14  11:41:38  john
7130  * Fixed bug with editor/game sequencing.
7131  * 
7132  * Revision 1.187  1994/11/13  15:36:44  john
7133  * Changed game sequencing with editor.
7134  * 
7135  * Revision 1.186  1994/11/10  16:49:12  matt
7136  * Don't sort seg list if no segs in list
7137  * 
7138  * Revision 1.185  1994/11/08  09:28:39  mike
7139  * reset ai paths on going to game.
7140  * 
7141  * Revision 1.184  1994/10/30  14:13:05  mike
7142  * rip out repair center stuff.
7143  * 
7144  * Revision 1.183  1994/10/27  10:07:06  mike
7145  * adapt to no inverse table.
7146  * 
7147  * Revision 1.182  1994/10/20  12:48:03  matt
7148  * Replaced old save files (MIN/SAV/HOT) with new LVL files
7149  * 
7150  * Revision 1.181  1994/10/13  11:39:22  john
7151  * Took out network stuff/.
7152  * 
7153  * Revision 1.180  1994/10/07  22:21:38  mike
7154  * Stop Delete-{whatever} from hanging you!
7155  * 
7156  * Revision 1.179  1994/10/03  23:39:37  mike
7157  * Adapt to newer, better, fuelcen_activate function.
7158  * 
7159  * Revision 1.178  1994/09/30  00:38:05  mike
7160  * Shorten diagnostic message erase -- was erasing outside canvas.
7161  * 
7162  * Revision 1.177  1994/09/28  17:31:37  mike
7163  * Add call to check_wall_validity();
7164  * 
7165  * Revision 1.176  1994/08/19  10:57:42  mike
7166  * Fix status message erase bug.
7167  * 
7168  * Revision 1.175  1994/08/18  10:48:12  john
7169  * Cleaned up game sequencing.
7170  * 
7171  * Revision 1.174  1994/08/16  18:11:04  yuan
7172  * Maded C place you in the center of a segment.
7173  * 
7174  * Revision 1.173  1994/08/10  19:55:05  john
7175  * Changed font stuff.
7176  * 
7177  * Revision 1.172  1994/08/09  16:06:06  john
7178  * Added the ability to place players.  Made old
7179  * Player variable be ConsoleObject.
7180  * 
7181  * Revision 1.171  1994/08/04  09:14:11  matt
7182  * Fixed problem I said I fixed last time
7183  * 
7184  * Revision 1.170  1994/08/04  00:27:57  matt
7185  * When viewing a wall, update the objects segnum if moved out of the segment
7186  * 
7187  * Revision 1.169  1994/08/02  14:18:12  mike
7188  * Clean up dialog boxes.
7189  * 
7190  * Revision 1.168  1994/07/29  15:34:35  mike
7191  * Kill some mprintfs.
7192  * 
7193  * Revision 1.167  1994/07/29  14:56:46  yuan
7194  * Close centers window, when you go into game.
7195  * 
7196  * Revision 1.166  1994/07/28  17:16:20  john
7197  * MAde editor use Network stuff.
7198  * 
7199  * Revision 1.165  1994/07/28  16:59:10  mike
7200  * objects containing objects.
7201  * 
7202  * Revision 1.164  1994/07/22  12:37:07  matt
7203  * Cleaned up editor/game interactions some more.
7204  * 
7205  * Revision 1.163  1994/07/21  19:35:11  yuan
7206  * Fixed #include problem
7207  * 
7208  * Revision 1.162  1994/07/21  18:02:09  matt
7209  * Don't re-init player stats when going from editor -> game
7210  * 
7211  * Revision 1.161  1994/07/21  12:47:53  mike
7212  * Add tilde key functionality for object movement.
7213  * 
7214  * Revision 1.160  1994/07/18  10:44:55  mike
7215  * One-click access to keypads.
7216  * 
7217  * Revision 1.159  1994/07/01  18:05:54  john
7218  * *** empty log message ***
7219  * 
7220  * Revision 1.158  1994/07/01  17:57:06  john
7221  * First version of not-working hostage system
7222  * 
7223  * 
7224  * Revision 1.157  1994/07/01  11:32:29  john
7225  * *** empty log message ***
7226  * 
7227  * Revision 1.156  1994/06/24  17:04:36  john
7228  * *** empty log message ***
7229  * 
7230  * Revision 1.155  1994/06/23  15:53:47  matt
7231  * Finished hacking in 3d rendering in big window
7232  * 
7233  * Revision 1.154  1994/06/21  16:17:54  yuan
7234  * Init stats when you go to game from editor
7235  * 
7236  * Revision 1.153  1994/06/21  12:57:14  yuan
7237  * Remove center from segment function added to menu.
7238
7239 ------------------------------------------------------------------------
7240 main/editor/meddraw.c:
7241
7242  * Revision 2.0  1995/02/27  11:34:42  john
7243  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7244  * for bitmaps.tbl.
7245  * 
7246  * Revision 1.34  1994/11/09  11:46:30  matt
7247  * Don't draw non-existant special segments
7248  * 
7249  * Revision 1.33  1994/10/27  10:06:38  mike
7250  * adapt to no inverse table.
7251  * 
7252  * Revision 1.32  1994/10/17  18:06:23  john
7253  * Made net player objects draw in dark green.
7254  * 
7255  * Revision 1.31  1994/09/26  16:44:33  yuan
7256  * Colored special segments.
7257  * 
7258  * Revision 1.30  1994/09/01  17:02:41  matt
7259  * Redraw pointer after world draw
7260  * 
7261  * Revision 1.29  1994/08/25  21:56:21  mike
7262  * IS_CHILD stuff.
7263  * 
7264  * Revision 1.28  1994/08/11  18:59:46  mike
7265  * Adapt to new int (vs short) version of gameseg functions.
7266  * 
7267  * Revision 1.27  1994/08/09  16:06:03  john
7268  * Added the ability to place players.  Made old
7269  * Player variable be ConsoleObject.
7270  * 
7271  * Revision 1.26  1994/07/25  00:03:05  matt
7272  * Various changes to accomodate new 3d, which no longer takes point numbers
7273  * as parms, and now only takes pointers to points.
7274  * 
7275  * Revision 1.25  1994/07/09  17:38:13  mike
7276  * comment out mprintf(0, "\n");
7277  * 
7278  * Revision 1.24  1994/07/07  19:34:47  matt
7279  * These changes are mostly Mike's, but I fixed a little bug that caused
7280  * some edges to think they were never used.
7281  * 
7282  * Revision 1.23  1994/07/06  16:36:18  mike
7283  * Optionally only draw segment lines which are in only one segment.
7284  * 
7285  * Revision 1.22  1994/05/27  10:34:28  yuan
7286  * Added new Dialog boxes for Walls and Triggers.
7287  * 
7288  * Revision 1.21  1994/05/14  18:00:56  matt
7289  * Got rid of externs in source (non-header) files
7290  * 
7291  * Revision 1.20  1994/05/09  23:35:21  mike
7292  * Change order of drawing found and selected segments.
7293  * 
7294  * Revision 1.19  1994/05/05  12:55:38  yuan
7295  * Fixed a bunch of group bugs.
7296  * 
7297  * Revision 1.18  1994/05/04  13:07:52  matt
7298  * Made current edge draw in green in wire-frame window
7299  * Also, moved a bunch of color constants here from editor.h
7300
7301 ------------------------------------------------------------------------
7302 main/editor/meddraw.h:
7303
7304  * Revision 2.0  1995/02/27  11:35:12  john
7305  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7306  * for bitmaps.tbl.
7307  * 
7308  * Revision 1.3  1994/07/06  16:36:54  mike
7309  * Prototype for draw_mine_all.
7310  * 
7311  * Revision 1.2  1993/12/17  12:05:09  john
7312  * Took stuff out of med.c; moved into medsel.c, meddraw.c, medmisc.c
7313  * 
7314  * Revision 1.1  1993/12/17  08:55:14  john
7315  * Initial revision
7316
7317 ------------------------------------------------------------------------
7318 main/editor/medmisc.c:
7319
7320  * Revision 2.1  1995/03/06  15:20:50  john
7321  * New screen mode method.
7322  * 
7323  * Revision 2.0  1995/02/27  11:36:40  john
7324  * Version 2.0. Ansi-fied.
7325  * 
7326  * Revision 1.31  1994/11/27  23:17:20  matt
7327  * Made changes for new mprintf calling convention
7328  * 
7329  * Revision 1.30  1994/11/17  14:48:11  mike
7330  * validation functions moved from editor to game.
7331  * 
7332  * Revision 1.29  1994/08/25  21:56:15  mike
7333  * IS_CHILD stuff.
7334  * 
7335  * Revision 1.28  1994/08/09  16:06:00  john
7336  * Added the ability to place players.  Made old
7337  * Player variable be ConsoleObject.
7338  * 
7339  * Revision 1.27  1994/07/21  17:25:43  matt
7340  * Took out unused func medlisp_create_new_mine() and its prototype
7341  * 
7342  * Revision 1.26  1994/07/21  13:27:01  matt
7343  * Cleaned up render code and added error checking
7344  * 
7345  * Revision 1.25  1994/07/20  15:32:52  matt
7346  * Added func to call g3_point_2_vec() for texture-mapped window
7347  * 
7348  * Revision 1.24  1994/07/15  15:26:53  yuan
7349  * Fixed warning
7350  * 
7351  * Revision 1.23  1994/07/14  14:45:16  yuan
7352  * Added function to set default segment and attach.
7353  * 
7354  * Revision 1.22  1994/07/14  09:46:34  yuan
7355  * Make E attach segment as well as make default.
7356  * 
7357  * 
7358  * Revision 1.21  1994/07/11  18:39:17  john
7359  * Reversed y axis roll.
7360  * 
7361  * Revision 1.20  1994/07/06  16:36:32  mike
7362  * Add hook for game to render wireframe view: draw_world_from_game.
7363  * 
7364  * Revision 1.19  1994/06/24  14:08:31  john
7365  * Changed calling params for render_frame.
7366  * 
7367  * Revision 1.18  1994/06/23  15:54:02  matt
7368  * Finished hacking in 3d rendering in big window
7369  * 
7370  * Revision 1.17  1994/06/22  00:32:56  matt
7371  * New version, without all the errors of the last version. Sorry.
7372  * 
7373  * Revision 1.15  1994/05/23  14:48:54  mike
7374  * make current segment be add segment.
7375  * 
7376  * Revision 1.14  1994/05/19  12:09:35  matt
7377  * Use new vecmat macros and globals
7378  * 
7379  * Revision 1.13  1994/05/14  17:17:55  matt
7380  * Got rid of externs in source (non-header) files
7381  * 
7382  * Revision 1.12  1994/05/09  23:35:06  mike
7383  * Add ClearFoundList, which is probably no longer being called.
7384  * 
7385  * Revision 1.11  1994/05/04  14:11:40  mike
7386  * Increase render depth from 4 to 6 by default.
7387  * 
7388  * Revision 1.10  1994/04/27  21:00:25  matt
7389  * Made texture-mapped window redraw when editor state variables (such as
7390  * current object) have changed.
7391  * 
7392  * Revision 1.9  1994/03/31  12:03:38  matt
7393  * Cleaned up includes
7394  * 
7395  * Revision 1.8  1994/02/17  11:31:21  matt
7396  * Changes in object system
7397  * 
7398  * Revision 1.7  1994/02/11  11:05:14  yuan
7399  * Make chase mode unsettable... Gives a warning on the mono.
7400  * 
7401  * Revision 1.6  1994/01/21  17:37:24  matt
7402  * Moved code from render_frame() to caller, making code cleaner
7403  * 
7404  * Revision 1.5  1994/01/11  18:12:43  yuan
7405  * compress_mines removed.  Now it is called within
7406  * the gamesave.min save whenever we go into the game.
7407  * 
7408  * Revision 1.4  1994/01/05  10:54:15  john
7409  * New object code by John
7410  * 
7411  * Revision 1.3  1993/12/29  16:15:27  mike
7412  * Kill scale field from segment struct.
7413  * 
7414  * Revision 1.2  1993/12/17  12:05:00  john
7415  * Took stuff out of med.c; moved into medsel.c, meddraw.c, medmisc.c
7416  * 
7417  * Revision 1.1  1993/12/17  08:35:47  john
7418  * Initial revision
7419
7420 ------------------------------------------------------------------------
7421 main/editor/medmisc.h:
7422
7423  * Revision 2.0  1995/02/27  11:34:40  john
7424  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7425  * for bitmaps.tbl.
7426  * 
7427  * Revision 1.3  1994/07/21  17:25:28  matt
7428  * Took out unused func medlisp_create_new_mine() and its prototype
7429  * 
7430  * Revision 1.2  1993/12/17  12:05:04  john
7431  * Took stuff out of med.c; moved into medsel.c, meddraw.c, medmisc.c
7432  * 
7433  * Revision 1.1  1993/12/17  08:45:23  john
7434  * Initial revision
7435
7436 ------------------------------------------------------------------------
7437 main/editor/medrobot.c:
7438
7439  * Revision 2.0  1995/02/27  11:35:59  john
7440  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7441  * for bitmaps.tbl.
7442  * 
7443  * Revision 1.46  1995/02/22  15:22:03  allender
7444  * remove anonyous unions from object structure
7445  * 
7446  * Revision 1.45  1994/11/27  23:17:32  matt
7447  * Made changes for new mprintf calling convention
7448  * 
7449  * Revision 1.44  1994/11/14  11:39:57  mike
7450  * fix default robot behavior
7451  * 
7452  * Revision 1.43  1994/11/02  16:18:47  matt
7453  * Moved draw_model_picture() out of editor, and cleaned up code
7454  * 
7455  * Revision 1.42  1994/10/10  17:23:23  mike
7456  * Verify that not placing too many player objects.
7457  * 
7458  * Revision 1.41  1994/10/09  22:04:38  mike
7459  * Maybe improve, maybe not, robot selection in shift-R menu.
7460  * 
7461  * Revision 1.40  1994/09/30  21:49:01  mike
7462  * Fix stupid shift-R dialog bug which caused lots of mprintf and selecting of object and frustration.
7463  * 
7464  * Revision 1.39  1994/09/30  11:51:33  mike
7465  * Fix boolean logic on an error trap.
7466  * 
7467  * Revision 1.38  1994/09/20  14:36:32  mike
7468  * Clean up Robot dialog.
7469  * 
7470  * Revision 1.37  1994/09/12  19:11:56  mike
7471  * Fix stupid bugs in selecting objects.
7472  * 
7473  * Revision 1.36  1994/09/01  17:05:51  matt
7474  * Don't force redraw if object select fails
7475  * 
7476  * Revision 1.35  1994/08/31  19:24:40  mike
7477  * Fix hang bug when only objects in mine are not robots.
7478  * 
7479  * Revision 1.34  1994/08/25  21:56:38  mike
7480  * IS_CHILD stuff.
7481  * 
7482  * Revision 1.33  1994/08/23  16:39:29  mike
7483  * mode replaced by behavior in ai_info.
7484  * 
7485  * Revision 1.32  1994/08/15  23:47:16  mike
7486  * fix bugs.
7487  * 
7488  * Revision 1.31  1994/08/13  17:32:45  mike
7489  * set to still function.
7490  * 
7491  * Revision 1.30  1994/08/09  16:06:02  john
7492  * Added the ability to place players.  Made old
7493  * Player variable be ConsoleObject.
7494  * 
7495  * Revision 1.29  1994/08/02  16:22:48  matt
7496  * Finished object editor dialog
7497
7498 ------------------------------------------------------------------------
7499 main/editor/medrobot.h:
7500
7501  * Revision 2.0  1995/02/27  11:35:04  john
7502  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7503  * for bitmaps.tbl.
7504  * 
7505  * Revision 1.4  1994/08/02  14:17:56  mike
7506  * Clean up dialog boxes.
7507  * 
7508  * Revision 1.3  1994/07/21  19:34:58  yuan
7509  * Fixed #include problem
7510  * 
7511  * Revision 1.2  1994/04/27  21:01:16  matt
7512  * Added prototypes for robot functions
7513  * 
7514  * Revision 1.1  1994/04/27  20:28:59  matt
7515  * Initial revision
7516
7517 ------------------------------------------------------------------------
7518 main/editor/medsel.c:
7519
7520  * Revision 2.0  1995/02/27  11:35:20  john
7521  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7522  * for bitmaps.tbl.
7523  * 
7524  * Revision 1.10  1994/08/09  16:05:59  john
7525  * Added the ability to place players.  Made old
7526  * Player variable be ConsoleObject.
7527  * 
7528  * Revision 1.9  1994/05/23  14:56:27  mike
7529  * make current segment be add segment.
7530  * 
7531  * Revision 1.8  1994/05/14  18:00:50  matt
7532  * Got rid of externs in source (non-header) files
7533  * 
7534  * Revision 1.7  1994/03/31  12:03:33  matt
7535  * Cleaned up includes
7536  * 
7537  * Revision 1.6  1994/02/17  12:52:13  yuan
7538  * Unbackdated
7539  * y
7540  * 
7541  * Revision 1.4  1994/02/17  09:46:53  matt
7542  * Removed include of slew.h
7543  * 
7544  * Revision 1.3  1994/01/05  10:54:23  john
7545  * New object code by John
7546  * 
7547  * Revision 1.2  1993/12/17  12:18:22  john
7548  * Moved selection stuff out of med.c
7549  * 
7550  * Revision 1.1  1993/12/17  09:29:34  john
7551  * Initial revision
7552
7553 ------------------------------------------------------------------------
7554 main/editor/medsel.h:
7555
7556  * Revision 2.0  1995/02/27  11:34:28  john
7557  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7558  * for bitmaps.tbl.
7559  * 
7560  * Revision 1.2  1993/12/17  12:18:35  john
7561  * Moved selection stuff out of med.c
7562  * 
7563  * Revision 1.1  1993/12/17  09:29:51  john
7564  * Initial revision
7565
7566 ------------------------------------------------------------------------
7567 main/editor/medwall.c:
7568
7569  * Revision 2.0  1995/02/27  11:35:47  john
7570  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7571  * for bitmaps.tbl.
7572  * 
7573  * Revision 1.71  1995/02/01  16:30:03  yuan
7574  * Stabilizing triggers and matcens.
7575  * 
7576  * Revision 1.70  1995/01/28  15:28:08  yuan
7577  * Return proper bug description.
7578  * 
7579  * Revision 1.69  1995/01/14  19:18:07  john
7580  * First version of object paging.
7581  * 
7582  * Revision 1.68  1995/01/12  12:10:44  yuan
7583  * Added delete trigger function
7584  * 
7585  * Revision 1.67  1994/11/29  16:51:53  yuan
7586  * Fixed false bogus trigger info.
7587  * 
7588  * Revision 1.66  1994/11/27  23:17:29  matt
7589  * Made changes for new mprintf calling convention
7590  * 
7591  * Revision 1.65  1994/11/15  11:59:42  john
7592  * Changed timing for door to use fixed seconds instead of milliseconds.
7593  * 
7594  * Revision 1.64  1994/11/03  10:41:17  yuan
7595  * Made walls add whichever the previous type was.
7596  * 
7597  * Revision 1.63  1994/10/13  13:14:59  yuan
7598  * Fixed trigger removal bug.
7599  * 
7600  * Revision 1.62  1994/10/07  17:43:39  yuan
7601  * Make validate walls default to 1.
7602  * 
7603  * Revision 1.61  1994/10/03  23:40:20  mike
7604  * Fix hosedness in walls in group copying.
7605  * 
7606  * Revision 1.60  1994/09/29  00:20:36  matt
7607  * Took out reference to unused external wall type
7608  * 
7609  * Revision 1.59  1994/09/28  17:32:24  mike
7610  * Functions to copy walls withing groups.
7611  * 
7612  * Revision 1.58  1994/09/28  13:40:46  yuan
7613  * Fixed control center trigger bug.
7614  * 
7615  * Revision 1.57  1994/09/24  12:41:52  matt
7616  * Took out references to obsolete constants
7617  * 
7618  * Revision 1.56  1994/09/23  18:03:55  yuan
7619  * Finished wall checking code.
7620  * 
7621  * Revision 1.55  1994/09/22  14:35:25  matt
7622  * Made blastable walls work again
7623  * 
7624  * Revision 1.54  1994/09/21  16:46:07  yuan
7625  * Fixed bug that reset wall slot which was just deleted.
7626  * 
7627  * Revision 1.53  1994/09/20  18:31:21  yuan
7628  * Output right Wallnum
7629  * 
7630  * Revision 1.52  1994/09/20  18:23:24  yuan
7631  * Killed the BOGIFYING WALL DRAGON...
7632  * 
7633  * There was a problem with triggers being created that had bogus
7634  * pointers back to their segments.
7635  * 
7636  * Revision 1.51  1994/09/20  11:13:11  yuan
7637  * Delete all bogus walls when checking walls.
7638  * 
7639  * Revision 1.50  1994/09/19  23:31:14  yuan
7640  * Adding wall checking stuff.
7641  * 
7642  * Revision 1.49  1994/09/13  21:11:20  matt
7643  * Added wclips that use tmap1 instead of tmap2, saving lots of merging
7644  * 
7645  * Revision 1.48  1994/09/10  13:32:08  matt
7646  * Made exploding walls a type of blastable walls.
7647  * Cleaned up blastable walls, making them tmap2 bitmaps.
7648  * 
7649  * Revision 1.47  1994/09/10  09:47:47  yuan
7650  * Added wall checking function.
7651  * 
7652  * Revision 1.46  1994/08/26  14:14:56  yuan
7653  * Fixed wall clip being set to -2 bug.
7654  * 
7655  * Revision 1.45  1994/08/25  21:56:26  mike
7656  * IS_CHILD stuff.
7657  * 
7658  * Revision 1.44  1994/08/19  19:30:27  matt
7659  * Added informative message if wall is already external when making it so.
7660  * 
7661  * Revision 1.43  1994/08/17  11:13:46  matt
7662  * Changed way external walls work
7663  * 
7664  * Revision 1.42  1994/08/15  17:47:29  yuan
7665  * Added external walls
7666  * 
7667  * Revision 1.41  1994/08/05  21:18:09  matt
7668  * Allow two doors to be linked together
7669  * 
7670  * Revision 1.40  1994/08/02  14:18:06  mike
7671  * Clean up dialog boxes.
7672  * 
7673  * Revision 1.39  1994/08/01  11:04:33  yuan
7674  * New materialization centers.
7675  * 
7676  * Revision 1.38  1994/07/22  17:19:11  yuan
7677  * Working on dialog box for refuel/repair/material/control centers.
7678  * 
7679  * Revision 1.37  1994/07/20  17:35:33  yuan
7680  * Added new gold key.
7681  * 
7682  * Revision 1.36  1994/07/19  14:31:44  yuan
7683  * Fixed keys bug.
7684  * 
7685  * Revision 1.35  1994/07/18  15:58:31  yuan
7686  * Hopefully prevent any "Adam door bombouts"
7687  * 
7688  * Revision 1.34  1994/07/18  15:48:40  yuan
7689  * Made minor cosmetic change.
7690  * 
7691  * Revision 1.33  1994/07/15  16:09:22  yuan
7692  * Error checking
7693  * 
7694  * Revision 1.32  1994/07/14  16:47:05  yuan
7695  * Fixed wall dialog for selected dooranims.
7696  * 
7697  * Revision 1.31  1994/07/11  15:09:16  yuan
7698  * Wall anim filenames stored in wclip structure.
7699  * 
7700  * Revision 1.30  1994/07/06  10:56:01  john
7701  * New structures for hostages.
7702  * 
7703  * Revision 1.29  1994/07/01  16:35:54  yuan
7704  * Added key system
7705  * 
7706  * Revision 1.28  1994/06/21  18:50:12  john
7707  * Made ESC key exit dialog.
7708  * 
7709  * Revision 1.27  1994/06/20  22:29:59  yuan
7710  * Fixed crazy runaway trigger bug that Adam found
7711  * 
7712  * Revision 1.26  1994/06/01  15:50:25  yuan
7713  * Added one more door... Needs to be set by bm.c in the future.
7714  * 
7715  * Revision 1.25  1994/05/30  20:22:34  yuan
7716  * New triggers.
7717  * 
7718  * Revision 1.24  1994/05/27  10:34:31  yuan
7719  * Added new Dialog boxes for Walls and Triggers.
7720  * 
7721  * Revision 1.23  1994/05/25  18:08:45  yuan
7722  * Revamping walls and triggers interface.
7723  * Wall interface complete, but triggers are still in progress.
7724  * 
7725  * Revision 1.22  1994/05/18  18:21:56  yuan
7726  * Fixed delete segment and walls bug.
7727  * 
7728  * Revision 1.21  1994/05/11  18:24:29  yuan
7729  * Oops.. trigger not triggers..
7730  * 
7731  * Revision 1.20  1994/05/11  18:23:53  yuan
7732  * Fixed trigger not set to -1 bug.
7733
7734 ------------------------------------------------------------------------
7735 main/editor/medwall.h:
7736
7737  * Revision 2.0  1995/02/27  11:35:10  john
7738  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7739  * for bitmaps.tbl.
7740  * 
7741  * Revision 1.9  1994/09/28  17:31:51  mike
7742  * Prototype copy_group_walls().
7743  * 
7744  * Revision 1.8  1994/08/05  21:18:16  matt
7745  * Allow two doors to be linked together
7746  * 
7747  * Revision 1.7  1994/06/20  22:30:10  yuan
7748  * Fixed crazy runaway trigger bug that Adam found
7749  * 
7750  * Revision 1.6  1994/05/30  20:22:58  yuan
7751  * New triggers.
7752  * 
7753  * Revision 1.5  1994/05/25  18:08:37  yuan
7754  * Revamping walls and triggers interface.
7755  * Wall interface complete, but triggers are still in progress.
7756  * 
7757  * Revision 1.4  1994/05/18  18:22:04  yuan
7758  * Fixed delete segment and walls bug.
7759  * 
7760  * Revision 1.3  1994/03/17  18:08:41  yuan
7761  * New wall stuff... Cut out switches....
7762  * 
7763  * Revision 1.2  1994/03/15  16:34:10  yuan
7764  * Fixed bm loader (might have some changes in walls and switches)
7765  * 
7766  * Revision 1.1  1994/02/10  17:52:01  matt
7767  * Initial revision
7768
7769 ------------------------------------------------------------------------
7770 main/editor/mine.c:
7771
7772  * Revision 2.0  1995/02/27  11:34:38  john
7773  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7774  * for bitmaps.tbl.
7775  * 
7776  * Revision 1.82  1995/01/19  15:19:42  mike
7777  * New super-compressed registered file format.
7778  * 
7779  * Revision 1.81  1994/12/15  16:51:39  mike
7780  * fix error message.
7781  * 
7782  * Revision 1.80  1994/12/09  22:52:27  yuan
7783  * *** empty log message ***
7784  * 
7785  * Revision 1.79  1994/11/27  23:17:14  matt
7786  * Made changes for new mprintf calling convention
7787  * 
7788  * Revision 1.78  1994/11/26  21:48:24  matt
7789  * Fixed saturation in short light value
7790  * 
7791  * Revision 1.77  1994/11/18  09:43:22  mike
7792  * mprintf and clean up instead of Assert on values which don't fit in a short.
7793  * 
7794  * Revision 1.76  1994/11/17  20:37:37  john
7795  * Added comment to get mike or john.
7796  * 
7797  * Revision 1.75  1994/11/17  20:08:51  john
7798  * Added new compiled level format.
7799  * 
7800  * Revision 1.74  1994/11/17  11:39:00  matt
7801  * Ripped out code to load old mines
7802  * 
7803  * Revision 1.73  1994/10/20  12:47:47  matt
7804  * Replaced old save files (MIN/SAV/HOT) with new LVL files
7805  * 
7806  * Revision 1.72  1994/09/23  22:13:58  matt
7807  * Tooks out references to obsolete structure fields
7808  * 
7809  * Revision 1.71  1994/09/22  18:39:40  john
7810  * *** empty log message ***
7811  * 
7812  * Revision 1.70  1994/09/22  18:38:09  john
7813  * Added better help for locked files.
7814  * 
7815  * Revision 1.69  1994/08/01  11:04:44  yuan
7816  * New materialization centers.
7817  * 
7818  * Revision 1.68  1994/06/08  14:29:35  matt
7819  * Took out support for old mine versions
7820  * 
7821  * Revision 1.67  1994/05/27  10:34:37  yuan
7822  * Added new Dialog boxes for Walls and Triggers.
7823  * 
7824  * Revision 1.66  1994/05/23  14:48:08  mike
7825  * make current segment be add segment.
7826  * 
7827  * Revision 1.65  1994/05/17  10:34:52  matt
7828  * New parm to reset_objects; Num_objects no longer global
7829  * 
7830  * Revision 1.64  1994/05/12  14:46:46  mike
7831  * Load previous mine type.
7832  * 
7833  * Revision 1.63  1994/05/06  12:52:13  yuan
7834  * Adding some gamesave checks...
7835  * 
7836  * Revision 1.62  1994/05/05  12:56:32  yuan
7837  * Fixed a bunch of group bugs.
7838  * 
7839  * Revision 1.61  1994/05/03  11:36:55  yuan
7840  * Fixing mine save.
7841  * 
7842  * Revision 1.60  1994/03/19  17:22:14  yuan
7843  * Wall system implemented until specific features need to be added...
7844  * (Needs to be hammered on though.)
7845  * 
7846  * Revision 1.59  1994/03/17  18:08:32  yuan
7847  * New wall stuff... Cut out switches....
7848  * 
7849  * Revision 1.58  1994/03/15  16:34:15  yuan
7850  * Fixed bm loader (might have some changes in walls and switches)
7851  * 
7852  * Revision 1.57  1994/03/01  18:14:09  yuan
7853  * Added new walls, switches, and triggers.
7854
7855 ------------------------------------------------------------------------
7856 main/editor/objpage.c:
7857
7858  * Revision 2.0  1995/02/27  11:34:43  john
7859  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7860  * for bitmaps.tbl.
7861  * 
7862  * Revision 1.37  1995/01/14  19:17:55  john
7863  * First version of object paging.
7864  * 
7865  * Revision 1.36  1995/01/05  16:20:13  mike
7866  * bah, remove the int3.
7867  * 
7868  * Revision 1.35  1995/01/05  12:47:13  mike
7869  * Move code about to prevent compiler warning.
7870  * 
7871  * Revision 1.34  1994/11/18  15:23:55  john
7872  * Made so the int3 for drawing an invalib object just returns.
7873  * 
7874  * Revision 1.33  1994/11/02  16:19:18  matt
7875  * Moved draw_model_picture() out of editor, and cleaned up code
7876  * 
7877  * Revision 1.32  1994/10/23  02:11:18  matt
7878  * Got rid of obsolete hostage_info stuff
7879  * 
7880  * Revision 1.31  1994/09/09  14:41:35  matt
7881  * New parms for draw_polygon_model()
7882  * 
7883  * Revision 1.30  1994/08/29  19:26:53  matt
7884  * Fixed botches change from yesterday
7885  * 
7886  * Revision 1.29  1994/08/28  23:40:35  matt
7887  * 
7888  * 
7889  * Revision 1.28  1994/08/14  23:15:32  matt
7890  * Added animating bitmap hostages, and cleaned up vclips a bit
7891  * 
7892  * Revision 1.27  1994/08/13  14:59:02  matt
7893  * Finished adding support for miscellaneous objects
7894  * 
7895  * Revision 1.26  1994/08/09  16:06:15  john
7896  * Added the ability to place players.  Made old
7897  * Player variable be ConsoleObject.
7898  * 
7899  * Revision 1.25  1994/07/28  16:59:23  mike
7900  * objects containing objects.
7901  * 
7902  * Revision 1.24  1994/06/08  18:17:25  john
7903  * Changed the way object types and id's work for hostages
7904  * and powerups.
7905  * 
7906  * Revision 1.23  1994/06/07  16:52:30  matt
7907  * Made object lighting work correctly; changed name of Ambient_light to
7908  * Dynamic_light; cleaned up polygobj object rendering a little.
7909  * 
7910  * Revision 1.22  1994/05/31  18:42:07  matt
7911  * Made robot photos unlighted
7912  * 
7913  * Revision 1.21  1994/05/26  21:09:34  matt
7914  * Moved robot stuff out of polygon model and into robot_info struct
7915  * Made new file, robot.c, to deal with robots
7916  * 
7917  * Revision 1.20  1994/05/19  12:10:11  matt
7918  * Use new vecmat macros and globals
7919  * 
7920  * Revision 1.19  1994/05/17  14:45:27  mike
7921  * Get object type and id from ObjType and ObjId.
7922  * 
7923  * Revision 1.18  1994/05/17  12:03:36  mike
7924  * Deal with little known fact that polygon object != robot.
7925  * 
7926  * Revision 1.17  1994/04/29  09:16:56  matt
7927  * Added support for multiple-piece explosions
7928  * 
7929  * Revision 1.16  1994/04/18  14:15:00  john
7930  * Initial version of robot dialog box.
7931  * 
7932  * Revision 1.15  1994/04/11  12:01:36  yuan
7933  * Fixed resetting to first object on page annoyance.
7934  * 
7935  * Revision 1.14  1994/04/01  14:35:50  yuan
7936  * Removed debug "id %d\n" for placing objects
7937  * 
7938  * Revision 1.13  1994/04/01  11:17:04  yuan
7939  * Added objects to objpage. Added buttons for easier tmap scrolling.
7940  * Objects are selected fully from objpage and add object menu or pad.
7941  * 
7942  * Revision 1.12  1994/03/25  18:42:26  matt
7943  * Adjusted constant to make robot pictures more correct size
7944  * 
7945  * Revision 1.11  1994/03/25  16:57:17  matt
7946  * New parm to draw_polygon_object(), and draw object "snapshots" in
7947  * correct size (although this probably doesn't work yet).
7948  * 
7949  * Revision 1.10  1994/03/25  14:23:01  matt
7950  * Disabled lighting when taking "snapshots" of robots
7951  * 
7952  * Revision 1.9  1994/03/17  10:47:24  john
7953  * Corrected all kinds of problems associated with N_polygon_objects.
7954  * 
7955  * Revision 1.8  1994/03/16  11:07:31  john
7956  * Made zoom work a bit better.
7957  * 
7958  * Revision 1.7  1994/03/16  10:50:32  john
7959  * fixed warning with constant length.
7960  * 
7961  * Revision 1.6  1994/03/16  10:43:18  john
7962  * Added controls to rotate/zoom object.
7963  * 
7964  * Revision 1.5  1994/03/15  22:23:24  matt
7965  * Render little bitmap pictures of robots for display on editor page
7966  * 
7967  * Revision 1.4  1994/02/01  11:27:14  john
7968  * Hacked in 8 object types for demo.
7969  * 
7970  * Revision 1.3  1994/01/26  16:42:19  john
7971  * Display numbers instead of bitmaps... made 
7972  * Num_robot_types or whatever be set to 4
7973  * in init_object_page... this is a hack!!!
7974  * 
7975  * Revision 1.2  1993/12/16  17:26:24  john
7976  * Moved texture and object selection to texpage and objpage
7977  * 
7978  * Revision 1.1  1993/12/16  16:12:57  john
7979  * Initial revision
7980
7981 ------------------------------------------------------------------------
7982 main/editor/objpage.h:
7983
7984  * Revision 2.0  1995/02/27  11:35:32  john
7985  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7986  * for bitmaps.tbl.
7987  * 
7988  * Revision 1.8  1994/11/02  16:19:20  matt
7989  * Moved draw_model_picture() out of editor, and cleaned up code
7990  * 
7991  * Revision 1.7  1994/07/28  16:59:36  mike
7992  * objects containing objects.
7993  * 
7994  * Revision 1.6  1994/05/17  14:45:48  mike
7995  * Get object type and id from ObjectType and ObjectId.
7996  * 
7997  * Revision 1.5  1994/05/17  12:03:55  mike
7998  * Deal with little known fact that polygon object != robot.
7999  * 
8000  * Revision 1.4  1994/05/14  18:00:33  matt
8001  * Got rid of externs in source (non-header) files
8002  * 
8003  * Revision 1.3  1994/04/01  11:17:06  yuan
8004  * Added objects to objpage. Added buttons for easier tmap scrolling.
8005  * Objects are selected fully from objpage and add object menu or pad.
8006  * 
8007  * Revision 1.2  1993/12/16  17:26:27  john
8008  * Moved texture and object selection to texpage and objpage
8009  * 
8010  * Revision 1.1  1993/12/16  16:13:08  john
8011  * Initial revision
8012
8013 ------------------------------------------------------------------------
8014 main/editor/segment.c:
8015
8016  * Revision 2.0  1995/02/27  11:35:21  john
8017  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8018  * for bitmaps.tbl.
8019  * 
8020  * Revision 1.191  1995/02/22  15:28:30  allender
8021  * remove anonymous unions from object structure
8022  * 
8023  * Revision 1.190  1995/02/02  02:59:40  yuan
8024  * Working on exterminating bogus matcen_nums... (harmless though)
8025  * 
8026  * Revision 1.189  1995/02/01  16:29:51  yuan
8027  * Stabilizing triggers and matcens.
8028  * 
8029  * Revision 1.188  1995/02/01  11:31:47  yuan
8030  * Trigger bug fixed.
8031  * 
8032  * Revision 1.187  1994/11/27  23:17:24  matt
8033  * Made changes for new mprintf calling convention
8034  * 
8035  * Revision 1.186  1994/11/17  14:48:12  mike
8036  * validation functions moved from editor to game.
8037  * 
8038  * Revision 1.185  1994/10/30  14:13:17  mike
8039  * rip out local segment stuff.
8040  * 
8041  * Revision 1.184  1994/10/27  10:04:24  matt
8042  * When triangulating, don't use WID() to see if connected, look at children
8043  * 
8044  * Revision 1.183  1994/10/26  13:40:23  mike
8045  * debug code for matt.
8046  * 
8047  * Revision 1.182  1994/10/24  16:34:00  mike
8048  * Force render after mine compress to prevent bugs in segment selection via clicking in 3d window.
8049  * 
8050  * Revision 1.181  1994/10/20  18:16:15  mike
8051  * Initialize ControlCenterTriggers.num_links in create_new_mine.
8052  * 
8053  * Revision 1.180  1994/10/18  16:29:14  mike
8054  * Write function to automatically fix bogus segnums in segment array.
8055  * 
8056  * Revision 1.179  1994/10/08  17:10:41  matt
8057  * Correctly set current_level_num when loading/creating mine in editor
8058  * 
8059  * Revision 1.178  1994/09/25  14:17:51  mike
8060  * Initialize (to 0) Num_robot_centers and Num_open_doors at mine creation.
8061  * 
8062  * Revision 1.177  1994/09/20  14:36:06  mike
8063  * Write function to find overlapping segments.
8064  * 
8065  * Revision 1.176  1994/08/25  21:55:57  mike
8066  * IS_CHILD stuff.
8067  * 
8068  * Revision 1.175  1994/08/23  15:28:03  mike
8069  * Fix peculiarity in med_combine_duplicate_vertices.
8070  * 
8071  * Revision 1.174  1994/08/09  16:06:17  john
8072  * Added the ability to place players.  Made old
8073  * Player variable be ConsoleObject.
8074  * 
8075  * Revision 1.173  1994/08/05  21:18:10  matt
8076  * Allow two doors to be linked together
8077  * 
8078  * Revision 1.172  1994/08/04  19:13:16  matt
8079  * Changed a bunch of vecmat calls to use multiple-function routines, and to
8080  * allow the use of C macros for some functions
8081  * 
8082  * Revision 1.171  1994/07/22  12:37:00  matt
8083  * Cleaned up editor/game interactions some more.
8084  * 
8085  * Revision 1.170  1994/07/22  11:20:08  mike
8086  * Set Lsegments validity.
8087  * 
8088  * Revision 1.169  1994/07/21  19:02:49  mike
8089  * lsegment stuff.
8090  * 
8091  * Revision 1.168  1994/07/21  13:27:17  matt
8092  * Ripped out remants of old demo system, and added demo
8093  * disables object movement and game options from menu.
8094  * 
8095  * Revision 1.167  1994/07/19  20:15:48  matt
8096  * Name for each level now saved in the .SAV file & stored in Current_level_name
8097  * 
8098  * Revision 1.166  1994/07/06  12:42:45  john
8099  * Made generic messages for hostages.
8100  * 
8101  * Revision 1.165  1994/06/24  17:04:29  john
8102  * *** empty log message ***
8103  * 
8104  * Revision 1.164  1994/06/15  15:42:40  mike
8105  * Initialize static_light field in new segments.
8106  * 
8107  * Revision 1.163  1994/06/13  17:49:19  mike
8108  * Fix bug in med_validate_side which was toasting lighting for removable walls.
8109  * 
8110  * Revision 1.162  1994/06/13  10:52:20  mike
8111  * Fix bug in triangulation of sides between connected segments.
8112  * Was assigning SIDE_IS_02 regardless of how triangulated, was
8113  * causing physics bugs.
8114  * 
8115  * Revision 1.161  1994/06/08  18:14:16  mike
8116  * Fix triangulation of sides in hallways (ie, where there is no wall),
8117  * so they get triangulated the same way, so find_new_seg doesn't get
8118  * stuck in an infinite recursion.
8119  * 
8120  * Revision 1.160  1994/06/08  11:44:31  mike
8121  * Fix bug in normals not being opposite on opposite sides of a segment.
8122  * Problem occurred due to difference in handling of remainder in signed divide.
8123  * 
8124  * Revision 1.159  1994/05/31  19:00:15  yuan
8125  * Fixed gamestate restore.
8126  * 
8127  * Revision 1.158  1994/05/30  20:22:36  yuan
8128  * New triggers.
8129  * 
8130  * Revision 1.157  1994/05/26  19:32:51  mike
8131  * Add bfs_parse.
8132  * 
8133  * Revision 1.156  1994/05/23  14:56:46  mike
8134  * make current segment be add segment.,
8135
8136 ------------------------------------------------------------------------
8137 main/editor/seguvs.c:
8138
8139  * Revision 2.1  1995/05/08  10:49:34  mike
8140  * fix lighting bug: oblong segments could be very dark.
8141  * 
8142  * Revision 2.0  1995/02/27  11:36:37  john
8143  * Version 2.0. Ansi-fied.
8144  * 
8145  * Revision 1.84  1994/11/27  23:17:18  matt
8146  * Made changes for new mprintf calling convention
8147  * 
8148  * Revision 1.83  1994/11/17  14:48:02  mike
8149  * validation functions moved from editor to game.
8150  * 
8151  * Revision 1.82  1994/10/15  19:08:26  mike
8152  * Disable exhaustive search mprintfs in find_point_seg during lighting.
8153  * 
8154  * Revision 1.81  1994/08/25  21:55:50  mike
8155  * IS_CHILD stuff.
8156  * 
8157  * Revision 1.80  1994/08/04  19:13:22  matt
8158  * Changed a bunch of vecmat calls to use multiple-function routines, and to
8159  * allow the use of C macros for some functions
8160  * 
8161  * Revision 1.79  1994/08/03  10:31:33  mike
8162  * Texture map propagation without uv assignment.
8163  * 
8164  * Revision 1.78  1994/08/01  13:31:12  matt
8165  * Made fvi() check holes in transparent walls, and changed fvi() calling
8166  * parms to take all input data in query structure.
8167  * 
8168  * Revision 1.77  1994/07/08  14:31:24  matt
8169  * New parms for FVI
8170  * 
8171  * Revision 1.76  1994/06/23  14:01:04  mike
8172  * Fix cache bug which caused some vertices to not get light, mainly
8173  * noticeable at joints which had doors.
8174  * 
8175  * Revision 1.75  1994/06/22  17:33:11  mike
8176  * Make position of light (which is always towards center of segment from
8177  * actual light panel) constant, not dependent on segment size, which fixes
8178  * bug of dark light panels in very large segments.
8179  * 
8180  * Revision 1.74  1994/06/21  18:58:18  mike
8181  * Fix stupid bug in light propagation, was using wrong vector in fvi caching.
8182  * 
8183  * Revision 1.73  1994/06/20  11:20:24  mike
8184  * Fix stupid lighting bug introduced when I went to cached fvi results.
8185  * 
8186  * Revision 1.72  1994/06/19  16:26:37  mike
8187  * Speed up lighting by storing and hashing fvi results.
8188  * 
8189  * Revision 1.71  1994/06/17  16:05:56  mike
8190  * Support optional quick lighting propagation: no find_vector_intersection.
8191  * 
8192  * Revision 1.70  1994/06/15  15:42:30  mike
8193  * Propagate static_light.
8194  * 
8195  * Revision 1.69  1994/06/14  16:59:37  mike
8196  * Fix references to tmap_num2, must strip off orientation bits.
8197  * 
8198  * Revision 1.68  1994/06/09  09:58:58  matt
8199  * Moved find_vector_intersection() from physics.c to new file fvi.c
8200  * 
8201  * 
8202  * Revision 1.67  1994/06/08  18:14:02  mike
8203  * mprintf a dot in light casting.
8204  * 
8205  * Revision 1.66  1994/06/08  14:37:45  mike
8206  * double static light value in going from value (a short) to static_light (a fix).
8207  * 
8208  * Revision 1.65  1994/06/08  14:29:44  matt
8209  * Added static_light field to segment structure, and padded side struct
8210  * to be longword aligned.
8211  * 
8212  * Revision 1.64  1994/06/08  11:45:24  mike
8213  * New, supercool, superslow lighting function.
8214  * 
8215  * Revision 1.63  1994/06/07  09:38:11  mike
8216  * Make lighting function yet better by calling find_vector_intersection.
8217  * 
8218  * Revision 1.62  1994/06/06  13:14:33  mike
8219  * Make illusory walls cast light.
8220  * 
8221  * Revision 1.61  1994/06/05  20:39:47  mike
8222  * Add new distance and dot product based lighting function.
8223  * 
8224  * Revision 1.60  1994/05/31  12:31:18  mike
8225  * fix bugs in lighting, though it's not perfect, will be changing all
8226  * lighting to be distance based.  Bug had to do with not handling one
8227  * of the return values from WALL_IS_DOORWAY, so assuming light couldn't
8228  * be recursively propagated almost all the time.
8229  * 
8230  * Revision 1.59  1994/05/19  23:35:26  mike
8231  * Support uv coordinates in range 0..1.0.
8232  * 
8233  * Revision 1.58  1994/05/19  12:10:21  matt
8234  * Use new vecmat macros and globals
8235  * 
8236  * Revision 1.57  1994/05/04  19:15:53  mike
8237  * Error checking for degenerate segments.
8238  * 
8239  * Revision 1.56  1994/05/03  11:02:34  mike
8240  * Change how default texture map assignment works; now pixels are constant size.
8241  * 
8242  * Revision 1.55  1994/04/28  23:25:26  yuan
8243  * Obliterated warnings.
8244
8245 ------------------------------------------------------------------------
8246 main/editor/seguvs.h:
8247
8248  * Revision 2.0  1995/02/27  11:34:58  john
8249  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8250  * for bitmaps.tbl.
8251  * 
8252  * Revision 1.3  1994/08/03  10:32:28  mike
8253  * Add stretch_uvs_from_curedge.
8254  * 
8255  * Revision 1.2  1994/05/14  18:00:58  matt
8256  * Got rid of externs in source (non-header) files
8257  * 
8258  * Revision 1.1  1994/05/14  17:27:26  matt
8259  * Initial revision
8260
8261 ------------------------------------------------------------------------
8262 main/editor/texpage.c:
8263
8264  * Revision 2.0  1995/02/27  11:34:51  john
8265  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8266  * for bitmaps.tbl.
8267  * 
8268  * Revision 1.14  1995/01/14  19:18:02  john
8269  * First version of object paging.
8270  * 
8271  * Revision 1.13  1994/11/27  23:17:15  matt
8272  * Made changes for new mprintf calling convention
8273  * 
8274  * Revision 1.12  1994/11/23  15:49:00  mike
8275  * fix bug in tmapnum == 0 always getting reassigned.
8276  * 
8277  * Revision 1.11  1994/11/23  12:17:34  mike
8278  * changing texture maps in all mines.
8279  * 
8280  * Revision 1.10  1994/11/19  00:04:42  john
8281  * Changed some shorts to ints.
8282  * 
8283  * Revision 1.9  1994/11/16  17:59:36  john
8284  * Fixed bug with writing to canvas before initing it.
8285  * 
8286  * Revision 1.8  1994/11/16  13:15:21  matt
8287  * Fixed grab bug, and cleaned up code
8288  * 
8289  * Revision 1.7  1994/08/05  12:26:37  matt
8290  * Fixed overplot problem with texture names
8291  * 
8292  * Revision 1.6  1994/04/11  12:01:58  yuan
8293  * Fixed resetting to first texture on page annoyance.
8294  * 
8295  * Revision 1.5  1994/04/01  11:15:53  yuan
8296  * Added objects to objpage. Added buttons for easier tmap scrolling.
8297  * Objects are selected fully from objpage and add object menu or pad.
8298  * 
8299  * Revision 1.4  1994/03/15  16:33:37  yuan
8300  * Fixed bm loader (might have some changes in walls and switches)
8301  * 
8302  * Revision 1.3  1993/12/16  17:25:46  john
8303  * Moved texture and object selection to texpage and objpage
8304  * 
8305  * Revision 1.2  1993/12/16  15:57:39  john
8306  * moved texture selection stuff to texpage.c
8307  * 
8308  * Revision 1.1  1993/12/16  15:06:56  john
8309  * Initial revision
8310
8311 ------------------------------------------------------------------------
8312 main/editor/texture.c:
8313
8314  * Revision 2.0  1995/02/27  11:34:50  john
8315  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8316  * for bitmaps.tbl.
8317  * 
8318  * Revision 1.13  1994/08/04  19:13:15  matt
8319  * Changed a bunch of vecmat calls to use multiple-function routines, and to
8320  * allow the use of C macros for some functions
8321  * 
8322  * Revision 1.12  1994/08/03  10:31:56  mike
8323  * Texture map propagation without uv assignment.
8324  * 
8325  * Revision 1.11  1994/07/14  19:36:34  yuan
8326  * Tuning texture slides.
8327  * 
8328  * Revision 1.10  1994/07/14  19:29:08  yuan
8329  * Fixed sliding.
8330  * 
8331  * Revision 1.9  1994/07/14  14:43:06  yuan
8332  * Added 3x rotation.
8333  * 
8334  * Revision 1.8  1994/07/14  11:12:42  yuan
8335  * Made sliding 3x more sensitive
8336  * 
8337  * Revision 1.7  1994/07/14  10:49:56  yuan
8338  * Made texture rotation 3x finer
8339  * 
8340  * Revision 1.6  1994/02/14  12:06:00  mike
8341  * change segment data structure.
8342  * 
8343  * Revision 1.5  1993/12/06  13:26:52  mike
8344  * Make rotation and sliding work for triangulated sides.
8345  * 
8346  * Revision 1.4  1993/12/04  17:18:46  mike
8347  * Add tiling functions, set_default.
8348  * 
8349  * Revision 1.3  1993/12/03  18:39:12  unknown
8350  * Add texture map sliding, allow to work on triangulated sides.
8351  * 
8352  * Revision 1.2  1993/11/30  17:06:09  mike
8353  * Texture map functions.
8354  * 
8355  * Revision 1.1  1993/11/29  16:00:57  mike
8356  * Initial revision
8357
8358 ------------------------------------------------------------------------
8359 main/effects.c:
8360
8361  * Revision 1.1  1995/05/16  15:24:25  allender
8362  * Initial revision
8363  *
8364  * Revision 2.0  1995/02/27  11:32:49  john
8365  * New version 2.0, which has no anonymous unions, builds with
8366  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8367  *
8368  * Revision 1.21  1995/02/13  20:35:06  john
8369  * Lintized
8370  *
8371  * Revision 1.20  1994/12/10  16:44:50  matt
8372  * Added debugging code to track down door that turns into rock
8373  *
8374  * Revision 1.19  1994/12/06  16:27:14  matt
8375  * Fixed horrible bug that was referencing segment -1
8376  *
8377  * Revision 1.18  1994/12/02  23:20:51  matt
8378  * Reset bitmaps possibly changed by crit clips
8379  *
8380  * Revision 1.17  1994/11/14  14:00:19  matt
8381  * Fixed stupid bug
8382  *
8383  * Revision 1.16  1994/11/14  12:42:43  matt
8384  * Allow holes in effects list
8385  *
8386  * Revision 1.15  1994/11/08  21:11:52  matt
8387  * Added functions to stop & start effects
8388  *
8389  * Revision 1.14  1994/10/04  18:59:08  matt
8390  * Exploding eclips now play eclip while exploding, then switch to static bm
8391  *
8392  * Revision 1.13  1994/10/04  15:17:42  matt
8393  * Took out references to unused constant
8394  *
8395  * Revision 1.12  1994/09/29  11:00:01  matt
8396  * Made eclips (wall animations) not frame-rate dependent (for now)
8397  *
8398  * Revision 1.11  1994/09/25  00:40:24  matt
8399  * Added the ability to make eclips (monitors, fans) which can be blown up
8400  *
8401  * Revision 1.10  1994/08/14  23:15:14  matt
8402  * Added animating bitmap hostages, and cleaned up vclips a bit
8403  *
8404  * Revision 1.9  1994/08/05  15:56:04  matt
8405  * Cleaned up effects system, and added alternate effects for after mine
8406  * destruction.
8407  *
8408  * Revision 1.8  1994/08/01  23:17:21  matt
8409  * Add support for animating textures on robots
8410  *
8411  * Revision 1.7  1994/05/23  15:10:46  yuan
8412  * Make Eclips read directly...
8413  * No more need for $EFFECTS list.
8414  *
8415  * Revision 1.6  1994/04/06  14:42:44  yuan
8416  * Adding new powerups.
8417  *
8418  * Revision 1.5  1994/03/15  16:31:54  yuan
8419  * Cleaned up bm-loading code.
8420  * (And structures)
8421  *
8422  * Revision 1.4  1994/03/04  17:09:09  yuan
8423  * New door stuff.
8424  *
8425  * Revision 1.3  1994/01/11  11:18:50  yuan
8426  * Fixed frame_count
8427  *
8428  * Revision 1.2  1994/01/11  10:38:55  yuan
8429  * Special effects new implementation
8430  *
8431  * Revision 1.1  1994/01/10  09:45:29  yuan
8432  * Initial revision
8433
8434 ------------------------------------------------------------------------
8435 main/effects.h:
8436
8437  * Revision 1.1  1995/05/16  15:56:08  allender
8438  * Initial revision
8439  *
8440  * Revision 2.0  1995/02/27  11:27:34  john
8441  * New version 2.0, which has no anonymous unions, builds with
8442  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8443  *
8444  * Revision 1.15  1994/11/08  21:12:07  matt
8445  * Added functions to stop & start effects
8446  *
8447  * Revision 1.14  1994/10/13  17:14:11  adam
8448  * MAX_EFFECTS to 60 (ugh)
8449  *
8450  * Revision 1.13  1994/10/05  10:14:34  adam
8451  * MAX_EFFECTS to 50
8452  *
8453  * Revision 1.12  1994/10/04  18:59:09  matt
8454  * Exploding eclips now play eclip while exploding, then switch to static bm
8455  *
8456  * Revision 1.11  1994/10/04  15:17:52  matt
8457  * Took out references to unused constant
8458  *
8459  * Revision 1.10  1994/09/29  14:15:00  matt
8460  * Added sounds for eclips (wall effects)
8461  *
8462  * Revision 1.9  1994/09/25  00:40:24  matt
8463  * Added the ability to make eclips (monitors, fans) which can be blown up
8464  *
8465  * Revision 1.8  1994/08/05  15:55:25  matt
8466  * Cleaned up effects system, and added alternate effects for after mine
8467  * destruction.
8468  *
8469  * Revision 1.7  1994/08/01  23:17:20  matt
8470  * Add support for animating textures on robots
8471  *
8472  * Revision 1.6  1994/05/19  18:13:18  yuan
8473  * MAX_EFFECTS increased to 30
8474  *
8475  * Revision 1.5  1994/03/15  16:32:37  yuan
8476  * Cleaned up bm-loading code.
8477  * (Fixed structures too)
8478  *
8479  * Revision 1.4  1994/03/04  17:09:07  yuan
8480  * New door stuff.
8481  *
8482  * Revision 1.3  1994/01/19  18:22:45  yuan
8483  * Changed number of effects from 10-20
8484  *
8485  * Revision 1.2  1994/01/11  10:39:07  yuan
8486  * Special effects new implementation
8487  *
8488  * Revision 1.1  1994/01/10  10:36:14  yuan
8489  * Initial revision
8490
8491 ------------------------------------------------------------------------
8492 main/endlevel.c:
8493
8494  * Revision 1.5  1995/10/31  10:24:09  allender
8495  * shareware stuff
8496  *
8497  * Revision 1.4  1995/09/14  16:33:54  allender
8498  * fixed function return values for those that didn't
8499  * have them...thanks matt!
8500  *
8501  * Revision 1.3  1995/07/28  15:36:26  allender
8502  * reverse inverse sqrt change
8503  *
8504  * Revision 1.2  1995/07/28  15:17:40  allender
8505  * inverse magnitude fixup
8506  *
8507  * Revision 1.1  1995/05/16  15:24:32  allender
8508  * Initial revision
8509  *
8510  * Revision 2.2  1995/03/21  14:40:14  john
8511  * Ifdef'd out the NETWORK code.
8512  *
8513  * Revision 2.1  1995/03/20  18:15:50  john
8514  * Added code to not store the normals in the segment structure.
8515  *
8516  * Revision 2.0  1995/02/27  11:30:42  john
8517  * New version 2.0, which has no anonymous unions, builds with
8518  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8519  *
8520  * Revision 1.80  1995/02/22  13:24:45  john
8521  * Removed the vecmat anonymous unions.
8522  *
8523  * Revision 1.79  1995/02/11  12:41:54  john
8524  * Added new song method, with FM bank switching..
8525  *
8526  * Revision 1.78  1995/02/08  11:37:41  mike
8527  * Check for failures in call to obj_create.
8528  *
8529  * Revision 1.77  1995/02/05  22:09:49  matt
8530  * Switch out of rear view when starting endlevel sequence
8531  *
8532  * Revision 1.76  1995/01/30  18:08:28  rob
8533  * Add palette fade out before ending level on special missions.
8534  *
8535  * Revision 1.75  1995/01/29  16:19:19  rob
8536  * Fixed endlevel for custom missions.
8537  *
8538  * Revision 1.74  1995/01/26  12:18:10  rob
8539  * Changed calling convention of network_do_frame.
8540  *
8541  * Revision 1.73  1995/01/21  16:50:03  matt
8542  * Made endlevel work with new mission stuff
8543  *
8544  * Revision 1.72  1994/12/20  18:22:51  john
8545  * Added code to support non-looping songs, and put
8546  * it in for endlevel and credits.
8547  *
8548  * Revision 1.71  1994/12/15  12:23:58  matt
8549  * Added check for failure to create camera object
8550  *
8551  * Revision 1.70  1994/12/15  03:05:28  matt
8552  * Added error checking for NULL return from object_create_explosion()
8553  *
8554  * Revision 1.69  1994/12/12  21:41:38  matt
8555  * Don't start endlevel if OF_SHOULD_BE_DEAD is set for player
8556  *
8557  * Revision 1.68  1994/12/12  15:44:54  rob
8558  * Rolled back a change to endlevel_start that caused more bugs than
8559  * it fixed.
8560  *
8561  * Revision 1.67  1994/12/12  12:08:33  rob
8562  * IF a player is dead upon entering the tunnel, make them not dead.  Not perfect solution
8563  * but avoids some last-minute weirdness we want to fix.  This should be revisited in new
8564  * versions if possible!
8565  *
8566  * Revision 1.66  1994/12/11  22:02:13  allender
8567  * made endlevel data loading work with .txb encoded format (made with
8568  * compbit -i level0?.end -o level0?.txb)
8569  *
8570  * Revision 1.65  1994/12/11  20:32:47  matt
8571  * Made camera transition happen 1/3 of the way through exit tunnel
8572  *
8573  * Revision 1.64  1994/12/08  20:56:27  john
8574  * More cfile stuff.
8575  *
8576  * Revision 1.63  1994/12/07  17:00:52  rob
8577  * Trying to fix homing tone warning when in exit tunnel.
8578  *
8579  * Revision 1.62  1994/12/06  13:24:47  matt
8580  * Made exit model come out of bitmaps.tbl
8581  *
8582  * Revision 1.61  1994/12/06  12:06:22  matt
8583  * Fixed/cleaned up satellite (planet/sun) code
8584  *
8585  * Revision 1.60  1994/12/05  13:37:12  adam
8586  * removed slew-mode
8587  *
8588  * Revision 1.59  1994/12/05  12:49:37  matt
8589  * Made satellite a rod (instead of a plane old non-rotating bitmap), and
8590  * made the size settable in the .end file
8591  *
8592  * Revision 1.58  1994/12/04  21:40:00  matt
8593  * Added explosion sounds
8594  *
8595  * Revision 1.57  1994/12/04  18:31:41  matt
8596  * Wasn't coding planet position, causing it to disappear sometimes
8597  *
8598  * Revision 1.56  1994/12/04  14:30:26  john
8599  * Added hooks for music..
8600  *
8601  * Revision 1.55  1994/12/04  13:53:52  matt
8602  * Added code to make camera off-centered during lookback
8603  *
8604  * Revision 1.54  1994/12/04  12:30:18  matt
8605  * Fixed slew for short sequence
8606  *
8607  * Revision 1.53  1994/12/03  19:28:10  matt
8608  * Added alternate model for exit model after mine destruction
8609  *
8610  * Revision 1.52  1994/12/03  00:17:23  matt
8611  * Made endlevel sequence cut off early
8612  * Made exit model and bit explosion always plot last (after all terrain)
8613  *
8614  * Revision 1.51  1994/12/01  20:15:43  yuan
8615  * Localization.
8616  *
8617  * Revision 1.50  1994/11/30  23:27:35  adam
8618  * mucked around carelessly
8619  *
8620  * Revision 1.49  1994/11/28  21:50:37  mike
8621  * optimizations.
8622  *
8623  * Revision 1.48  1994/11/28  00:12:05  allender
8624  * took out demo code that was in at one time to record endlevel sequence.
8625  * We are _not_ recording endlevel sequence
8626  *
8627  * Revision 1.47  1994/11/27  23:35:54  allender
8628  * pause demo recording when starting endlevel sequence.  on demo playback,
8629  * don't do endlevel at all.
8630  *
8631  * Revision 1.46  1994/11/27  23:13:59  matt
8632  * Made changes for new mprintf calling convention
8633  *
8634  * Revision 1.45  1994/11/26  23:17:29  matt
8635  * When camera leaves mine, bank it so it's level with the ground
8636  *
8637  * Revision 1.44  1994/11/23  16:52:13  rob
8638  * Ended netgame endlevel sequence a bit earlier.
8639  *
8640  * Revision 1.43  1994/11/22  19:20:46  rob
8641  * Modem support for secret levels.
8642  *
8643  * Revision 1.42  1994/11/22  12:11:03  rob
8644  * Fixed bug - file handle left open in load_endlevel_data.
8645  *
8646  * Revision 1.41  1994/11/21  17:29:22  matt
8647  * Cleaned up sequencing & game saving for secret levels
8648  *
8649  * Revision 1.40  1994/11/19  15:14:54  mike
8650  * remove unused code and data
8651  *
8652  * Revision 1.39  1994/11/19  12:41:32  matt
8653  * Added system to read endlevel data from file, and to make it work
8654  * with any exit tunnel.
8655  *
8656  * Revision 1.38  1994/11/17  15:02:24  mike
8657  * support new segment validation functions.
8658  *
8659  * Revision 1.37  1994/11/17  13:04:45  allender
8660  * backout out newdemo changes
8661  *
8662  * Revision 1.35  1994/11/16  14:52:33  rob
8663  * Commented out SLEW_ON on Matt's direction.
8664  * Changed something to fix demo recording.
8665  *
8666  * Revision 1.34  1994/11/16  11:49:29  matt
8667  * Added code to rotate terrain to match mine
8668  *
8669  * Revision 1.33  1994/11/14  17:54:54  allender
8670  * on exit sequence during demo recording, force player exited from mine
8671  * packet to all other network players
8672  *
8673  * Revision 1.32  1994/11/10  21:27:42  matt
8674  * Took out printf's
8675  *
8676  * Revision 1.31  1994/11/10  14:02:24  matt
8677  * Hacked in support for player ships with different textures
8678  *
8679  * Revision 1.30  1994/11/09  10:31:33  matt
8680  * Don't create explosions if can't find seg to create them in
8681  *
8682  * Revision 1.29  1994/11/05  17:22:37  john
8683  * Fixed lots of sequencing problems with newdemo stuff.
8684  *
8685  * Revision 1.28  1994/11/03  11:10:39  matt
8686  * Fixed chase angles code
8687  * Maybe other things, too.
8688  *
8689  * Revision 1.27  1994/10/30  20:09:21  matt
8690  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
8691  * go out; made more explosions on walls.
8692  *
8693  * Revision 1.26  1994/10/28  16:37:50  allender
8694  * stop demo recording when endlevel sequence activated
8695  *
8696  * Revision 1.25  1994/10/27  21:15:21  matt
8697  * Added explosions in mine chasing player
8698  *
8699  * Revision 1.24  1994/10/27  01:03:57  matt
8700  * Fixed several small bugs in flythrough
8701  *
8702  * Revision 1.23  1994/10/22  01:32:30  matt
8703  * Don't start endlevel sequence if player dead
8704  *
8705  * Revision 1.22  1994/10/22  00:08:06  matt
8706  * Fixed up problems with bonus & game sequencing
8707  * Player doesn't get credit for hostages unless he gets them out alive
8708
8709 ------------------------------------------------------------------------
8710 main/endlevel.h:
8711
8712  * Revision 1.2  1995/09/14  16:36:34  allender
8713  * fixed function prototype for those functions that didn't
8714  * have them...thanks matt
8715  *
8716  * Revision 1.1  1995/05/16  15:56:16  allender
8717  * Initial revision
8718  *
8719  * Revision 2.0  1995/02/27  11:31:37  john
8720  * New version 2.0, which has no anonymous unions, builds with
8721  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8722  *
8723  * Revision 1.5  1994/12/06  13:24:55  matt
8724  * Made exit model come out of bitmaps.tbl
8725  *
8726  * Revision 1.4  1994/11/19  12:41:35  matt
8727  * Added system to read endlevel data from file, and to make it work
8728  * with any exit tunnel.
8729  *
8730  * Revision 1.3  1994/10/30  20:09:20  matt
8731  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
8732  * go out; made more explosions on walls.
8733  *
8734  * Revision 1.2  1994/08/19  20:09:38  matt
8735  * Added end-of-level cut scene with external scene
8736  *
8737  * Revision 1.1  1994/08/15  19:18:47  matt
8738  * Initial revision
8739
8740 ------------------------------------------------------------------------
8741 main/escort.c:
8742
8743  * Revision 1.1  1995/05/06  23:32:19  mike
8744  * Initial revision
8745
8746 ------------------------------------------------------------------------
8747 main/fireball.c:
8748
8749  * Revision 1.2  1995/10/31  10:23:56  allender
8750  * shareware stuff
8751  *
8752  * Revision 1.1  1995/05/16  15:24:41  allender
8753  * Initial revision
8754  *
8755  * Revision 2.2  1995/03/21  14:39:57  john
8756  * Ifdef'd out the NETWORK code.
8757  *
8758  * Revision 2.1  1995/03/20  18:15:47  john
8759  * Added code to not store the normals in the segment structure.
8760  *
8761  * Revision 2.0  1995/02/27  11:30:34  john
8762  * New version 2.0, which has no anonymous unions, builds with
8763  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8764  *
8765  * Revision 1.200  1995/02/22  13:18:41  allender
8766  * remove anonymous unions from object structure
8767  *
8768  * Revision 1.199  1995/02/14  19:58:32  mike
8769  * comment out "something bad has happened" int3.
8770  *
8771  * Revision 1.198  1995/02/09  13:11:01  mike
8772  * remove an annoying mprintf and Int3().
8773  *
8774  * Revision 1.197  1995/02/08  17:10:14  mike
8775  * don't drop cloaks if one nearby.
8776  *
8777  * Revision 1.196  1995/02/08  13:27:14  rob
8778  * Give keys dropped by robots 0 velocity in coop game.
8779  *
8780  * Revision 1.195  1995/02/08  11:57:40  mike
8781  * determine whether debris object failed to create because buffer was
8782  * exhausted or because limit was hit.
8783  *
8784  * Revision 1.194  1995/02/08  11:37:58  mike
8785  * Check for failures in call to obj_create.
8786  *
8787  * Revision 1.193  1995/02/07  21:09:41  mike
8788  * only replace weapon with energy 1/2 time.
8789  *
8790  * Revision 1.192  1995/01/30  18:21:52  rob
8791  * Replace extra life powerups in multiplayer to invul when
8792  * dropped by robots.
8793  *
8794  * Revision 1.191  1995/01/28  17:40:59  mike
8795  * fix stupidity in converting quad lasers to energy.
8796  *
8797  * Revision 1.190  1995/01/27  15:05:59  rob
8798  * Trying to fix a bug with damaging robots with player badass explosions.
8799  *
8800  * Revision 1.189  1995/01/26  18:59:04  rob
8801  * Powerups were flying too far in robot-cooperative games.
8802  *
8803  * Revision 1.188  1995/01/25  10:53:35  mike
8804  * make badass damage go through grates.
8805  *
8806  * Revision 1.187  1995/01/25  09:37:23  mike
8807  * fix objects containing robots, worked for powerups, bad {} placement.
8808  *
8809  * Revision 1.186  1995/01/23  22:51:20  mike
8810  * drop energy instead of primary weapon if you already have primary weapon.
8811  *
8812  * Revision 1.185  1995/01/20  16:56:37  mike
8813  * Cut damage done by badass weapons.
8814  *
8815  * Revision 1.184  1995/01/19  17:44:57  mike
8816  * damage_force removed, that information coming from strength field.
8817  *
8818  * Revision 1.183  1995/01/16  21:06:54  mike
8819  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
8820  *
8821  * Revision 1.182  1995/01/16  19:24:04  mike
8822  * If a gated-in robot and going to drop energy powerup, don't!
8823  *
8824  * Revision 1.181  1995/01/15  20:48:03  mike
8825  * drop energy in place of quad lasers if player already has quad lasers.
8826  *
8827  * Revision 1.180  1995/01/14  19:32:19  rob
8828  * Fixed an error.
8829  *
8830  * Revision 1.179  1995/01/14  18:50:55  rob
8831  * Make robot egg creation suitable for mutliplayer situations.
8832  *
8833  * Revision 1.178  1995/01/14  14:55:07  rob
8834  * Make weapons/keys/etc never disappear in network mode.
8835
8836 ------------------------------------------------------------------------
8837 main/fireball.h:
8838
8839  * Revision 1.1  1995/05/16  15:56:23  allender
8840  * Initial revision
8841  *
8842  * Revision 2.0  1995/02/27  11:27:03  john
8843  * New version 2.0, which has no anonymous unions, builds with
8844  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8845  *
8846  * Revision 1.13  1995/01/17  12:14:38  john
8847  * Made walls, object explosion vclips load at level start.
8848  *
8849  * Revision 1.12  1995/01/13  15:41:52  rob
8850  * Added prototype for maybe_replace_powerup_with_energy
8851  *
8852  * Revision 1.11  1994/11/17  16:28:36  rob
8853  * Changed maybe_drop_cloak_powerup to maybe_drop_net_powerup (more
8854  * generic and useful)
8855  *
8856  * Revision 1.10  1994/10/12  08:03:42  mike
8857  * Prototype maybe_drop_cloak_powerup.
8858  *
8859  * Revision 1.9  1994/10/11  12:24:39  matt
8860  * Cleaned up/change badass explosion calls
8861  *
8862  * Revision 1.8  1994/09/07  16:00:34  mike
8863  * Add object pointer to parameter list of object_create_badass_explosion.
8864  *
8865  * Revision 1.7  1994/09/02  14:00:39  matt
8866  * Simplified explode_object() & mutliple-stage explosions
8867  *
8868  * Revision 1.6  1994/08/17  16:49:58  john
8869  * Added damaging fireballs, missiles.
8870  *
8871  * Revision 1.5  1994/07/14  22:39:19  matt
8872  * Added exploding doors
8873  *
8874  * Revision 1.4  1994/06/08  10:56:36  matt
8875  * Improved debris: now get submodel size from new POF files; debris now has
8876  * limited life; debris can now be blown up.
8877  *
8878  * Revision 1.3  1994/04/01  13:35:44  matt
8879  * Added multiple-stage explosions
8880  *
8881  * Revision 1.2  1994/02/17  11:33:32  matt
8882  * Changes in object system
8883  *
8884  * Revision 1.1  1994/02/16  22:41:15  matt
8885  * Initial revision
8886
8887 ------------------------------------------------------------------------
8888 main/fuelcen.c:
8889
8890  * Revision 1.2  1995/10/31  10:23:40  allender
8891  * shareware stuff
8892  *
8893  * Revision 1.1  1995/05/16  15:24:50  allender
8894  * Initial revision
8895  *
8896  * Revision 2.3  1995/03/21  14:38:40  john
8897  * Ifdef'd out the NETWORK code.
8898  *
8899  * Revision 2.2  1995/03/06  15:23:09  john
8900  * New screen techniques.
8901  *
8902  * Revision 2.1  1995/02/27  13:13:26  john
8903  * Removed floating point.
8904  *
8905  * Revision 2.0  1995/02/27  11:27:20  john
8906  * New version 2.0, which has no anonymous unions, builds with
8907  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8908  *
8909  * Revision 1.159  1995/02/22  13:48:10  allender
8910  * remove anonymous unions in object structure
8911  *
8912  * Revision 1.158  1995/02/08  11:37:48  mike
8913  * Check for failures in call to obj_create.
8914  *
8915  * Revision 1.157  1995/02/07  20:39:39  mike
8916  * fix toasters in multiplayer
8917  *
8918  *
8919  * Revision 1.156  1995/02/02  18:40:10  john
8920  * Fixed bug with full screen cockpit flashing non-white.
8921  *
8922  * Revision 1.155  1995/01/28  15:27:22  yuan
8923  * Make sure fuelcen nums are valid.
8924  *
8925  * Revision 1.154  1995/01/03  14:26:23  rob
8926  * Better ifdef for robot centers.
8927  *
8928  * Revision 1.153  1995/01/03  11:27:49  rob
8929  * Added include of fuelcen.c
8930  *
8931  * Revision 1.152  1995/01/03  09:47:22  john
8932  * Some ifdef SHAREWARE lines.
8933  *
8934  * Revision 1.151  1995/01/02  21:02:07  rob
8935  * added matcen support for coop/multirobot.
8936  *
8937  * Revision 1.150  1994/12/15  18:31:22  mike
8938  * fix confusing precedence problems.
8939  *
8940  * Revision 1.149  1994/12/15  13:04:22  mike
8941  * Replace Players[Player_num].time_total references with GameTime.
8942  *
8943  * Revision 1.148  1994/12/15  03:05:18  matt
8944  * Added error checking for NULL return from object_create_explosion()
8945  *
8946  * Revision 1.147  1994/12/13  19:49:12  rob
8947  * Made the fuelcen noise quieter.
8948  *
8949  * Revision 1.146  1994/12/13  12:03:18  john
8950  * Made the warning sirens not start until after "desccruction
8951  * secquence activated voice".
8952  *
8953  * Revision 1.145  1994/12/12  17:18:30  mike
8954  * make warning siren louder.
8955  *
8956  * Revision 1.144  1994/12/11  23:18:04  john
8957  * Added -nomusic.
8958  * Added RealFrameTime.
8959  * Put in a pause when sound initialization error.
8960  * Made controlcen countdown and framerate use RealFrameTime.
8961  *
8962  * Revision 1.143  1994/12/11  14:10:16  mike
8963  * louder sounds.
8964  *
8965  * Revision 1.142  1994/12/06  11:33:19  yuan
8966  * Fixed bug with fueling when above 100.
8967  *
8968  * Revision 1.141  1994/12/05  23:37:14  matt
8969  * Took out calls to warning() function
8970  *
8971  * Revision 1.140  1994/12/05  23:19:18  yuan
8972  * Fixed fuel center refuelers..
8973  *
8974  * Revision 1.139  1994/12/03  12:48:12  mike
8975  * diminish rocking due to control center destruction.
8976  *
8977  * Revision 1.138  1994/12/02  23:30:32  mike
8978  * fix bumpiness after toasting control center.
8979  *
8980  * Revision 1.137  1994/12/02  22:48:14  mike
8981  * rock the ship after toasting the control center!
8982  *
8983  * Revision 1.136  1994/12/02  17:12:11  rob
8984  * Fixed countdown sounds.
8985  *
8986  * Revision 1.135  1994/11/29  20:59:43  rob
8987  * Don't run out of fuel in net games (don't want to sync it between machines)
8988  *
8989  * Revision 1.134  1994/11/29  19:10:57  john
8990  * Took out debugging mprintf.
8991  *
8992  * Revision 1.133  1994/11/29  13:19:40  john
8993  * Made voice for "destruction actived in t-"
8994  * be at 12.75 secs.
8995  *
8996  * Revision 1.132  1994/11/29  12:19:46  john
8997  * MAde the "Mine desctruction will commence"
8998  * voice play at 12.5 secs.
8999  *
9000  * Revision 1.131  1994/11/29  12:12:54  adam
9001  * *** empty log message ***
9002  *
9003  * Revision 1.130  1994/11/28  21:04:26  rob
9004  * Added code to cast noise when player refuels.
9005  *
9006  * Revision 1.129  1994/11/27  23:15:04  matt
9007  * Made changes for new mprintf calling convention
9008  *
9009  * Revision 1.128  1994/11/21  16:27:51  mike
9010  * debug code for morphing.
9011  *
9012  * Revision 1.127  1994/11/21  12:33:50  matt
9013  * For control center explosions, use small fireball, not pseudo-random vclip
9014  *
9015  * Revision 1.126  1994/11/20  22:12:15  mike
9016  * Fix bug in initializing materialization centers.
9017  *
9018  * Revision 1.125  1994/11/19  15:18:22  mike
9019  * rip out unused code and data.
9020  *
9021  * Revision 1.124  1994/11/08  12:18:59  mike
9022  * Initialize Fuelcen_seconds_left.
9023  *
9024  * Revision 1.123  1994/10/30  14:12:33  mike
9025  * rip out repair center stuff
9026  *
9027  * Revision 1.122  1994/10/28  14:42:45  john
9028  * Added sound volumes to all sound calls.
9029  *
9030  * Revision 1.121  1994/10/16  12:44:02  mike
9031  * Make time to exit mine after control center destruction diff level dependent.
9032  *
9033  * Revision 1.120  1994/10/09  22:03:26  mike
9034  * Adapt to new create_n_segment_path parameters.
9035  *
9036  * Revision 1.119  1994/10/06  14:52:42  mike
9037  * Remove last of ability to damage fuel centers.
9038  *
9039  * Revision 1.118  1994/10/06  14:08:45  matt
9040  * Made morph flash effect get orientation from segment
9041  *
9042  * Revision 1.117  1994/10/05  16:09:03  mike
9043  * Put debugging code into matcen/fuelcen synchronization problem.
9044  *
9045  * Revision 1.116  1994/10/04  15:32:41  john
9046  * Took out the old PLAY_SOUND??? code and replaced it
9047  * with direct calls into digi_link_??? so that all sounds
9048  * can be made 3d.
9049  *
9050  * Revision 1.115  1994/10/03  23:37:57  mike
9051  * Clean up this mess of confusion to the point where maybe matcens actually work.
9052  *
9053  * Revision 1.114  1994/10/03  13:34:40  matt
9054  * Added new (and hopefully better) game sequencing functions
9055  *
9056  * Revision 1.113  1994/09/30  14:41:57  matt
9057  * Fixed bug as per Mike's instructions
9058  *
9059  * Revision 1.112  1994/09/30  00:37:33  mike
9060  * Balance materialization centers.
9061  *
9062  * Revision 1.111  1994/09/28  23:12:52  matt
9063  * Macroized palette flash system
9064  *
9065  * Revision 1.110  1994/09/27  15:42:31  mike
9066  * Add names of Specials.
9067  *
9068  * Revision 1.109  1994/09/27  00:02:23  mike
9069  * Yet more materialization center stuff.
9070  *
9071  * Revision 1.108  1994/09/26  11:26:23  mike
9072  * Balance materialization centers.
9073  *
9074  * Revision 1.107  1994/09/25  23:40:47  matt
9075  * Changed the object load & save code to read/write the structure fields one
9076  * at a time (rather than the whole structure at once).  This mean that the
9077  * object structure can be changed without breaking the load/save functions.
9078  * As a result of this change, the local_object data can be and has been
9079  * incorporated into the object array.  Also, timeleft is now a property
9080  * of all objects, and the object structure has been otherwise cleaned up.
9081  *
9082  * Revision 1.106  1994/09/25  15:55:58  mike
9083  * Balance materialization centers, make them emit light, make them re-triggerable after awhile.
9084  *
9085  * Revision 1.105  1994/09/24  17:42:33  mike
9086  * Making materialization centers be activated by triggers and balancing them.
9087  *
9088  * Revision 1.104  1994/09/24  14:16:06  mike
9089  * Support new network constants.
9090  *
9091  * Revision 1.103  1994/09/20  19:14:40  john
9092  * Massaged the sound system; used a better formula for determining
9093  * which l/r balance, also, put in Mike's stuff that searches for a connection
9094  * between the 2 sounds' segments, stopping for closed doors, etc.
9095  *
9096  * Revision 1.102  1994/09/17  01:40:51  matt
9097  * Added status bar/sizable window mode, and in the process revamped the
9098  * whole cockpit mode system.
9099  *
9100  * Revision 1.101  1994/08/31  20:57:25  matt
9101  * Cleaned up endlevel/death code
9102  *
9103  * Revision 1.100  1994/08/30  17:54:20  mike
9104  * Slow down rate of creation of objects by materialization centers.
9105  *
9106  * Revision 1.99  1994/08/29  11:47:01  john
9107  * Added warning if no control centers in mine.
9108
9109 ------------------------------------------------------------------------
9110 main/fuelcen.h:
9111
9112  * Revision 1.1  1995/05/16  15:56:31  allender
9113  * Initial revision
9114  *
9115  * Revision 2.0  1995/02/27  11:28:43  john
9116  * New version 2.0, which has no anonymous unions, builds with
9117  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9118  *
9119  * Revision 1.26  1995/01/26  12:19:16  rob
9120  * Added externs of things needed for multiplayer.
9121  *
9122  * Revision 1.25  1994/10/30  14:11:10  mike
9123  * rip out repair center stuff.
9124  *
9125  * Revision 1.24  1994/10/03  23:36:36  mike
9126  * Add segnum and fuelcen_num (renaming dest_seg and *path) in matcen_info struct.
9127  *
9128  * Revision 1.23  1994/09/30  00:37:44  mike
9129  * Change FuelCenter struct.
9130  *
9131  * Revision 1.22  1994/09/27  15:42:49  mike
9132  * Kill some obsolete matcen constants, Prototype Special_names.
9133  *
9134  * Revision 1.21  1994/09/27  00:04:30  mike
9135  * Moved FuelCenter struct here from fuelcen.c
9136  *
9137  * Revision 1.20  1994/09/25  15:55:37  mike
9138  * Prototype function disable_matcens.
9139  *
9140  * Revision 1.19  1994/09/24  17:41:34  mike
9141  * Prototype trigger_matcen.
9142  *
9143  * Revision 1.18  1994/08/03  17:52:19  matt
9144  * Tidied up repair centers a bit
9145  *
9146  * Revision 1.17  1994/08/02  12:16:01  mike
9147  * *** empty log message ***
9148  *
9149  * Revision 1.16  1994/08/01  11:04:03  yuan
9150  * New materialization centers.
9151  *
9152  * Revision 1.15  1994/07/21  19:02:15  mike
9153  * break repair centers.
9154  *
9155  * Revision 1.14  1994/07/14  11:25:22  john
9156  * Made control centers destroy better; made automap use Tab key.
9157  *
9158  * Revision 1.13  1994/07/13  10:45:33  john
9159  * Made control center object switch when dead.
9160  *
9161  * Revision 1.12  1994/07/09  17:36:44  mike
9162  * Add extern for find_connected_repair_seg.
9163  *
9164  * Revision 1.11  1994/06/15  19:00:32  john
9165  * Show timer in on top of 3d with mine destroyed...
9166  *
9167  * Revision 1.10  1994/05/31  16:49:46  john
9168  * Begin to add robot materialization centers.
9169  *
9170  * Revision 1.9  1994/05/30  20:22:03  yuan
9171  * New triggers.
9172  *
9173  * Revision 1.8  1994/05/05  16:41:14  matt
9174  * Cleaned up repair center code, and moved some from object.c to fuelcen.c
9175  *
9176  * Revision 1.7  1994/04/21  20:41:21  yuan
9177  * Added extern.
9178  *
9179  * Revision 1.6  1994/04/21  20:28:32  john
9180  * Added flag for Yuan to tell when a fuel center is destroyed.
9181  *
9182  * Revision 1.5  1994/04/14  17:00:59  john
9183  * Made repair cen's work properly; added reset_all_fuelcens.
9184  *
9185  * Revision 1.4  1994/04/12  20:28:04  john
9186  * Added control center.
9187  *
9188  * Revision 1.3  1994/04/08  15:37:10  john
9189  * Added repair centers.
9190  *
9191  * Revision 1.2  1994/04/06  19:10:38  john
9192  * NEw version.
9193  *
9194  *
9195  * Revision 1.1  1994/04/06  12:39:02  john
9196  * Initial revision
9197
9198 ------------------------------------------------------------------------
9199 main/fvi.c:
9200
9201  * Revision 1.7  1995/10/21  23:52:18  allender
9202  * #ifdef'ed out stack debug stuff
9203  *
9204  * Revision 1.6  1995/10/10  12:07:42  allender
9205  * add forgotten ;
9206  *
9207  * Revision 1.5  1995/10/10  11:47:27  allender
9208  * put in stack space check
9209  *
9210  * Revision 1.4  1995/08/23  21:34:08  allender
9211  * fix mcc compiler warning
9212  *
9213  * Revision 1.3  1995/08/14  14:35:18  allender
9214  * changed transparency to 0
9215  *
9216  * Revision 1.2  1995/07/05  16:50:51  allender
9217  * transparency/kitchen change
9218  *
9219  * Revision 1.1  1995/05/16  15:24:59  allender
9220  * Initial revision
9221  *
9222  * Revision 2.3  1995/03/24  14:49:04  john
9223  * Added cheat for player to go thru walls.
9224  *
9225  * Revision 2.2  1995/03/21  17:58:32  john
9226  * Fixed bug with normals..
9227  *
9228  *
9229  * Revision 2.1  1995/03/20  18:15:37  john
9230  * Added code to not store the normals in the segment structure.
9231  *
9232  * Revision 2.0  1995/02/27  11:27:41  john
9233  * New version 2.0, which has no anonymous unions, builds with
9234  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9235  *
9236  * Revision 1.49  1995/02/22  14:45:47  allender
9237  * remove anonymous unions from object structure
9238  *
9239  * Revision 1.48  1995/02/22  13:24:50  john
9240  * Removed the vecmat anonymous unions.
9241  *
9242  * Revision 1.47  1995/02/07  16:17:26  matt
9243  * Disabled all robot-robot collisions except those involving two green
9244  * guys.  Used to do collisions if either robot was green guy.
9245  *
9246  * Revision 1.46  1995/02/02  14:07:53  matt
9247  * Fixed confusion about which segment you are touching when you're
9248  * touching a wall.  This manifested itself in spurious lava burns.
9249  *
9250  * Revision 1.45  1995/02/02  13:45:53  matt
9251  * Made a bunch of lint-inspired changes
9252  *
9253  * Revision 1.44  1995/01/24  12:10:17  matt
9254  * Fudged collisions for player/player, and player weapon/other player in
9255  * coop games.
9256  *
9257  * Revision 1.43  1995/01/14  19:16:45  john
9258  * First version of new bitmap paging code.
9259  *
9260  * Revision 1.42  1994/12/15  12:22:40  matt
9261  * Small change which may or may not help
9262  *
9263  * Revision 1.41  1994/12/14  11:45:51  matt
9264  * Fixed (hopefully) little bug with invalid segnum
9265  *
9266  * Revision 1.40  1994/12/13  17:12:01  matt
9267  * Increased edge tolerance a bunch more
9268  *
9269  * Revision 1.39  1994/12/13  14:37:59  matt
9270  * Fixed another stupid little bug
9271  *
9272  * Revision 1.38  1994/12/13  13:25:44  matt
9273  * Increased tolerance massively to avoid catching on corners
9274  *
9275  * Revision 1.37  1994/12/13  12:02:20  matt
9276  * Fixed small bug
9277  *
9278  * Revision 1.36  1994/12/13  11:17:35  matt
9279  * Lots of changes to hopefully fix objects leaving the mine.  Note that
9280  * this code should be considered somewhat experimental - one problem I
9281  * know about is that you can get stuck on edges more easily than before.
9282  * There may be other problems I don't know about yet.
9283  *
9284  * Revision 1.35  1994/12/12  01:20:57  matt
9285  * Added hack in object-object collisions that treats claw guys as
9286  * if they have 3/4 of their actual radius.
9287  *
9288  * Revision 1.34  1994/12/04  22:48:39  matt
9289  * Physics & FVI now only build seglist for player objects, and they
9290  * responsilby deal with buffer full conditions
9291  *
9292  * Revision 1.33  1994/12/04  22:07:05  matt
9293  * Added better handing of buffer full condition
9294  *
9295  * Revision 1.32  1994/12/01  21:06:33  matt
9296  * Several important changes:
9297  *  (1) Checking against triangulated sides has been standardized a bit
9298  *  (2) Code has been added to de-triangulate some sides
9299  *  (3) BIG ONE: the tolerance for checking a point against a plane has
9300  *      been drastically relaxed
9301  *
9302  *
9303  * Revision 1.31  1994/11/27  23:15:03  matt
9304  * Made changes for new mprintf calling convention
9305  *
9306  * Revision 1.30  1994/11/19  15:20:30  mike
9307  * rip out unused code and data
9308  *
9309  * Revision 1.29  1994/11/16  12:18:17  mike
9310  * hack for green_guy:green_guy collision detection.
9311  *
9312  * Revision 1.28  1994/11/10  13:08:54  matt
9313  * Added support for new run-length-encoded bitmaps
9314  *
9315  * Revision 1.27  1994/10/31  12:27:51  matt
9316  * Added new function object_intersects_wall()
9317  *
9318  * Revision 1.26  1994/10/20  13:59:27  matt
9319  * Added assert
9320  *
9321  * Revision 1.25  1994/10/09  23:51:09  matt
9322  * Made find_hitpoint_uv() work with triangulated sides
9323  *
9324  * Revision 1.24  1994/09/25  00:39:29  matt
9325  * Took out mprintf's
9326  *
9327  * Revision 1.23  1994/09/25  00:37:53  matt
9328  * Made the 'find the point in the bitmap where something hit' system
9329  * publicly accessible.
9330  *
9331  * Revision 1.22  1994/09/21  16:58:22  matt
9332  * Fixed bug in trans wall check that was checking against verically
9333  * flipped bitmap (i.e., the y coord was negative when checking).
9334  *
9335  * Revision 1.21  1994/09/02  11:31:40  matt
9336  * Fixed object/object collisions, so you can't fly through robots anymore.
9337  * Cleaned up object damage system.
9338  *
9339  * Revision 1.20  1994/08/26  09:42:03  matt
9340  * Increased the size of a buffer
9341  *
9342  * Revision 1.19  1994/08/11  18:57:53  mike
9343  * Convert shorts to ints for optimization.
9344  *
9345  * Revision 1.18  1994/08/08  21:38:24  matt
9346  * Put in small optimization
9347  *
9348  * Revision 1.17  1994/08/08  12:21:52  yuan
9349  * Fixed assert
9350  *
9351  * Revision 1.16  1994/08/08  11:47:04  matt
9352  * Cleaned up fvi and physics a little
9353  *
9354  * Revision 1.15  1994/08/04  00:21:04  matt
9355  * Cleaned up fvi & physics error handling; put in code to make sure objects
9356  * are in correct segment; simplified segment finding for objects and points
9357  *
9358  * Revision 1.14  1994/08/02  19:04:26  matt
9359  * Cleaned up vertex list functions
9360  *
9361  * Revision 1.13  1994/08/02  09:56:28  matt
9362  * Put in check for bad value find_plane_line_intersection()
9363  *
9364  * Revision 1.12  1994/08/01  17:27:26  matt
9365  * Added support for triangulated walls in trans point check
9366  *
9367  * Revision 1.11  1994/08/01  13:30:40  matt
9368  * Made fvi() check holes in transparent walls, and changed fvi() calling
9369  * parms to take all input data in query structure.
9370  *
9371  * Revision 1.10  1994/07/13  21:47:17  matt
9372  * FVI() and physics now keep lists of segments passed through which the
9373  * trigger code uses.
9374  *
9375  * Revision 1.9  1994/07/09  21:21:40  matt
9376  * Fixed, hopefull, bugs in sphere-to-vector intersection code
9377  *
9378  * Revision 1.8  1994/07/08  14:26:42  matt
9379  * Non-needed powerups don't get picked up now; this required changing FVI to
9380  * take a list of ingore objects rather than just one ignore object.
9381  *
9382  * Revision 1.7  1994/07/06  20:02:37  matt
9383  * Made change to match gameseg that uses lowest point number as reference
9384  * point when checking against a plane
9385  *
9386  * Revision 1.6  1994/06/29  15:43:58  matt
9387  * When computing intersection of vector and sphere, use the radii of both
9388  * objects.
9389  *
9390  * Revision 1.5  1994/06/14  15:57:58  matt
9391  * Took out asserts, and added other hacks, pending real bug fixes
9392  *
9393  * Revision 1.4  1994/06/13  23:10:08  matt
9394  * Fixed problems with triangulated sides
9395  *
9396  * Revision 1.3  1994/06/09  12:11:14  matt
9397  * Fixed confusing use of two variables, hit_objnum & fvi_hit_object, to
9398  * keep the same information in different ways.
9399  *
9400  * Revision 1.2  1994/06/09  09:58:38  matt
9401  * Moved find_vector_intersection() from physics.c to new file fvi.c
9402  *
9403  * Revision 1.1  1994/06/09  09:25:57  matt
9404  * Initial revision
9405
9406 ------------------------------------------------------------------------
9407 main/fvi.h:
9408
9409  * Revision 1.2  1995/08/23  21:34:29  allender
9410  * fix mcc compiler warning
9411  *
9412  * Revision 1.1  1995/05/16  15:56:38  allender
9413  * Initial revision
9414  *
9415  * Revision 2.1  1995/03/20  18:15:58  john
9416  * Added code to not store the normals in the segment structure.
9417  *
9418  * Revision 2.0  1995/02/27  11:32:02  john
9419  * New version 2.0, which has no anonymous unions, builds with
9420  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9421  *
9422  * Revision 1.10  1995/02/02  14:07:58  matt
9423  * Fixed confusion about which segment you are touching when you're
9424  * touching a wall.  This manifested itself in spurious lava burns.
9425  *
9426  * Revision 1.9  1994/12/04  22:48:04  matt
9427  * Physics & FVI now only build seglist for player objects, and they
9428  * responsilby deal with buffer full conditions
9429  *
9430  * Revision 1.8  1994/10/31  12:28:01  matt
9431  * Added new function object_intersects_wall()
9432  *
9433  * Revision 1.7  1994/10/10  13:10:00  matt
9434  * Increased max_fvi_segs
9435  *
9436  * Revision 1.6  1994/09/25  00:38:29  matt
9437  * Made the 'find the point in the bitmap where something hit' system
9438  * publicly accessible.
9439  *
9440  * Revision 1.5  1994/08/01  13:30:35  matt
9441  * Made fvi() check holes in transparent walls, and changed fvi() calling
9442  * parms to take all input data in query structure.
9443  *
9444  * Revision 1.4  1994/07/13  21:47:59  matt
9445  * FVI() and physics now keep lists of segments passed through which the
9446  * trigger code uses.
9447  *
9448  * Revision 1.3  1994/07/08  14:27:26  matt
9449  * Non-needed powerups don't get picked up now; this required changing FVI to
9450  * take a list of ingore objects rather than just one ignore object.
9451  *
9452  * Revision 1.2  1994/06/09  09:58:39  matt
9453  * Moved find_vector_intersection() from physics.c to new file fvi.c
9454  *
9455  * Revision 1.1  1994/06/09  09:26:14  matt
9456  * Initial revision
9457
9458 ------------------------------------------------------------------------
9459 main/game.c:
9460
9461  * Revision 1.1  1995/12/05  16:01:09  allender
9462  * Initial revision
9463  *
9464  * Revision 1.38  1995/11/13  13:02:35  allender
9465  * put up HUD message when player starts tournament
9466  *
9467  * Revision 1.37  1995/11/13  09:21:05  allender
9468  * ved and shorted tournament mode messages
9469  *
9470  * Revision 1.36  1995/11/09  17:27:00  allender
9471  * took out cheats during demo playback
9472  *
9473  * Revision 1.35  1995/11/07  17:05:41  allender
9474  * move registered cheats
9475  *
9476  * Revision 1.34  1995/11/03  12:55:45  allender
9477  * shareware changes
9478  *
9479  * Revision 1.33  1995/10/29  20:15:00  allender
9480  * took out frame rate cheat.  Pause for at least a second because
9481  * of cmd-P problem
9482  *
9483  * Revision 1.32  1995/10/26  14:11:26  allender
9484  * fix up message box stuff to align correctly
9485  *
9486  * Revision 1.31  1995/10/24  18:09:41  allender
9487  * ixed cockpit weirdness -- don't update cockpit when do_appl_quit
9488  * is called -- screen saved in mevent.c
9489  *
9490  * Revision 1.30  1995/10/21  23:39:10  allender
9491  * ruise marking indicator
9492  *
9493  * Revision 1.29  1995/10/21  22:52:27  allender
9494  * bald guy cheat -- print screen stuff
9495  *
9496  * Revision 1.28  1995/10/20  00:54:28  allender
9497  * new help menus and redbook checking in outer game loop
9498  *
9499  * Revision 1.27  1995/10/17  15:34:19  allender
9500  * pixel double is now default mode
9501  *
9502  * Revision 1.26  1995/10/12  17:34:44  allender
9503  * bigger message box -- command key equivs for function keys
9504  *
9505  * Revision 1.25  1995/10/11  12:17:14  allender
9506  * removed event loop processing
9507  *
9508  * Revision 1.24  1995/10/11  00:58:47  allender
9509  * removed debugging code
9510  *
9511  * Revision 1.23  1995/10/10  11:50:32  allender
9512  * fixed boxed message to align on 8 byte boundry,
9513  * and some debug code
9514  *
9515  * Revision 1.22  1995/09/24  10:51:26  allender
9516  * cannot go to finder in network..added cmd-q for quit
9517  *
9518  * Revision 1.21  1995/09/22  15:05:18  allender
9519  * *more* hud and font type stuff (messages)
9520  *
9521  * Revision 1.20  1995/09/22  14:39:57  allender
9522  * ved framerate counter up
9523  *
9524  * Revision 1.19  1995/09/18  17:01:28  allender
9525  * start of compatibility stuff
9526  *
9527  * Revision 1.18  1995/09/15  15:53:13  allender
9528  * better handling of PICT screen shots
9529  *
9530  * Revision 1.17  1995/09/14  15:27:41  allender
9531  * fixed function type on message_box routiens
9532  *
9533  * Revision 1.16  1995/09/13  11:37:47  allender
9534  * put in call to dump PICT file instead of PCX
9535  *
9536  * Revision 1.15  1995/09/08  17:13:28  allender
9537  * put back in ibitblt.h and start of PICT picture dump
9538  *
9539  * Revision 1.14  1995/09/07  10:20:58  allender
9540  * make cockpit mode default
9541  *
9542  * Revision 1.13  1995/09/07  10:17:34  allender
9543  * added command key equivalents for function keys
9544  *
9545  * Revision 1.12  1995/09/04  11:36:47  allender
9546  * fixed pixel double mode to have correct number of rendered
9547  * lines
9548  *
9549  * Revision 1.11  1995/09/01  15:47:07  allender
9550  * cap frame rate at 60 fps
9551  *
9552  * Revision 1.10  1995/08/26  16:25:59  allender
9553  * whole buncha' stuff!!!!
9554  *
9555  * Revision 1.9  1995/08/01  16:04:47  allender
9556  * put in ctrl_esc sequence to go to menubar
9557  *
9558  * Revision 1.8  1995/07/28  14:15:11  allender
9559  * added FRAME cheat to display frame rate
9560  *
9561  * Revision 1.7  1995/07/17  08:54:19  allender
9562  * *** empty log message ***
9563  *
9564  * Revision 1.6  1995/07/12  12:54:06  allender
9565  * removed some debug keys
9566  *
9567  * Revision 1.5  1995/07/05  16:44:35  allender
9568  * changed some debug keys
9569  *
9570  * Revision 1.4  1995/06/23  10:24:57  allender
9571  * added scanline doubling routine
9572  *
9573  * Revision 1.3  1995/06/13  13:08:26  allender
9574  * added special debug key to move window into upper left corner.
9575  * also added debug key to put game in 640x480 mode
9576  *
9577  * Revision 1.2  1995/06/12  11:10:31  allender
9578  * added DEL_SHIFT_M to move window to corner of screen
9579  *
9580  * Revision 1.1  1995/05/16  15:25:08  allender
9581  * Initial revision
9582  *
9583  * Revision 2.36  1996/01/05  16:52:05  john
9584  * Improved 3d stuff.
9585  *
9586  * Revision 2.35  1995/10/09  22:17:10  john
9587  * Took out the page flipping in set_screen_mode, which shouldn't
9588  * be there.  This was hosing the modex stuff.
9589  *
9590  * Revision 2.34  1995/10/09  19:46:34  john
9591  * Fixed bug with modex paging with lcdbios.
9592  *
9593  * Revision 2.33  1995/10/08  11:46:09  john
9594  * Fixed bug with 2d offset in interlaced mode in low res.
9595  * Made LCDBIOS with pageflipping using VESA set start
9596  * Address function.  X=CRTC offset, Y=0.
9597  *
9598  * Revision 2.32  1995/10/07  13:20:51  john
9599  * Added new modes for LCDBIOS, also added support for -JoyNice,
9600  * and added Shift+F1-F4 to controls various stereoscopic params.
9601  *
9602  * Revision 2.31  1995/05/31  14:34:43  unknown
9603  * fixed warnings.
9604  *
9605  * Revision 2.30  1995/05/08  11:23:45  john
9606  * Made 3dmax work like Kasan wants it to.
9607  *
9608  * Revision 2.29  1995/04/06  13:47:39  yuan
9609  * Restored rear view to original.
9610  *
9611  * Revision 2.28  1995/04/06  12:13:07  john
9612  * Fixed some bugs with 3dmax.
9613  *
9614  * Revision 2.27  1995/04/05  13:18:18  mike
9615  * decrease energy usage on fusion cannon
9616  *
9617  * Revision 2.26  1995/03/30  16:36:32  mike
9618  * text localization.
9619  *
9620  * Revision 2.25  1995/03/27  16:45:26  john
9621  * Fixed some cheat bugs.  Added astral cheat.
9622  *
9623  * Revision 2.24  1995/03/27  15:37:11  mike
9624  * boost fusion cannon for non-multiplayer modes.
9625  *
9626  * Revision 2.23  1995/03/24  17:48:04  john
9627  * Fixed bug with menus and 320x100.
9628  *
9629  * Revision 2.22  1995/03/24  15:34:02  mike
9630  * cheats.
9631  *
9632  * Revision 2.21  1995/03/24  13:11:39  john
9633  * Added save game during briefing screens.
9634  *
9635  * Revision 2.20  1995/03/21  14:40:50  john
9636  * Ifdef'd out the NETWORK code.
9637  *
9638  * Revision 2.19  1995/03/16  22:07:16  john
9639  * Made so only for screen can be used for anything other
9640  * than mode 13.
9641  *
9642  * Revision 2.18  1995/03/16  21:45:35  john
9643  * Made all paged modes have incompatible menus!
9644  *
9645  * Revision 2.17  1995/03/16  18:30:35  john
9646  * Made wider than 320 screens not have
9647  * a status bar mode.
9648  *
9649  * Revision 2.16  1995/03/16  10:53:34  john
9650  * Move VFX center to Shift+Z instead of Enter because
9651  * it conflicted with toggling HUD on/off.
9652  *
9653  * Revision 2.15  1995/03/16  10:18:33  john
9654  * Fixed bug with VFX mode not working. also made warning
9655  * when it can't set VESA mode.
9656  *
9657  * Revision 2.14  1995/03/14  16:22:39  john
9658  * Added cdrom alternate directory stuff.
9659  *
9660  * Revision 2.13  1995/03/14  12:14:17  john
9661  * Made VR helmets have 4 resolutions to choose from.
9662  *
9663  * Revision 2.12  1995/03/10  13:47:33  john
9664  * Added head tracking sensitivity.
9665  *
9666  * Revision 2.11  1995/03/10  13:13:47  john
9667  * Added code to show T-xx on iglasses.
9668  *
9669  * Revision 2.10  1995/03/09  18:07:29  john
9670  * Fixed bug with iglasses tracking not "centering" right.
9671  * Made VFX have bright headlight lighting.
9672  *
9673  * Revision 2.9  1995/03/09  11:48:02  john
9674  * Added HUD for VR helmets.
9675  *
9676  * Revision 2.8  1995/03/07  15:12:53  john
9677  * Fixed VFX,3dmax support.
9678  *
9679  * Revision 2.7  1995/03/07  11:35:03  john
9680  * Fixed bug with cockpit in rear view.
9681  *
9682  * Revision 2.6  1995/03/06  18:40:17  john
9683  * Added some ifdef EDITOR stuff.
9684  *
9685  * Revision 2.5  1995/03/06  18:31:21  john
9686  * Fixed bug with nmenu popping up on editor screen.
9687  *
9688  * Revision 2.4  1995/03/06  17:28:33  john
9689  * Fixed but with cockpit toggling wrong.
9690  *
9691  * Revision 2.3  1995/03/06  16:08:10  mike
9692  * Fix compile errors if building without editor.
9693  *
9694  * Revision 2.2  1995/03/06  15:24:10  john
9695  * New screen techniques.
9696  *
9697  * Revision 2.1  1995/02/27  13:41:03  john
9698  * Removed floating point from frame rate calculations.
9699  *
9700  * Revision 2.0  1995/02/27  11:31:54  john
9701  * New version 2.0, which has no anonymous unions, builds with
9702  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9703  *
9704  * Revision 1.770  1995/02/22  12:45:15  allender
9705  * remove anonymous unions from object structure
9706  *
9707  * Revision 1.769  1995/02/15  10:06:25  allender
9708  * make pause pause game during demo playback
9709  *
9710  * Revision 1.768  1995/02/13  20:35:11  john
9711  * Lintized
9712  *
9713  * Revision 1.767  1995/02/13  19:40:29  allender
9714  * added place to demo record restoration from rear view in place that
9715  * I forgot before
9716  *
9717  * Revision 1.766  1995/02/13  10:29:27  john
9718  * Fixed bug with cheats not restoreing across save games.
9719  *
9720  * Revision 1.765  1995/02/11  22:54:33  john
9721  * Made loading for pig not show up for demos.
9722  *
9723  * Revision 1.764  1995/02/11  17:30:08  allender
9724  * ifndef NDEBUG around strip frame stuff
9725  *
9726  * Revision 1.763  1995/02/11  17:13:01  rob
9727  * Took out modem.c code fille stuff.
9728  *
9729  * Revision 1.762  1995/02/11  16:36:47  allender
9730  * debug key to strip frames from end of demo
9731  *
9732  * Revision 1.761  1995/02/11  14:29:16  john
9733  * Turned off cheats when going into game.
9734  *
9735  * Revision 1.760  1995/02/11  13:46:54  mike
9736  * fix cheats.
9737  *
9738  * Revision 1.759  1995/02/11  12:36:09  matt
9739  * Cleaned up cheats
9740  *
9741  * Revision 1.758  1995/02/11  12:27:04  mike
9742  * fix path-to-exit cheat.
9743  *
9744  * Revision 1.757  1995/02/11  01:56:24  mike
9745  * robots don't fire cheat.
9746  *
9747  * Revision 1.756  1995/02/10  16:38:40  mike
9748  * illuminate path to exit cheat.
9749  *
9750  * Revision 1.755  1995/02/10  16:19:40  mike
9751  * new show-path-to-exit system, still buggy, compiled out.
9752  *
9753  * Revision 1.754  1995/02/10  15:54:46  matt
9754  * Added new cheats
9755  *
9756  * Revision 1.753  1995/02/09  12:25:42  matt
9757  * Made mem_fill() test routines not be called if RELEASE
9758  *
9759  * Revision 1.752  1995/02/09  08:49:32  mike
9760  * change fill opcode value to 0xcc, int 3 value.
9761  *
9762  *
9763  * Revision 1.751  1995/02/09  02:59:26  mike
9764  * check code for 00066xxx bugs.
9765  *
9766  * Revision 1.750  1995/02/08  17:10:02  mike
9767  * add, but don't call, debug code.
9768  *
9769  * Revision 1.749  1995/02/07  11:07:27  john
9770  * Added hooks for confirm on game state restore.
9771  *
9772  * Revision 1.748  1995/02/06  15:52:45  mike
9773  * add mini megawow powerup for giving reasonable weapons.
9774  *
9775  * Revision 1.747  1995/02/06  12:53:35  allender
9776  * force endlevel_sequence to 0 to fix weird bug
9777  *
9778  * Revision 1.746  1995/02/04  10:03:30  mike
9779  * Fly to exit cheat.
9780  *
9781  * Revision 1.745  1995/02/02  15:57:52  john
9782  * Added turbo mode cheat.
9783  *
9784  * Revision 1.744  1995/02/02  14:43:39  john
9785  * Uppped frametime limit to 150 Hz.
9786  *
9787  * Revision 1.743  1995/02/02  13:37:16  mike
9788  * move T-?? message down in certain modes.
9789  *
9790  * Revision 1.742  1995/02/02  01:26:59  john
9791  * Took out no key repeating.
9792  *
9793  * Revision 1.741  1995/01/29  21:36:44  mike
9794  * make fusion cannon not make pitching slow.
9795  *
9796  * Revision 1.740  1995/01/28  15:57:57  john
9797  * Made joystick calibration be only when wrong detected in
9798  * menu or joystick axis changed.
9799  *
9800  * Revision 1.739  1995/01/28  15:21:03  yuan
9801  * Added X-tra life cheat.
9802  *
9803  * Revision 1.738  1995/01/27  14:08:31  rob
9804  * Fixed a bug.
9805  *
9806  * Revision 1.737  1995/01/27  14:04:59  rob
9807  * Its not my fault, Mark told me to do it!
9808  *
9809  * Revision 1.736  1995/01/27  13:12:18  rob
9810  * Added charging noises to play across net.
9811  *
9812  * Revision 1.735  1995/01/27  11:48:28  allender
9813  * check for newdemo_state to be paused and stop recording.  We might be
9814  * in between levels
9815  *
9816  * Revision 1.734  1995/01/26  22:11:41  mike
9817  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
9818  *
9819  * Revision 1.733  1995/01/26  17:03:04  mike
9820  * make fusion cannon have more chrome, make fusion, mega rock you!
9821  *
9822  * Revision 1.732  1995/01/25  14:37:25  john
9823  * Made joystick only prompt for calibration once...
9824  *
9825  * Revision 1.731  1995/01/24  15:49:14  john
9826  * Made typeing in long net messages wrap on
9827  * small screen sizes.
9828  *
9829  * Revision 1.730  1995/01/24  15:23:42  mike
9830  * network message tweaking.
9831  *
9832  * Revision 1.729  1995/01/24  12:00:47  john
9833  * Fixed bug with defing macro passing keys to controls.
9834  *
9835  * Revision 1.728  1995/01/24  11:53:35  john
9836  * Added better macro defining code.
9837  *
9838  * Revision 1.727  1995/01/23  22:17:15  john
9839  * Fixed bug with not clearing key buffer when leaving f8.
9840  *
9841  * Revision 1.726  1995/01/23  22:07:09  john
9842  * Added flush to game inputs during F8.
9843
9844 ------------------------------------------------------------------------
9845 main/game.h:
9846
9847  * Revision 1.3  1995/09/14  13:44:34  allender
9848  * fixed function prototypes to have void return value to satify
9849  * moto compiler
9850  *
9851  * Revision 1.2  1995/08/17  09:25:05  allender
9852  * externed Scanline_double variable
9853  *
9854  * Revision 1.1  1995/05/16  15:56:46  allender
9855  * Initial revision
9856  *
9857  * Revision 2.1  1995/03/06  15:23:22  john
9858  * New screen techniques.
9859  *
9860  * Revision 2.0  1995/02/27  11:28:21  john
9861  * New version 2.0, which has no anonymous unions, builds with
9862  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9863  *
9864  * Revision 1.79  1995/02/13  10:37:17  john
9865  * Saved Buggin' cheat mode to save file.
9866  *
9867  * Revision 1.78  1995/02/01  16:34:12  john
9868  * Linted.
9869  *
9870  * Revision 1.77  1995/01/29  21:37:14  mike
9871  * initialize variables on game load so you don't drain your energy when you fire.
9872  *
9873  * Revision 1.76  1995/01/26  22:11:36  mike
9874  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
9875  *
9876  * Revision 1.75  1995/01/26  16:45:31  mike
9877  * Add autofire fusion cannon stuff.
9878  *
9879  * Revision 1.74  1994/12/11  23:18:06  john
9880  * Added -nomusic.
9881  * Added RealFrameTime.
9882  * Put in a pause when sound initialization error.
9883  * Made controlcen countdown and framerate use RealFrameTime.
9884  *
9885  * Revision 1.73  1994/12/09  00:41:24  mike
9886  * fix hang in automap print screen
9887  *
9888  * Revision 1.72  1994/12/04  13:47:00  mike
9889  * enhance custom detail level support.
9890  *
9891  * Revision 1.71  1994/12/02  15:05:44  matt
9892  * Added new "official" cheats
9893  *
9894  * Revision 1.70  1994/11/28  18:14:09  rob
9895  * Added game_mode flag for team games.
9896  *
9897  * Revision 1.69  1994/11/15  16:51:13  matt
9898  * Made rear view only switch to rear cockpit if cockpit on in front view
9899  *
9900  * Revision 1.68  1994/11/04  16:26:10  john
9901  * Fixed bug with letterbox mode game after you finish a game.
9902  *
9903  * Revision 1.67  1994/11/02  11:59:48  john
9904  * Moved menu out of game into inferno main loop.
9905  *
9906  * Revision 1.66  1994/10/26  23:02:19  matt
9907  * Made palette flash saturate negative values
9908  *
9909  * Revision 1.65  1994/10/26  15:21:05  mike
9910  * Detail level stuff.  Make Render_depth public.
9911  *
9912  * Revision 1.64  1994/10/19  00:13:01  matt
9913  * Added prototypes
9914  *
9915  * Revision 1.63  1994/10/09  14:54:39  matt
9916  * Made player cockpit state & window size save/restore with saved games & automap
9917  *
9918  * Revision 1.62  1994/10/08  19:56:32  matt
9919  * Added prototype
9920  *
9921  * Revision 1.61  1994/10/07  22:19:32  mike
9922  * Increase number of difficulty levels from 4 to 5.
9923  *
9924  * Revision 1.60  1994/10/06  14:14:11  matt
9925  * Added new function to reset time (to prevent big FrameTime) at start of level
9926  *
9927  * Revision 1.59  1994/10/05  17:08:43  matt
9928  * Changed order of cockpit bitmaps, since there's no longer a full-screen cockpit
9929  *
9930  * Revision 1.58  1994/10/03  23:44:13  matt
9931  * Save & restore palette effect around menus & pause message
9932  *
9933  * Revision 1.57  1994/09/29  17:42:12  matt
9934  * Cleaned up game_mode a little
9935  *
9936  * Revision 1.56  1994/09/28  23:12:01  matt
9937  * Macroized palette flash system
9938  *
9939  * Revision 1.55  1994/09/24  16:56:13  rob
9940  * Added new fields for the Game_mode bitvector for modem play.
9941  *
9942  * Revision 1.54  1994/09/24  14:16:20  mike
9943  * Added new game mode constants.
9944  *
9945  * Revision 1.53  1994/09/22  19:00:57  mike
9946  * Move NDL from robot.h to here.
9947  *
9948  * Revision 1.52  1994/09/22  10:46:51  mike
9949  * Add difficulty levels.
9950  *
9951  * Revision 1.51  1994/09/17  01:39:52  matt
9952  * Added status bar/sizable window mode, and in the process revamped the
9953  * whole cockpit mode system.
9954  *
9955  * Revision 1.50  1994/09/15  21:23:10  matt
9956  * Changed system to keep track of whether & what cockpit is up
9957  *
9958  * Revision 1.49  1994/09/15  16:11:33  john
9959  * Added support for VFX1 head tracking. Fixed bug with memory over-
9960  * write when using stereo mode.
9961  *
9962  * Revision 1.48  1994/09/13  16:40:10  mike
9963  * Prototype Global_missile_firing_count.
9964  *
9965  * Revision 1.47  1994/09/13  11:19:05  mike
9966  * Add Next_missile_fire_time.
9967  *
9968  * Revision 1.46  1994/09/12  09:52:50  john
9969  * Made global flush function that flushes keyboard,mouse, and joystick.
9970  *
9971  * Revision 1.45  1994/09/03  15:24:14  mike
9972  * Make global Global_laser_firing_count.
9973  *
9974  * Revision 1.44  1994/08/31  19:26:57  mike
9975  * Prototypes for Next_laser_fire_time, Laser_delay_time.
9976  *
9977  * Revision 1.43  1994/08/18  10:47:22  john
9978  * Cleaned up game sequencing and player death stuff
9979  * in preparation for making the player explode into
9980  * pieces when dead.
9981  *
9982  * Revision 1.42  1994/08/11  18:03:53  matt
9983  * Added prototype
9984  *
9985  * Revision 1.41  1994/06/29  20:41:38  matt
9986  * Added new pause mode; cleaned up countdown & game startup code
9987  *
9988  * Revision 1.40  1994/06/24  17:03:49  john
9989  * Added VFX support. Also took all game sequencing stuff like
9990  * EndGame out and put it into gameseq.c
9991  *
9992  * Revision 1.39  1994/06/20  15:01:08  yuan
9993  * Added death when mine blows up...
9994  * Continues onto next level.
9995  *
9996  * Revision 1.38  1994/06/17  18:07:20  matt
9997  * Moved some vars out of ifdef
9998  *
9999  * Revision 1.37  1994/06/15  11:09:22  yuan
10000  * Moved gauge_message to mono screen for now.
10001  *
10002  * Revision 1.36  1994/05/30  20:22:11  yuan
10003  * New triggers.
10004  *
10005  * Revision 1.35  1994/05/27  10:32:48  yuan
10006  * New dialog boxes (Walls and Triggers) added.
10007  *
10008  *
10009  * Revision 1.34  1994/05/20  11:56:45  matt
10010  * Cleaned up find_vector_intersection() interface
10011  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
10012  *
10013  * Revision 1.33  1994/05/19  21:45:21  matt
10014  * Removed unused prototypes
10015  *
10016  * Revision 1.32  1994/05/19  18:53:17  yuan
10017  * Changing player structure...
10018  *
10019  * Revision 1.31  1994/05/16  16:38:35  yuan
10020  * Fixed palette add so it doesn't show up in the menu.
10021  *
10022  * Revision 1.30  1994/05/16  09:28:17  matt
10023  * Renamed init_player() to be init_player_stats(), added new funtion
10024  * init_player_object()
10025  *
10026  * Revision 1.29  1994/05/14  17:14:57  matt
10027  * Got rid of externs in source (non-header) files
10028
10029 ------------------------------------------------------------------------
10030 main/gamefont.c:
10031
10032  * Revision 1.2  1995/08/18  10:23:25  allender
10033  * remove refernce to big font -- add PC small font for pixel
10034  * doubling display
10035  *
10036  * Revision 1.1  1995/05/16  15:25:22  allender
10037  * Initial revision
10038  *
10039  * Revision 2.0  1995/02/27  11:30:14  john
10040  * New version 2.0, which has no anonymous unions, builds with
10041  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10042  *
10043  * Revision 1.8  1994/11/18  16:41:39  adam
10044  * trimmed some meat
10045  *
10046  * Revision 1.7  1994/11/17  13:07:11  adam
10047  * removed unused font
10048  *
10049  * Revision 1.6  1994/11/03  21:36:12  john
10050  * Added code for credit fonts.
10051  *
10052  * Revision 1.5  1994/08/17  20:20:02  matt
10053  * Took out alternate-color versions of font3, since this is a mono font
10054  *
10055  * Revision 1.4  1994/08/12  12:03:44  adam
10056  * tweaked fonts.
10057  *
10058  * Revision 1.3  1994/08/11  12:43:40  adam
10059  * changed font filenames
10060  *
10061  * Revision 1.2  1994/08/10  19:57:15  john
10062  * Changed font stuff; Took out old menu; messed up lots of
10063  * other stuff like game sequencing messages, etc.
10064  *
10065  * Revision 1.1  1994/08/10  17:20:09  john
10066  * Initial revision
10067
10068 ------------------------------------------------------------------------
10069 main/gamefont.h:
10070
10071  * Revision 1.2  1995/08/18  10:23:54  allender
10072  * removed large font -- added PC small font
10073  *
10074  * Revision 1.1  1995/05/16  15:56:55  allender
10075  * Initial revision
10076  *
10077  * Revision 2.0  1995/02/27  11:31:09  john
10078  * New version 2.0, which has no anonymous unions, builds with
10079  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10080  *
10081  * Revision 1.7  1994/11/18  16:41:28  adam
10082  * trimmed meat
10083  *
10084  * Revision 1.6  1994/11/17  13:07:00  adam
10085  * removed unused font
10086  *
10087  * Revision 1.5  1994/11/03  21:36:02  john
10088  * Added code for credit fonts.
10089  *
10090  * Revision 1.4  1994/08/17  20:20:25  matt
10091  * Took out alternate-color versions of font3, since this is a mono font
10092  *
10093  * Revision 1.3  1994/08/11  12:44:32  adam
10094  * killed a #define
10095  *
10096  * Revision 1.2  1994/08/10  19:57:16  john
10097  * Changed font stuff; Took out old menu; messed up lots of
10098  * other stuff like game sequencing messages, etc.
10099  *
10100  * Revision 1.1  1994/08/10  17:20:22  john
10101  * Initial revision
10102
10103 ------------------------------------------------------------------------
10104 main/gamemine.c:
10105
10106  * Revision 1.2  1995/10/31  10:15:58  allender
10107  * code for shareware levels
10108  *
10109  * Revision 1.1  1995/05/16  15:25:29  allender
10110  * Initial revision
10111  *
10112  * Revision 2.2  1995/03/06  15:23:14  john
10113  * New screen techniques.
10114  *
10115  * Revision 2.1  1995/02/27  13:13:37  john
10116  * Removed floating point.
10117  *
10118  * Revision 2.0  1995/02/27  11:27:45  john
10119  * New version 2.0, which has no anonymous unions, builds with
10120  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10121  *
10122  * Revision 1.70  1995/02/13  20:35:09  john
10123  * Lintized
10124  *
10125  * Revision 1.69  1995/02/07  17:12:03  rob
10126  * Added ifdef's for Editor.
10127  *
10128  * Revision 1.68  1995/02/07  16:51:48  mike
10129  * fix gray rock josh problem.
10130  *
10131  * Revision 1.67  1995/02/01  15:46:26  yuan
10132  * Fixed matcen_nums.
10133  *
10134  * Revision 1.66  1995/01/19  15:19:28  mike
10135  * new super-compressed registered file format.
10136  *
10137  * Revision 1.65  1994/12/10  16:44:59  matt
10138  * Added debugging code to track down door that turns into rock
10139  *
10140  * Revision 1.64  1994/12/10  14:58:24  yuan
10141  * *** empty log message ***
10142  *
10143  * Revision 1.63  1994/12/08  17:19:10  yuan
10144  * Cfiling stuff.
10145  *
10146  * Revision 1.62  1994/12/07  14:05:33  yuan
10147  * Fixed wall assert problem... Bashed highest_segment
10148  * _index before WALL_IS_DOORWAY check.
10149  *
10150  * Revision 1.61  1994/11/27  23:14:52  matt
10151  * Made changes for new mprintf calling convention
10152  *
10153  * Revision 1.60  1994/11/27  18:05:20  matt
10154  * Compile out LVL reader when editor compiled out
10155  *
10156  * Revision 1.59  1994/11/26  22:51:45  matt
10157  * Removed editor-only fields from segment structure when editor is compiled
10158  * out, and padded segment structure to even multiple of 4 bytes.
10159  *
10160  * Revision 1.58  1994/11/26  21:48:02  matt
10161  * Fixed saturation in short light value
10162  *
10163  * Revision 1.57  1994/11/20  22:11:49  mike
10164  * comment out an apparently unnecessary call to fuelcen_reset().
10165  *
10166  * Revision 1.56  1994/11/18  21:56:42  john
10167  * Added a better, leaner pig format.
10168  *
10169  * Revision 1.55  1994/11/17  20:09:18  john
10170  * Added new compiled level format.
10171  *
10172  * Revision 1.54  1994/11/17  15:40:17  mike
10173  * Comment out mprintf which was causing important information to scroll away.
10174  *
10175  * Revision 1.53  1994/11/17  14:56:37  mike
10176  * moved segment validation functions from editor to main.
10177  *
10178  * Revision 1.52  1994/11/17  11:39:35  matt
10179  * Ripped out code to load old mines
10180  *
10181  * Revision 1.51  1994/11/14  20:47:53  john
10182  * Attempted to strip out all the code in the game
10183  * directory that uses any ui code.
10184  *
10185  * Revision 1.50  1994/11/14  16:05:38  matt
10186  * Fixed, maybe, again, errors when can't find texture during remap
10187  *
10188  * Revision 1.49  1994/11/14  14:34:03  matt
10189  * Fixed up handling when textures can't be found during remap
10190  *
10191  * Revision 1.48  1994/11/14  13:01:55  matt
10192  * Added Int3() when can't find texture
10193  *
10194  * Revision 1.47  1994/10/30  14:12:21  mike
10195  * rip out local segments stuff.
10196  *
10197  * Revision 1.46  1994/10/27  19:43:07  john
10198  * Disable the piglet option.
10199  *
10200  * Revision 1.45  1994/10/27  18:51:42  john
10201  * Added -piglet option that only loads needed textures for a
10202  * mine.  Only saved ~1MB, and code still doesn't free textures
10203  * before you load a new mine.
10204  *
10205  * Revision 1.44  1994/10/20  12:47:22  matt
10206  * Replace old save files (MIN/SAV/HOT) with new LVL files
10207  *
10208  * Revision 1.43  1994/10/19  16:46:40  matt
10209  * Made tmap overrides for robots remap texture numbers
10210  *
10211  * Revision 1.42  1994/10/03  23:37:01  mike
10212  * Adapt to changed fuelcen_activate parameters.
10213  *
10214  * Revision 1.41  1994/09/23  22:14:49  matt
10215  * Took out obsolete structure fields
10216  *
10217  * Revision 1.40  1994/08/01  11:04:11  yuan
10218  * New materialization centers.
10219  *
10220  * Revision 1.39  1994/07/21  19:01:47  mike
10221  * Call Lsegment stuff.
10222
10223 ------------------------------------------------------------------------
10224 main/gamemine.h:
10225
10226  * Revision 1.1  1995/05/16  15:57:02  allender
10227  * Initial revision
10228  *
10229  * Revision 2.0  1995/02/27  11:28:50  john
10230  * New version 2.0, which has no anonymous unions, builds with
10231  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10232  *
10233  * Revision 1.15  1994/11/17  11:39:34  matt
10234  * Ripped out code to load old mines
10235  *
10236  * Revision 1.14  1994/10/19  16:46:40  matt
10237  * Made tmap overrides for robots remap texture numbers
10238  *
10239  * Revision 1.13  1994/09/23  22:14:37  matt
10240  * Took out obsolete structure fields
10241  *
10242  * Revision 1.12  1994/07/22  12:36:32  matt
10243  * Cleaned up editor/game interactions some more.
10244  *
10245  * Revision 1.11  1994/06/01  11:21:37  yuan
10246  * Added controlcentertriggers to the gamesave.
10247  *
10248  * Revision 1.10  1994/05/10  12:14:26  yuan
10249  * Game save/load... Demo levels 1-5 added...
10250  * High scores fixed...
10251  *
10252  * Revision 1.9  1994/05/04  18:25:05  yuan
10253  * Working on gamesave.
10254  *
10255  * Revision 1.8  1994/05/03  15:53:27  yuan
10256  * Readded structure field groups for backward compatibility...
10257  *
10258  * Revision 1.7  1994/05/03  11:36:26  yuan
10259  * Stabilizing gamesave stuff.
10260  *
10261  * Revision 1.6  1994/04/28  11:01:32  yuan
10262  * Added objects in structure.
10263  *
10264  * Revision 1.5  1994/04/06  18:30:03  john
10265  * Added Refueling segments.
10266  *
10267  * Revision 1.4  1994/03/17  18:06:53  yuan
10268  * Removed switch code... Now we just have Walls, Triggers, and Links...
10269  *
10270  * Revision 1.3  1994/03/01  18:12:24  yuan
10271  * Wallswitches, triggers, and more!
10272  *
10273  * Revision 1.2  1994/02/10  15:36:01  matt
10274  * Various changes to make editor compile out.
10275  *
10276  * Revision 1.1  1994/02/09  17:11:45  matt
10277  * Initial revision
10278
10279 ------------------------------------------------------------------------
10280 main/gamesave.c:
10281
10282  * Revision 1.3  1996/02/21  13:59:17  allender
10283  * check Data folder when can't open a level file from a hog
10284  *
10285  * Revision 1.2  1995/10/31  10:23:23  allender
10286  * shareware stuff
10287  *
10288  * Revision 1.1  1995/05/16  15:25:37  allender
10289  * Initial revision
10290  *
10291  * Revision 2.2  1995/04/23  14:53:12  john
10292  * Made some mine structures read in with no structure packing problems.
10293  *
10294  * Revision 2.1  1995/03/20  18:15:43  john
10295  * Added code to not store the normals in the segment structure.
10296  *
10297  * Revision 2.0  1995/02/27  11:29:50  john
10298  * New version 2.0, which has no anonymous unions, builds with
10299  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10300  *
10301  * Revision 1.207  1995/02/23  10:17:36  allender
10302  * fixed parameter mismatch with compute_segment_center
10303  *
10304  * Revision 1.206  1995/02/22  14:51:17  allender
10305  * fixed some things that I missed
10306  *
10307  * Revision 1.205  1995/02/22  13:31:38  allender
10308  * remove anonymous unions from object structure
10309  *
10310  * Revision 1.204  1995/02/01  20:58:08  john
10311  * Made editor check hog.
10312  *
10313  * Revision 1.203  1995/01/28  17:40:34  mike
10314  * correct level names (use rdl, sdl) for dumpmine stuff.
10315  *
10316  * Revision 1.202  1995/01/25  20:03:46  matt
10317  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
10318  *
10319  * Revision 1.201  1995/01/20  16:56:53  mike
10320  * remove some mprintfs.
10321  *
10322  * Revision 1.200  1995/01/15  19:42:13  matt
10323  * Ripped out hostage faces for registered version
10324  *
10325  * Revision 1.199  1995/01/05  16:59:09  yuan
10326  * Make it so if editor is loaded, don't get error from typo
10327  * in filename.
10328  *
10329  * Revision 1.198  1994/12/19  12:49:46  mike
10330  * Change fgets to cfgets.  fgets was getting a pointer mismatch warning.
10331  *
10332  * Revision 1.197  1994/12/12  01:20:03  matt
10333  * Took out object size hack for green claw guys
10334  *
10335  * Revision 1.196  1994/12/11  13:19:37  matt
10336  * Restored calls to fix_object_segs() when debugging is turned off, since
10337  * it's not a big routine, and could fix some possibly bad problems.
10338  *
10339  * Revision 1.195  1994/12/10  16:17:24  mike
10340  * fix editor bug that was converting transparent walls into rock.
10341  *
10342  * Revision 1.194  1994/12/09  14:59:27  matt
10343  * Added system to attach a fireball to another object for rendering purposes,
10344  * so the fireball always renders on top of (after) the object.
10345  *
10346  * Revision 1.193  1994/12/08  17:19:02  yuan
10347  * Cfiling stuff.
10348  *
10349  * Revision 1.192  1994/12/02  20:01:05  matt
10350  * Always give vulcan cannon powerup same amount of ammo, regardless of
10351  * how much it was saved with
10352  *
10353  * Revision 1.191  1994/11/30  17:45:57  yuan
10354  * Saving files now creates RDL/SDLs instead of CDLs.
10355  *
10356  * Revision 1.190  1994/11/30  17:22:14  matt
10357  * Ripped out hostage faces in shareware version
10358  *
10359  * Revision 1.189  1994/11/28  00:09:30  allender
10360  * commented out call to newdemo_record_start_demo in load_level...what is
10361  * this doing here anyway?????
10362  *
10363  * Revision 1.188  1994/11/27  23:13:48  matt
10364  * Made changes for new mprintf calling convention
10365  *
10366  * Revision 1.187  1994/11/27  18:06:20  matt
10367  * Cleaned up LVL/CDL file loading
10368  *
10369  * Revision 1.186  1994/11/25  22:46:29  matt
10370  * Allow ESC out of compiled/normal menu (esc=compiled).
10371  *
10372  * Revision 1.185  1994/11/23  12:18:35  mike
10373  * move level names here...a more logical place than dumpmine.
10374  *
10375  * Revision 1.184  1994/11/21  20:29:19  matt
10376  * If hostage info is bad, fix it.
10377  *
10378  * Revision 1.183  1994/11/21  20:26:07  matt
10379  * Fixed bug, I hope
10380  *
10381  * Revision 1.182  1994/11/21  20:20:37  matt
10382  * Fixed stupid mistake
10383  *
10384  * Revision 1.181  1994/11/21  20:18:40  matt
10385  * Fixed (hopefully) totally bogus writing of hostage data
10386  *
10387  * Revision 1.180  1994/11/20  14:11:56  matt
10388  * Gracefully handle two hostages having same id
10389  *
10390  * Revision 1.179  1994/11/19  23:55:05  mike
10391  * remove Assert, put in comment for Matt.
10392  *
10393  * Revision 1.178  1994/11/19  19:53:24  matt
10394  * Added code to full support different hostage head clip & message for
10395  * each hostage.
10396  *
10397  * Revision 1.177  1994/11/19  15:15:21  mike
10398  * remove unused code and data
10399  *
10400  * Revision 1.176  1994/11/19  10:28:28  matt
10401  * Took out write routines when editor compiled out
10402  *
10403  * Revision 1.175  1994/11/17  20:38:25  john
10404  * Took out warning.
10405  *
10406  * Revision 1.174  1994/11/17  20:36:34  john
10407  * Made it so that saving a mine will write the .cdl even
10408  * if .lvl gets error.
10409  *
10410  * Revision 1.173  1994/11/17  20:26:19  john
10411  * Made the game load whichever of .cdl or .lvl exists,
10412  * and if they both exist, prompt the user for which one.
10413  *
10414  * Revision 1.172  1994/11/17  20:11:20  john
10415  * Fixed warning.
10416  *
10417  * Revision 1.171  1994/11/17  20:09:26  john
10418  * Added new compiled level format.
10419  *
10420  * Revision 1.170  1994/11/17  14:57:21  mike
10421  * moved segment validation functions from editor to main.
10422  *
10423  * Revision 1.169  1994/11/17  11:39:21  matt
10424  * Ripped out code to load old mines
10425  *
10426  * Revision 1.168  1994/11/16  11:24:53  matt
10427  * Made attack-type robots have smaller radius, so they get closer to player
10428  *
10429  * Revision 1.167  1994/11/15  21:42:47  mike
10430  * better error messages.
10431  *
10432  * Revision 1.166  1994/11/15  15:30:41  matt
10433  * Save ptr to name of level being loaded
10434  *
10435  * Revision 1.165  1994/11/14  20:47:46  john
10436  * Attempted to strip out all the code in the game
10437  * directory that uses any ui code.
10438  *
10439  * Revision 1.164  1994/11/14  14:34:23  matt
10440  * Fixed up handling when textures can't be found during remap
10441  *
10442  * Revision 1.163  1994/11/10  14:02:49  matt
10443  * Hacked in support for player ships with different textures
10444  *
10445  * Revision 1.162  1994/11/06  14:38:17  mike
10446  * Remove an apparently unnecessary mprintf.
10447  *
10448  * Revision 1.161  1994/10/30  14:11:28  mike
10449  * ripout local segments stuff.
10450  *
10451  * Revision 1.160  1994/10/28  12:10:41  matt
10452  * Check that was supposed to happen only when editor was in was happening
10453  * only when editor was out.
10454  *
10455  * Revision 1.159  1994/10/27  11:25:32  matt
10456  * Only do connectivity error check when editor in
10457  *
10458  * Revision 1.158  1994/10/27  10:54:00  matt
10459  * Made connectivity error checking put up warning if errors found
10460  *
10461  * Revision 1.157  1994/10/25  10:50:54  matt
10462  * Vulcan cannon powerups now contain ammo count
10463  *
10464  * Revision 1.156  1994/10/23  02:10:43  matt
10465  * Got rid of obsolete hostage_info stuff
10466  *
10467  * Revision 1.155  1994/10/22  18:57:26  matt
10468  * Added call to check_segment_connections()
10469  *
10470  * Revision 1.154  1994/10/21  12:19:23  matt
10471  * Clear transient objects when saving (& loading) games
10472  *
10473  * Revision 1.153  1994/10/21  11:25:10  mike
10474  * Use new constant IMMORTAL_TIME.
10475  *
10476  * Revision 1.152  1994/10/20  12:46:59  matt
10477  * Replace old save files (MIN/SAV/HOT) with new LVL files
10478  *
10479  * Revision 1.151  1994/10/19  19:26:32  matt
10480  * Fixed stupid bug
10481  *
10482  * Revision 1.150  1994/10/19  16:46:21  matt
10483  * Made tmap overrides for robots remap texture numbers
10484  *
10485  * Revision 1.149  1994/10/18  08:50:27  yuan
10486  * Fixed correct variable this time.
10487  *
10488  * Revision 1.148  1994/10/18  08:45:02  yuan
10489  * Oops. forgot load function.
10490  *
10491  * Revision 1.147  1994/10/18  08:42:10  yuan
10492  * Avoid the int3.
10493  *
10494  * Revision 1.146  1994/10/17  21:34:57  matt
10495  * Added support for new Control Center/Main Reactor
10496  *
10497  * Revision 1.145  1994/10/15  19:06:34  mike
10498  * Fix bug, maybe, having to do with something or other, ...
10499  *
10500  * Revision 1.144  1994/10/12  21:07:33  matt
10501  * Killed unused field in object structure
10502  *
10503  * Revision 1.143  1994/10/06  14:52:55  mike
10504  * Put check in to detect possibly bogus walls in last segment which leaked through an earlier check
10505  * due to misuse of Highest_segment_index.
10506  *
10507  * Revision 1.142  1994/10/05  22:12:44  mike
10508  * Put in cleanup for matcen/fuelcen links.
10509  *
10510  * Revision 1.141  1994/10/03  11:30:05  matt
10511  * Make sure player in a valid segment before saving
10512  *
10513  * Revision 1.140  1994/09/28  11:14:41  mike
10514  * Better error messaging on bogus mines: Only bring up dialog box if a "real" (level??.*) level.
10515  *
10516  * Revision 1.139  1994/09/28  09:22:58  mike
10517  * Comment out a mprintf.
10518  *
10519  * Revision 1.138  1994/09/27  17:08:36  mike
10520  * Message boxes when you load bogus mines.
10521  *
10522  * Revision 1.137  1994/09/27  15:43:45  mike
10523  * Move the dump stuff to dumpmine.
10524  *
10525  * Revision 1.136  1994/09/27  00:02:31  mike
10526  * Dump text files (".txm") when loading a mine, showing all kinds of useful mine info.
10527  *
10528  * Revision 1.135  1994/09/26  11:30:41  matt
10529  * Took out code which loaded bogus player structure
10530  *
10531  * Revision 1.134  1994/09/26  11:18:44  john
10532  * Fixed some conflicts with newseg.
10533  *
10534  * Revision 1.133  1994/09/26  10:56:58  matt
10535  * Fixed inconsistancies in lifeleft for immortal objects
10536  *
10537  * Revision 1.132  1994/09/25  23:41:10  matt
10538  * Changed the object load & save code to read/write the structure fields one
10539  * at a time (rather than the whole structure at once).  This mean that the
10540  * object structure can be changed without breaking the load/save functions.
10541  * As a result of this change, the local_object data can be and has been
10542  * incorporated into the object array.  Also, timeleft is now a property
10543  * of all objects, and the object structure has been otherwise cleaned up.
10544
10545 ------------------------------------------------------------------------
10546 main/gamesave.h:
10547
10548  * Revision 1.1  1995/05/16  15:57:10  allender
10549  * Initial revision
10550  *
10551  * Revision 2.0  1995/02/27  11:30:25  john
10552  * New version 2.0, which has no anonymous unions, builds with
10553  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10554  *
10555  * Revision 1.11  1994/11/23  12:19:32  mike
10556  * detail level menu.
10557  *
10558  * Revision 1.10  1994/10/20  12:47:30  matt
10559  * Replace old save files (MIN/SAV/HOT) with new LVL files
10560  *
10561  * Revision 1.9  1994/09/27  17:08:47  mike
10562  * Message boxes when you load bogus mines.
10563  *
10564  * Revision 1.8  1994/09/27  15:43:05  mike
10565  * Prototype write_game_text.
10566  *
10567  * Revision 1.7  1994/09/14  15:46:39  matt
10568  * Added function load_mine_only()
10569  *
10570  * Revision 1.6  1994/07/22  12:36:28  matt
10571  * Cleaned up editor/game interactions some more.
10572  *
10573  * Revision 1.5  1994/07/20  13:38:14  matt
10574  * Added get_level_name() prototype
10575  *
10576  * Revision 1.4  1994/06/20  22:19:41  john
10577  * Added Gamesave_num_org_robots.
10578  *
10579  * Revision 1.3  1994/06/14  11:32:49  john
10580  * Made Newdemo record & restore the current mine.
10581  *
10582  * Revision 1.2  1994/05/14  17:16:25  matt
10583  * Got rid of externs in source (non-header) files
10584  *
10585  * Revision 1.1  1994/05/14  16:01:26  matt
10586  * Initial revision
10587
10588 ------------------------------------------------------------------------
10589 main/gameseg.c:
10590
10591  * Revision 1.9  1995/11/08  16:26:04  allender
10592  * minor bug fix in find_connected_distance
10593  *
10594  * Revision 1.8  1995/10/12  17:36:55  allender
10595  * made trace_segs only recurse 100 times max
10596  *
10597  * Revision 1.7  1995/10/11  18:29:01  allender
10598  * removed Int3 from trace_segs
10599  *
10600  * Revision 1.6  1995/10/11  14:13:54  allender
10601  * put in stack check code into trace-segs
10602  *
10603  * Revision 1.5  1995/09/23  09:40:25  allender
10604  * put in casts in extract_shortpos to try and solve shortpos problem
10605  * with appletalk
10606  *
10607  * Revision 1.4  1995/09/20  14:26:50  allender
10608  * added flag to swap bytes on extract shortpot
10609  *
10610  * Revision 1.3  1995/08/12  12:01:27  allender
10611  * added flag to create_shortpos to swap bytes
10612  *
10613  * Revision 1.2  1995/06/06  10:42:07  allender
10614  * made shortpos routines swap bytes when extracting and making shortpos structures
10615  *
10616  * Revision 1.1  1995/05/16  15:25:46  allender
10617  * Initial revision
10618  *
10619  * Revision 2.2  1995/03/20  18:15:39  john
10620  * Added code to not store the normals in the segment structure.
10621  *
10622  * Revision 2.1  1995/03/08  12:11:39  allender
10623  * fix shortpos reading/writing
10624  *
10625  * Revision 2.0  1995/02/27  11:29:21  john
10626  * New version 2.0, which has no anonymous unions, builds with
10627  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10628  *
10629  * Revision 1.78  1995/02/22  13:52:22  allender
10630  * remove anonymous unions from object structure
10631  *
10632  * Revision 1.77  1995/02/22  13:24:47  john
10633  * Removed the vecmat anonymous unions.
10634  *
10635  * Revision 1.76  1995/02/13  20:35:01  john
10636  * Lintized
10637  *
10638  * Revision 1.75  1995/02/09  13:10:51  mike
10639  * remove an annoying mprintf.
10640  *
10641  * Revision 1.74  1995/02/05  17:49:28  rob
10642  * Added assert to gameseg.c.
10643  *
10644  * Revision 1.73  1995/02/02  00:49:26  mike
10645  * new automap segment-depth functionality.
10646  *
10647  * Revision 1.72  1995/01/16  21:06:51  mike
10648  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
10649  *
10650  * Revision 1.71  1994/12/21  19:54:32  matt
10651  * Added error checking
10652  *
10653  * Revision 1.70  1994/12/11  21:34:09  matt
10654  * Changed assert() to int3()
10655  *
10656  * Revision 1.69  1994/12/01  21:04:37  matt
10657  * Several important changes:
10658  *  (1) Checking against triangulated sides has been standardized a bit
10659  *  (2) Code has been added to de-triangulate some sides
10660  *  (3) BIG ONE: the tolerance for checking a point against a plane has
10661  *      been drastically relaxed
10662  *
10663  *
10664  * Revision 1.67  1994/11/27  23:12:21  matt
10665  * Made changes for new mprintf calling convention
10666  *
10667  * Revision 1.66  1994/11/26  22:51:40  matt
10668  * Removed editor-only fields from segment structure when editor is compiled
10669  * out, and padded segment structure to even multiple of 4 bytes.
10670  *
10671  * Revision 1.65  1994/11/22  16:55:38  mike
10672  * use memset in place of loop to clear array.
10673  *
10674  * Revision 1.64  1994/11/19  15:20:37  mike
10675  * rip out unused code and data
10676  *
10677  * Revision 1.63  1994/11/18  18:31:48  matt
10678  * Fixed code again (and maybe for real)
10679  *
10680  * Revision 1.62  1994/11/18  16:54:24  matt
10681  * Fixed extract_orient_from_segment()
10682  *
10683  * Revision 1.61  1994/11/17  14:56:50  mike
10684  * moved segment validation functions from editor to main.
10685  *
10686  * Revision 1.60  1994/11/16  23:38:53  mike
10687  * new improved boss teleportation behavior.
10688  *
10689  * Revision 1.59  1994/10/30  14:12:46  mike
10690  * rip out local segments stuff.
10691  *
10692  * Revision 1.58  1994/10/27  10:53:39  matt
10693  * Made connectivity error checking put up warning if errors found
10694  *
10695  * Revision 1.57  1994/10/25  21:19:26  mike
10696  * debugging code.
10697  *
10698  * Revision 1.56  1994/10/25  11:26:09  mike
10699  * *** empty log message ***
10700  *
10701  * Revision 1.55  1994/10/22  22:36:08  matt
10702  * Improved error finding routine
10703  *
10704  * Revision 1.54  1994/10/22  18:56:51  matt
10705  * Fixed obscure bug in segment trace code
10706  * Added error find routine, check_segment_connections()
10707  *
10708  * Revision 1.53  1994/10/17  14:05:19  matt
10709  * Don't give recursion assert if doing lighting
10710  *
10711  * Revision 1.52  1994/10/15  19:03:48  mike
10712  * Don't do exhaustive search in smooth lighting.
10713  *
10714  * Revision 1.51  1994/10/12  09:46:44  mike
10715  * Add debug code for trapping exhaustive searches.
10716  *
10717  * Revision 1.50  1994/10/11  20:50:41  matt
10718  * Made find_point_seg() take -1 as segnum, meaning to search all segments
10719  *
10720  * Revision 1.49  1994/10/11  17:40:31  matt
10721  * Fixed bug that caused segment trace to only go through sides you can fly through
10722  *
10723  * Revision 1.48  1994/10/10  14:48:16  matt
10724  * Fixed mistake that caused odd pauses and occasional int3's
10725  *
10726  * Revision 1.47  1994/10/09  23:50:41  matt
10727  * Made find_hitpoint_uv() work with triangulated sides
10728  *
10729  * Revision 1.46  1994/10/08  23:06:52  matt
10730  * trace_segs() didn't know about external walls
10731  *
10732  * Revision 1.45  1994/10/07  22:18:57  mike
10733  * Put in asserts to trap bad segnums.
10734  *
10735  * Revision 1.44  1994/10/06  14:08:07  matt
10736  * Added new function, extract_orient_from_segment()
10737  *
10738  * Revision 1.43  1994/10/04  16:24:11  mike
10739  * Set global Connected_segment_distance for debug reasons for aipath.c.
10740  *
10741  * Revision 1.42  1994/10/04  09:18:42  mike
10742  * Comment out a variable definition, preventing a warning message.
10743  *
10744  * Revision 1.41  1994/10/03  23:43:42  mike
10745  * Put in a warning for overrunning point_segs buffer.
10746  *
10747  * Revision 1.40  1994/10/03  20:55:43  rob
10748  * Added velocity to shortpos.
10749  *
10750  * Revision 1.39  1994/09/27  11:46:06  rob
10751  * re-fixed that same bug (ugh).
10752  *
10753  * Revision 1.38  1994/09/27  10:10:51  rob
10754  * Fixed bug in extract_shortpos (obj_relink added).
10755  *
10756  * Revision 1.37  1994/09/25  23:41:02  matt
10757  * Changed the object load & save code to read/write the structure fields one
10758  * at a time (rather than the whole structure at once).  This mean that the
10759  * object structure can be changed without breaking the load/save functions.
10760  * As a result of this change, the local_object data can be and has been
10761  * incorporated into the object array.  Also, timeleft is now a property
10762  * of all objects, and the object structure has been otherwise cleaned up.
10763  *
10764  * Revision 1.36  1994/09/22  19:03:05  mike
10765  * Add shortpos manipulation functions create_shortpos and extract_shortpos.
10766  *
10767  * Revision 1.35  1994/09/19  21:21:16  mike
10768  * Minor optimization to find_connected_distance.
10769  *
10770  * Revision 1.34  1994/09/19  21:05:25  mike
10771  * Write function find_connected_distance,
10772  * returns distance between two points as travellable through the mine.
10773  *
10774  * Revision 1.33  1994/08/30  15:07:15  matt
10775  * Changed find_point_seg() to deal with some infinite recursion problems.
10776  *
10777  * Revision 1.32  1994/08/11  18:58:32  mike
10778  * Use ints in place of shorts for optimization.
10779  *
10780  * Revision 1.31  1994/08/04  00:20:09  matt
10781  * Cleaned up fvi & physics error handling; put in code to make sure objects
10782  * are in correct segment; simplified segment finding for objects and points
10783  *
10784  * Revision 1.30  1994/08/03  16:46:12  mike
10785  * not much...
10786  *
10787  * Revision 1.29  1994/08/02  20:41:31  matt
10788  * Fixed bug in get_side_verts()
10789  *
10790  * Revision 1.28  1994/08/02  19:04:25  matt
10791  * Cleaned up vertex list functions
10792  *
10793  * Revision 1.27  1994/08/01  10:39:44  matt
10794  * find_new_seg() now will look through any kind of wall but a totally solid one
10795  *
10796  * Revision 1.26  1994/07/28  19:15:59  matt
10797  * Fixed yet another bug in get_seg_masks()
10798
10799 ------------------------------------------------------------------------
10800 main/gameseg.h:
10801
10802  * Revision 1.1  1995/05/16  15:57:18  allender
10803  * Initial revision
10804  *
10805  * Revision 2.0  1995/02/27  11:31:20  john
10806  * New version 2.0, which has no anonymous unions, builds with
10807  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10808  *
10809  * Revision 1.24  1995/02/01  16:34:03  john
10810  * Linted.
10811  *
10812  * Revision 1.23  1995/01/16  21:06:36  mike
10813  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
10814  *
10815  * Revision 1.22  1994/11/23  12:18:59  mike
10816  * prototype for level names.
10817  *
10818  * Revision 1.21  1994/11/17  14:56:59  mike
10819  * moved segment validation functions from editor to main.
10820  *
10821  * Revision 1.20  1994/11/16  23:38:46  mike
10822  * new improved boss teleportation behavior.
10823  *
10824  * Revision 1.19  1994/10/30  14:12:14  mike
10825  * rip out local segments stuff.
10826  *
10827  * Revision 1.18  1994/10/09  23:51:07  matt
10828  * Made find_hitpoint_uv() work with triangulated sides
10829  *
10830  * Revision 1.17  1994/10/06  14:08:22  matt
10831  * Added new function, extract_orient_from_segment()
10832  *
10833  * Revision 1.16  1994/09/19  21:05:52  mike
10834  * Prototype for find_connected_distance.
10835  *
10836  * Revision 1.15  1994/08/11  18:58:45  mike
10837  * Change shorts to ints.
10838  *
10839  * Revision 1.14  1994/08/04  00:21:09  matt
10840  * Cleaned up fvi & physics error handling; put in code to make sure objects
10841  * are in correct segment; simplified segment finding for objects and points
10842  *
10843  * Revision 1.13  1994/08/02  19:04:25  matt
10844  * Cleaned up vertex list functions
10845  *
10846  * Revision 1.12  1994/07/21  19:01:53  mike
10847  * lsegment stuff.
10848  *
10849  * Revision 1.11  1994/07/07  09:31:13  matt
10850  * Added comments
10851  *
10852  * Revision 1.10  1994/06/14  12:21:20  matt
10853  * Added new function, find_point_seg()
10854  *
10855  * Revision 1.9  1994/05/29  23:17:38  matt
10856  * Move find_object_seg() from physics.c to gameseg.c
10857  * Killed unused find_point_seg()
10858  *
10859  * Revision 1.8  1994/05/20  11:56:57  matt
10860  * Cleaned up find_vector_intersection() interface
10861  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
10862  *
10863  * Revision 1.7  1994/03/17  18:07:38  yuan
10864  * Removed switch code... Now we just have Walls, Triggers, and Links...
10865  *
10866  * Revision 1.6  1994/02/22  18:14:44  yuan
10867  * Added new wall system
10868  *
10869  * Revision 1.5  1994/02/17  11:33:22  matt
10870  * Changes in object system
10871  *
10872  * Revision 1.4  1994/02/16  13:48:33  mike
10873  * enable editor to compile out.
10874  *
10875  * Revision 1.3  1994/02/14  12:05:07  mike
10876  * change segment data structure.
10877  *
10878  * Revision 1.2  1994/02/10  16:07:20  mike
10879  * separate editor from game based on EDITOR flag.
10880  *
10881  * Revision 1.1  1994/02/09  15:45:38  mike
10882  * Initial revision
10883
10884 ------------------------------------------------------------------------
10885 main/gameseq.c:
10886
10887  * Revision 1.1  1995/12/05  16:02:05  allender
10888  * Initial revision
10889  *
10890  * Revision 1.14  1995/11/03  12:55:30  allender
10891  * shareware changes
10892  *
10893  * Revision 1.13  1995/10/31  10:23:07  allender
10894  * shareware stuff
10895  *
10896  * Revision 1.12  1995/10/18  18:25:02  allender
10897  * call auto_select_weapon after initing ammo since that may
10898  * change the secondary weapon status
10899  *
10900  * Revision 1.11  1995/10/17  13:17:11  allender
10901  * added closebox when entering pilot name
10902  *
10903  * Revision 1.10  1995/09/24  10:56:59  allender
10904  * new players must be looked for in Players directory
10905  *
10906  * Revision 1.9  1995/09/18  08:08:08  allender
10907  * remove netgame binding if at endgame
10908  *
10909  * Revision 1.8  1995/09/14  14:13:01  allender
10910  * initplayerobject have void return
10911  *
10912  * Revision 1.7  1995/08/31  12:54:42  allender
10913  * try and fix bug
10914  *
10915  * Revision 1.6  1995/08/26  16:25:40  allender
10916  * put return values on needed functions
10917  *
10918  * Revision 1.5  1995/08/14  09:26:28  allender
10919  * added byteswap header files
10920  *
10921  * Revision 1.4  1995/08/01  13:57:42  allender
10922  * macified player file stuff -- players stored in seperate folder
10923  *
10924  * Revision 1.3  1995/06/08  12:54:37  allender
10925  * new function for calculating a segment based checksum since the old way
10926  * is byte order dependent
10927  *
10928  * Revision 1.2  1995/06/02  07:42:10  allender
10929  * removed duplicate extern for network_endlevel_poll2
10930  *
10931  * Revision 1.1  1995/05/16  15:25:56  allender
10932  * Initial revision
10933  *
10934  * Revision 2.10  1995/12/19  15:48:25  john
10935  * Made screen reset when loading new level.
10936  *
10937  * Revision 2.9  1995/07/07  16:47:52  john
10938  * Fixed bug with reactor time..
10939  *
10940  * Revision 2.8  1995/06/15  12:14:18  john
10941  * Made end game, win game and title sequences all go
10942  * on after 5 minutes automatically.
10943  *
10944  * Revision 2.7  1995/05/26  16:16:25  john
10945  * Split SATURN into define's for requiring cd, using cd, etc.
10946  * Also started adding all the Rockwell stuff.
10947  *
10948  * Revision 2.6  1995/03/24  13:11:20  john
10949  * Added save game during briefing screens.
10950  *
10951  * Revision 2.5  1995/03/23  17:56:20  allender
10952  * added code to record old laser level and weapons when player gets
10953  * new ship
10954  *
10955  * Revision 2.4  1995/03/21  08:39:14  john
10956  * Ifdef'd out the NETWORK code.
10957  *
10958  * Revision 2.3  1995/03/15  14:33:33  john
10959  * Added code to force the Descent CD-rom in the drive.
10960  *
10961  * Revision 2.2  1995/03/06  16:47:26  mike
10962  * destination saturn
10963  *
10964  * Revision 2.1  1995/03/06  15:23:23  john
10965  * New screen techniques.
10966  *
10967  * Revision 2.0  1995/02/27  11:28:53  john
10968  * New version 2.0, which has no anonymous unions, builds with
10969  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10970  *
10971  * Revision 1.310  1995/02/14  10:48:09  mike
10972  * zero bonus if you are a cheater.
10973  *
10974  * Revision 1.309  1995/02/11  19:17:08  rob
10975  * Fixed bug in laser fire rate after demo playback.
10976  *
10977  * Revision 1.308  1995/02/11  14:34:08  rob
10978  * Added include of netmisc.c
10979  *
10980  * Revision 1.307  1995/02/11  14:29:04  rob
10981  * Fixes for invul. controlcen.
10982  *
10983  * Revision 1.306  1995/02/11  13:47:00  mike
10984  * fix cheats.
10985  *
10986  * Revision 1.305  1995/02/11  13:10:52  rob
10987  * Fixed end of anarchy mission problems.
10988  *
10989  * Revision 1.304  1995/02/11  12:46:12  mike
10990  * initialize Robot_firing_enabled, part of AHIMSA cheat.
10991  *
10992  * Revision 1.303  1995/02/11  12:42:03  john
10993  * Added new song method, with FM bank switching..
10994  *
10995  * Revision 1.302  1995/02/10  17:39:29  matt
10996  * Changed secret exit message to be centered
10997  *
10998  * Revision 1.301  1995/02/10  16:17:33  mike
10999  * init Last_level_path_shown.
11000  *
11001  * Revision 1.300  1995/02/09  22:18:22  john
11002  * Took out between level saves.
11003  *
11004  * Revision 1.299  1995/02/09  12:11:42  rob
11005  * Get rid of high scores thing for multiplayer games.
11006  *
11007  * Revision 1.298  1995/02/08  20:34:24  rob
11008  * Took briefing screens back OUT of coop games (per Interplay request)
11009  *
11010  * Revision 1.297  1995/02/08  19:20:09  rob
11011  * Moved checksum calc.
11012  *
11013  * Revision 1.296  1995/02/05  14:39:24  rob
11014  * Changed object mapping to be more efficient.
11015  *
11016  * Revision 1.295  1995/02/02  19:05:38  john
11017  * Made end level menu for 27 not overwrite descent title..
11018  *
11019  * Revision 1.294  1995/02/02  16:36:42  adam
11020  * *** empty log message ***
11021  *
11022  * Revision 1.293  1995/02/02  15:58:02  john
11023  * Added turbo mode cheat.
11024  *
11025  * Revision 1.292  1995/02/02  15:29:34  matt
11026  * Changed & localized secret level text
11027  *
11028  * Revision 1.291  1995/02/02  10:50:03  adam
11029  * messed with secret level message
11030  *
11031  * Revision 1.290  1995/02/02  01:20:28  adam
11032  * changed endgame song temporarily.
11033  *
11034  * Revision 1.289  1995/02/01  23:19:43  rob
11035  * Fixed up endlevel stuff for multiplayer.
11036  * Put in palette fades around areas that didn't have them before.
11037  *
11038  * Revision 1.288  1995/02/01  17:12:34  mike
11039  * Make score come after endgame screens.
11040  *
11041  * Revision 1.287  1995/01/30  18:34:30  rob
11042  * Put briefing screens back into coop games.
11043  *
11044  * Revision 1.286  1995/01/27  13:07:59  rob
11045  * Removed erroneous warning message.
11046  *
11047  * Revision 1.285  1995/01/27  11:47:43  rob
11048  * Removed new secret level menu from multiplayer games.
11049  *
11050  * Revision 1.284  1995/01/26  22:11:11  mike
11051  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
11052  *
11053  * Revision 1.283  1995/01/26  16:55:13  rob
11054  * Removed ship bonus from cooperative endgame.
11055  *
11056  * Revision 1.282  1995/01/26  16:45:24  mike
11057  * Add autofire fusion cannon stuff.
11058  *
11059  * Revision 1.281  1995/01/26  14:44:44  rob
11060  * Removed unnecessary #ifdefs around mprintfs.
11061  * Changed NumNetPlayerPositions to be independant of MaxNumNetPlayers to
11062  * accomodate 4-player robo-archy games with 8 start positions.
11063  *
11064  * Revision 1.280  1995/01/26  12:19:01  rob
11065  * Changed network_do_frame call.
11066  *
11067  * Revision 1.279  1995/01/26  00:35:03  matt
11068  * Changed numbering convention for HMP files for levels
11069  *
11070  * Revision 1.278  1995/01/25  16:07:59  matt
11071  * Added message (prototype) when going to secret level
11072  *
11073  * Revision 1.277  1995/01/22  18:57:23  matt
11074  * Made player highest level work with missions
11075  *
11076  * Revision 1.276  1995/01/21  23:13:08  matt
11077  * Made high scores with (not work, really) with loaded missions
11078  * Don't give player high score when quit game
11079  *
11080  * Revision 1.275  1995/01/21  17:17:39  john
11081  * *** empty log message ***
11082  *
11083  * Revision 1.274  1995/01/21  17:15:38  john
11084  * Added include for state.h
11085  *
11086  * Revision 1.273  1995/01/21  16:21:14  matt
11087  * Fixed bugs in secret level sequencing
11088  *
11089  * Revision 1.272  1995/01/20  22:47:29  matt
11090  * Mission system implemented, though imcompletely
11091  *
11092  * Revision 1.271  1995/01/19  17:00:48  john
11093  * Made save game work between levels.
11094  *
11095  * Revision 1.270  1995/01/17  17:49:10  rob
11096  * Added key syncing for coop.
11097  *
11098  * Revision 1.269  1995/01/17  14:27:37  john
11099  * y
11100  *
11101  * Revision 1.268  1995/01/17  13:36:33  john
11102  * Moved pig loading into StartNewLevelSub.
11103  *
11104  * Revision 1.267  1995/01/16  16:53:55  john
11105  * Added code to save cheat state during save game.
11106  *
11107  * Revision 1.266  1995/01/15  19:42:10  matt
11108  * Ripped out hostage faces for registered version
11109  *
11110  * Revision 1.265  1995/01/15  16:55:06  john
11111  * Improved mine texture parsing.
11112  *
11113  * Revision 1.264  1995/01/15  11:56:24  john
11114  * Working version of paging.
11115  *
11116  * Revision 1.263  1995/01/14  19:16:40  john
11117  * First version of new bitmap paging code.
11118  *
11119  * Revision 1.262  1995/01/13  17:38:58  yuan
11120  * Removed Int3() for number players check.
11121  *
11122  * Revision 1.261  1995/01/12  12:09:52  yuan
11123  * Added coop object capability.
11124  *
11125  * Revision 1.260  1995/01/05  17:16:08  yuan
11126  * Removed Int3s.
11127  *
11128  * Revision 1.259  1995/01/05  11:34:29  john
11129  * Took out endlevel save stuff for registered.
11130  *
11131  * Revision 1.258  1995/01/04  19:00:16  rob
11132  * Added some debugging for two bugs.
11133  *
11134  * Revision 1.257  1995/01/04  13:18:18  john
11135  * Added cool 6 game save.
11136  *
11137  * Revision 1.256  1995/01/04  08:46:18  rob
11138  * JOHN CHECKED IN FOR ROB !!!
11139  *
11140  * Revision 1.255  1995/01/02  20:07:35  rob
11141  * Added score syncing.
11142  * Get rid of endlevel score for coop games (put it back in elsewhere)
11143  *
11144  * Revision 1.254  1995/01/02  16:17:43  mike
11145  * init super boss.
11146  *
11147  * Revision 1.253  1994/12/21  21:08:47  rob
11148  * fixed a bug in coop player ship positions.
11149  *
11150  * Revision 1.252  1994/12/21  12:57:08  rob
11151  * Handle additional player ships in mines.
11152
11153 ------------------------------------------------------------------------
11154 main/gameseq.h:
11155
11156  * Revision 1.4  1995/10/31  10:22:55  allender
11157  * shareware stuff
11158  *
11159  * Revision 1.3  1995/09/14  14:13:14  allender
11160  * initplayerobject have void return
11161  *
11162  * Revision 1.2  1995/08/24  15:36:17  allender
11163  * fixed prototypes warnings
11164  *
11165  * Revision 1.1  1995/05/16  15:57:26  allender
11166  * Initial revision
11167  *
11168  * Revision 2.0  1995/02/27  11:32:03  john
11169  * New version 2.0, which has no anonymous unions, builds with
11170  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11171  *
11172  * Revision 1.41  1995/02/07  10:51:54  rob
11173  * fix typo.
11174  *
11175  * Revision 1.40  1995/02/06  20:10:16  rob
11176  * Extern'ed DoEndLevelScoreGlitz.
11177  *
11178  * Revision 1.39  1995/02/01  16:34:13  john
11179  * Linted.
11180  *
11181  * Revision 1.38  1995/01/27  11:15:03  rob
11182  * Added extern for player position vars.
11183  *
11184  * Revision 1.37  1995/01/20  22:47:38  matt
11185  * Mission system implemented, though imcompletely
11186  *
11187  * Revision 1.36  1995/01/17  13:36:08  john
11188  * Moved pig loading into StartNewLevelSub.
11189  *
11190  * Revision 1.35  1995/01/04  12:21:28  john
11191  * *** empty log message ***
11192  *
11193  * Revision 1.34  1995/01/04  12:20:47  john
11194  * Declearations to work better with game state save.
11195  *
11196  *
11197  * Revision 1.33  1994/12/08  09:46:35  matt
11198  * Made level name len a multiple of 4 for alignment
11199  *
11200  * Revision 1.32  1994/11/29  16:33:29  rob
11201  * Added new defines for last_secret_level based on shareware or not shareware.
11202  *
11203  * Revision 1.31  1994/11/26  15:30:20  matt
11204  * Allow escape out of change pilot menu
11205  *
11206  * Revision 1.30  1994/11/21  17:29:38  matt
11207  * Cleaned up sequencing & game saving for secret levels
11208  *
11209  * Revision 1.29  1994/11/21  15:55:03  matt
11210  * Corrected LAST_LEVEL
11211  *
11212  * Revision 1.28  1994/11/20  22:12:43  mike
11213  * set LAST_LEVEL based on SHAREWARE.
11214  *
11215  * Revision 1.27  1994/11/09  10:55:51  matt
11216  * Cleaned up initialization for editor -> game transitions
11217  *
11218  * Revision 1.26  1994/11/08  17:50:48  rob
11219  * ADded prototype for StartNewLEvel.
11220  *
11221  *
11222  * Revision 1.25  1994/11/07  17:50:57  rob
11223  * Added extern prototype for init_player_stats_level called for
11224  * network games.
11225  *
11226  * Revision 1.24  1994/10/25  15:40:03  yuan
11227  * *** empty log message ***
11228  *
11229  * Revision 1.23  1994/10/22  00:08:52  matt
11230  * Fixed up problems with bonus & game sequencing
11231  * Player doesn't get credit for hostages unless he gets them out alive
11232  *
11233  * Revision 1.22  1994/10/18  18:57:08  matt
11234  * Added main menu option to enter new player name
11235  *
11236  * Revision 1.21  1994/10/07  23:37:32  matt
11237  * Added prototype
11238  *
11239  * Revision 1.20  1994/10/07  16:02:53  matt
11240  * Loading saved game no longer clears players weapons & other stats
11241  *
11242  * Revision 1.19  1994/10/06  14:12:46  matt
11243  * Added flash effect when player appears
11244  *
11245  * Revision 1.18  1994/10/03  13:34:44  matt
11246  * Added new (and hopefully better) game sequencing functions
11247  *
11248  * Revision 1.17  1994/09/30  15:19:53  matt
11249  * Added new game sequencing functions, but left them disabled for now.
11250  *
11251  * Revision 1.16  1994/09/28  17:24:34  matt
11252  * Added first draft of game save/load system
11253  *
11254  * Revision 1.15  1994/09/27  12:29:42  matt
11255  * Changed level naming
11256  *
11257  * Revision 1.14  1994/09/02  11:53:55  mike
11258  * Rename init_player_stats to init_player_stats_game.
11259  *
11260  * Revision 1.13  1994/08/31  20:57:34  matt
11261  * Cleaned up endlevel/death code
11262  *
11263  * Revision 1.12  1994/08/23  18:45:06  yuan
11264  * Added level 10 capability.. (LEDGES)
11265  *
11266  * Revision 1.11  1994/08/18  10:47:38  john
11267  * Cleaned up game sequencing and player death stuff
11268  * in preparation for making the player explode into
11269  * pieces when dead.
11270  *
11271  * Revision 1.10  1994/08/15  15:24:45  john
11272  * Made players know who killed them; Disabled cheat menu
11273  * during net player; fixed bug with not being able to turn
11274  * of invulnerability; Made going into edit/starting new leve
11275  * l drop you out of a net game; made death dialog box.
11276  *
11277  * Revision 1.9  1994/08/13  12:20:56  john
11278  * Made the networking uise the Players array.
11279  *
11280  * Revision 1.8  1994/07/22  12:36:24  matt
11281  * Cleaned up editor/game interactions some more.
11282  *
11283  * Revision 1.7  1994/07/19  20:15:33  matt
11284  * Name for each level now saved in the .SAV file & stored in Current_level_name
11285  *
11286  * Revision 1.6  1994/07/02  13:49:33  matt
11287  * Cleaned up includes
11288  *
11289  * Revision 1.5  1994/07/02  13:09:52  matt
11290  * Moved player stats struct from gameseq.h to player.h
11291  *
11292  * Revision 1.4  1994/07/01  16:35:35  yuan
11293  * Added key system
11294  *
11295  * Revision 1.3  1994/06/26  14:07:35  matt
11296  * Added prototypes
11297  *
11298  * Revision 1.2  1994/06/24  17:03:56  john
11299  * Added VFX support. Also took all game sequencing stuff like
11300  * EndGame out and put it into gameseq.c
11301  *
11302  * Revision 1.1  1994/06/24  14:13:53  john
11303  * Initial revision
11304
11305 ------------------------------------------------------------------------
11306 main/gauges.c:
11307
11308  * Revision 1.15  1995/10/31  10:22:37  allender
11309  * shareware stuff
11310  *
11311  * Revision 1.14  1995/10/26  14:11:05  allender
11312  * do copy of weapon boxes in cockpit correctly
11313  *
11314  * Revision 1.13  1995/10/21  22:54:56  allender
11315  * fixed up player names on hud
11316  *
11317  * Revision 1.12  1995/10/12  17:39:27  allender
11318  * fixed status bar lives display
11319  *
11320  * Revision 1.11  1995/09/22  15:21:46  allender
11321  * fixed hud problems (reticle and kill lists) for
11322  * non pixel doubled mode
11323  *
11324  * Revision 1.10  1995/09/13  11:38:47  allender
11325  * show KB left in heap instead of piggy cache
11326  *
11327  * Revision 1.9  1995/09/04  15:52:28  allender
11328  * fix vulcan ammo count to update without overwritting itself
11329  *
11330  * Revision 1.8  1995/08/31  14:11:20  allender
11331  * worked on hud kill list for non pixel doubled mode
11332  *
11333  * Revision 1.7  1995/08/24  16:05:05  allender
11334  * more gauge placement -- still not done!
11335  *
11336  * Revision 1.6  1995/08/18  15:44:56  allender
11337  * put in PC gauges for keys, lives, and reticle when pixel doubling
11338  *
11339  * Revision 1.5  1995/08/18  10:24:47  allender
11340  * added proper support for cockpit mode -- still needs
11341  *
11342  * Revision 1.4  1995/07/26  16:56:34  allender
11343  * more gauge stuff for status bar.  still problem
11344  * with ship
11345  *
11346  * Revision 1.3  1995/07/17  08:55:57  allender
11347  * fix up for large status bar.  Still needs some work though
11348  *
11349  * Revision 1.2  1995/06/20  09:54:29  allender
11350  * stopgap measure to get status bar "working" until real mac
11351  * status bar gets added
11352  *
11353  * Revision 1.1  1995/05/16  15:26:05  allender
11354  * Initial revision
11355  *
11356  * Revision 2.7  1995/12/19  16:18:33  john
11357  * Made weapon info align with canvas width, not 315.
11358  *
11359  * Revision 2.6  1995/03/21  14:39:25  john
11360  * Ifdef'd out the NETWORK code.
11361  *
11362  * Revision 2.5  1995/03/14  12:31:25  john
11363  * Prevent negative shields from printing.
11364  *
11365  * Revision 2.4  1995/03/10  12:57:58  allender
11366  * move rear view text up four pixels up when playing back demo
11367  *
11368  * Revision 2.3  1995/03/09  11:47:51  john
11369  * Added HUD for VR helmets.
11370  *
11371  * Revision 2.2  1995/03/06  15:23:26  john
11372  * New screen techniques.
11373  *
11374  * Revision 2.1  1995/02/27  13:13:45  john
11375  * Removed floating point.
11376  *
11377  * Revision 2.0  1995/02/27  11:29:06  john
11378  * New version 2.0, which has no anonymous unions, builds with
11379  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11380  *
11381  * Revision 1.203  1995/02/11  01:56:45  mike
11382  * move up weapons text on fullscreen hud, missiles was offscreen.
11383  *
11384  * Revision 1.202  1995/02/09  13:23:34  rob
11385  * Added reticle names in demo playback.
11386  *
11387  * Revision 1.201  1995/02/08  19:20:46  rob
11388  * Show cloaked teammates on H
11389  * UD.  Get rid of show ID's in anarchy option.
11390  *
11391  * Revision 1.200  1995/02/07  21:09:00  mike
11392  * add flashing to invulnerability and cloak on fullscreen.
11393  *
11394  * Revision 1.199  1995/02/02  21:55:57  matt
11395  * Added new colored key icons for fullscreen
11396  *
11397  * Revision 1.198  1995/01/30  17:17:07  rob
11398  * Fixed teammate names on hud.
11399  *
11400  * Revision 1.197  1995/01/28  17:40:49  mike
11401  * fix gauge fontcolor.
11402  *
11403  * Revision 1.196  1995/01/27  17:03:14  mike
11404  * fix placement of weapon info in multiplayer fullscreen, as per AP request.
11405  *
11406  * Revision 1.195  1995/01/27  11:51:23  rob
11407  * Put deaths tally into cooperative mode
11408  *
11409  * Revision 1.194  1995/01/27  11:43:24  adam
11410  * fiddled with key display
11411  *
11412  * Revision 1.193  1995/01/25  23:38:35  mike
11413  * fix keys on fullscreen.
11414  *
11415  * Revision 1.192  1995/01/24  22:03:28  mike
11416  * Lotsa hud stuff, put a lot of messages up.
11417  *
11418  * Revision 1.191  1995/01/23  16:47:21  rob
11419  * Fixed problem with playing extra life noise in coop.
11420  *
11421  * Revision 1.190  1995/01/22  16:00:46  mike
11422  * remove unneeded string.
11423  *
11424  * Revision 1.189  1995/01/22  15:58:22  mike
11425  * localization
11426  *
11427  * Revision 1.188  1995/01/20  17:19:45  rob
11428  * Fixing colors of hud kill list players.
11429  *
11430  * Revision 1.187  1995/01/20  09:19:18  allender
11431  * record player flags when in CM_FULL_SCREEN
11432  *
11433  * Revision 1.186  1995/01/19  16:29:09  allender
11434  * made demo recording of weapon change be in this file for shareware only
11435  *
11436  * Revision 1.185  1995/01/19  15:00:33  allender
11437  * code to record shield, energy, and ammo in fullscreen
11438  *
11439  * Revision 1.184  1995/01/19  13:43:13  matt
11440  * Fixed "cheater" message on HUD
11441  *
11442  * Revision 1.183  1995/01/18  16:11:58  mike
11443  * Don't show added scores of 0.
11444  *
11445  * Revision 1.182  1995/01/17  17:42:39  allender
11446  * do ammo counts in demo recording
11447  *
11448  * Revision 1.181  1995/01/16  17:26:25  rob
11449  * Fixed problem with coloration of team kill list.
11450  *
11451  * Revision 1.180  1995/01/16  17:22:39  john
11452  * Made so that KB and framerate don't collide.
11453  *
11454  * Revision 1.179  1995/01/16  14:58:31  matt
11455  * Changed score_added display to print "Cheater!" when cheats enabled
11456  *
11457  * Revision 1.178  1995/01/15  19:42:07  matt
11458  * Ripped out hostage faces for registered version
11459  *
11460  * Revision 1.177  1995/01/15  19:25:07  mike
11461  * show vulcan ammo and secondary ammo in fullscreen view.
11462  *
11463  * Revision 1.176  1995/01/15  13:16:12  john
11464  * Made so that paging always happens, lowmem just loads less.
11465  * Also, make KB load print to hud.
11466  *
11467  * Revision 1.175  1995/01/14  19:17:32  john
11468  * First version of piggy paging.
11469  *
11470  * Revision 1.174  1995/01/05  21:25:23  rob
11471  * Re-did some changes lost due to RCS weirdness.
11472  *
11473  * Revision 1.173  1995/01/05  12:22:34  rob
11474  * Don't show player names for cloaked players.
11475  *
11476  * Revision 1.172  1995/01/04  17:14:50  allender
11477  * make init_gauges work properly on demo playback
11478  *
11479  * Revision 1.171  1995/01/04  15:04:42  allender
11480  * new demo calls for registered version
11481  *
11482  * Revision 1.167  1995/01/03  13:03:57  allender
11483  * pass score points instead of total points.   Added ifdef for
11484  * multi_send_score
11485  *
11486  * Revision 1.166  1995/01/03  11:45:02  allender
11487  * add hook to record player score
11488  *
11489  * Revision 1.165  1995/01/03  11:25:19  allender
11490  * remove newdemo stuff around score display
11491  *
11492  * Revision 1.163  1995/01/02  21:03:53  rob
11493  * Fixing up the hud-score-list for coop games.
11494  *
11495  * Revision 1.162  1994/12/31  20:54:40  rob
11496  * Added coop mode HUD score list.
11497  * Added more generic system for player names on HUD.
11498  *
11499  * Revision 1.161  1994/12/30  20:13:01  rob
11500  * Ifdef reticle names on shareware.
11501  * Added robot reticle naming.
11502  *
11503  * Revision 1.160  1994/12/29  17:53:51  mike
11504  * move up energy/shield in fullscreen to get out of way of kill list.
11505  *
11506  * Revision 1.159  1994/12/29  16:44:05  mike
11507  * add energy and shield showing.
11508  *
11509  * Revision 1.158  1994/12/28  16:34:29  mike
11510  * make warning beep go away on Player_is_dead.
11511  *
11512  * Revision 1.157  1994/12/28  10:00:43  allender
11513  * change in init_gauges to for multiplayer demo playbacks
11514  *
11515  * Revision 1.156  1994/12/27  11:06:46  allender
11516  * removed some previous code to for demo playback stuff
11517  *
11518  * Revision 1.155  1994/12/23  14:23:06  john
11519  * Added floating reticle for VR helments.
11520  *
11521  * Revision 1.154  1994/12/21  12:56:41  allender
11522  * on multiplayer demo playback, show kills and deaths
11523  *
11524  * Revision 1.153  1994/12/19  20:28:42  rob
11525  * Get rid of kill list in coop games.
11526  *
11527  * Revision 1.152  1994/12/14  18:06:44  matt
11528  * Removed compile warnings
11529  *
11530  * Revision 1.151  1994/12/14  15:21:28  rob
11531  * Made gauges align in status_bar net game.
11532  *
11533  * Revision 1.150  1994/12/12  17:20:33  matt
11534  * Don't get bonus points when cheating
11535  *
11536  * Revision 1.149  1994/12/12  16:47:00  matt
11537  * When cheating, get no score.  Change level cheat to prompt for and
11538  * jump to new level.
11539  *
11540  * Revision 1.148  1994/12/12  12:05:45  rob
11541  * Grey out players who are disconnected.
11542  *
11543  * Revision 1.147  1994/12/09  16:19:48  yuan
11544  * kill matrix stuff.
11545  *
11546  * Revision 1.146  1994/12/09  16:12:34  rob
11547  * Fixed up the status bar kills gauges for net play.
11548  *
11549  * Revision 1.145  1994/12/09  01:55:34  rob
11550  * Added kills list to HUD/status bar.
11551  * Added something for Mark.
11552  *
11553  * Revision 1.144  1994/12/08  21:03:30  allender
11554  * pass old player flags to record_player_flags
11555  *
11556  * Revision 1.143  1994/12/07  22:49:33  mike
11557  * no homing missile warning during endlevel sequence.
11558  *
11559  * Revision 1.142  1994/12/06  13:55:31  matt
11560  * Use new rounding func, f2ir()
11561  *
11562  * Revision 1.141  1994/12/03  19:03:37  matt
11563  * Fixed vulcan ammo HUD message
11564  *
11565  * Revision 1.140  1994/12/03  18:43:18  matt
11566  * Fixed (hopefully) claok gauge
11567  *
11568  * Revision 1.139  1994/12/03  14:26:21  yuan
11569  * Fixed dumb bug
11570  *
11571  * Revision 1.138  1994/12/03  14:17:30  yuan
11572  * Localization 320
11573
11574 ------------------------------------------------------------------------
11575 main/gauges.h:
11576
11577  * Revision 1.3  1995/08/23  21:37:13  allender
11578  * fix mcc compiler warmings
11579  *
11580  * Revision 1.2  1995/08/18  15:45:24  allender
11581  * upped max gauges
11582  *
11583  * Revision 1.1  1995/05/16  15:57:34  allender
11584  * Initial revision
11585  *
11586  * Revision 2.0  1995/02/27  11:28:45  john
11587  * New version 2.0, which has no anonymous unions, builds with
11588  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11589  *
11590  * Revision 1.27  1994/12/14  18:06:39  matt
11591  * Added prototype
11592  *
11593  * Revision 1.26  1994/12/09  16:19:52  yuan
11594  * kill matrix stuff.
11595  *
11596  * Revision 1.25  1994/10/25  11:07:34  mike
11597  * Prototype play_homing_warning.
11598  *
11599  * Revision 1.24  1994/10/24  16:34:39  mike
11600  * Increase MAX_GAUGE_BMS from 56 to 80...
11601  *
11602  * Revision 1.23  1994/10/21  20:43:47  mike
11603  * Prototype add_bonus_points_to_score.
11604  *
11605  * Revision 1.22  1994/10/14  15:56:33  mike
11606  * Prototype update_laser_weapon_info.
11607  *
11608  * Revision 1.21  1994/10/13  15:17:26  mike
11609  * Remove afterburner references.
11610  *
11611  * Revision 1.20  1994/10/05  17:09:46  matt
11612  * Added functional reticle
11613  *
11614  * Revision 1.19  1994/10/04  21:41:29  matt
11615  * Added cloaked player gauge effect, and different ship bitmap for each player
11616  *
11617  * Revision 1.18  1994/09/26  13:29:40  matt
11618  * Added extra life each 100,000 points, and show icons on HUD for num lives
11619  *
11620  * Revision 1.17  1994/09/20  11:56:08  matt
11621  * Added prototype
11622  *
11623  * Revision 1.16  1994/09/20  00:11:03  matt
11624  * Finished gauges for Status Bar, including hostage video display.
11625  *
11626  * Revision 1.15  1994/09/17  23:57:18  matt
11627  * Got some, but not all, off the status bar gauges working
11628  *
11629  * Revision 1.14  1994/09/16  13:08:46  mike
11630  * Prototype say_afterburner_status.
11631  *
11632  * Revision 1.13  1994/09/14  16:27:03  mike
11633  * Prototype player_dead_message();
11634  *
11635  *
11636  * Revision 1.12  1994/07/20  17:34:43  yuan
11637  * Some minor bug fixes and new key gauges...
11638  *
11639  * Revision 1.11  1994/07/14  14:46:02  yuan
11640  * Added score effect.
11641  *
11642  * Revision 1.10  1994/07/12  16:22:00  yuan
11643  * Increased number of maximum gauges.
11644  *
11645  * Revision 1.9  1994/07/11  20:10:36  yuan
11646  * Numerical gauges.
11647  *
11648  * Revision 1.8  1994/07/10  18:01:28  yuan
11649  * Added new gauges.
11650  *
11651  * Revision 1.7  1994/06/21  15:08:22  john
11652  * Made demo record HUD message and cleaned up the HUD code.
11653  *
11654  * Revision 1.6  1994/06/21  12:40:46  yuan
11655  * Fixing HUD message.
11656  *
11657  * Revision 1.5  1994/06/21  12:11:56  yuan
11658  * Fixed up menus and added HUDisplay messages.
11659  *
11660  * Revision 1.4  1994/04/28  21:34:24  mike
11661  * prototype check_erase_gauge
11662  *
11663  * Revision 1.3  1994/04/06  14:42:46  yuan
11664  * Adding new powerups.
11665  *
11666  * Revision 1.2  1993/12/05  22:48:58  matt
11667  * Reworked include files in an attempt to cut down on build times
11668  *
11669  * Revision 1.1  1993/12/05  21:07:55  matt
11670  * Initial revision
11671
11672 ------------------------------------------------------------------------
11673 main/hostage.c:
11674
11675  * Revision 1.1  1995/05/16  15:26:24  allender
11676  * Initial revision
11677  *
11678  * Revision 2.0  1995/02/27  11:28:36  john
11679  * New version 2.0, which has no anonymous unions, builds with
11680  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11681  *
11682  * Revision 1.65  1995/02/22  13:45:54  allender
11683  * remove anonymous unions from object structure
11684  *
11685  * Revision 1.64  1995/02/13  20:34:57  john
11686  * Lintized
11687  *
11688  * Revision 1.63  1995/01/15  19:41:48  matt
11689  * Ripped out hostage faces for registered version
11690  *
11691  * Revision 1.62  1995/01/14  19:16:53  john
11692  * First version of new bitmap paging code.
11693  *
11694  * Revision 1.61  1994/12/19  16:35:09  john
11695  * Made hoastage playback end when ship dies.
11696  *
11697  * Revision 1.60  1994/12/06  16:30:41  yuan
11698  * Localization
11699  *
11700  * Revision 1.59  1994/11/30  17:32:46  matt
11701  * Put hostage_face_clip array back in so editor would work
11702  *
11703  * Revision 1.58  1994/11/30  17:22:13  matt
11704  * Ripped out hostage faces in shareware version
11705  *
11706  * Revision 1.57  1994/11/30  16:11:25  matt
11707  * Use correct constant for hostage voice
11708  *
11709  * Revision 1.56  1994/11/27  23:15:19  matt
11710  * Made changes for new mprintf calling convention
11711  *
11712  * Revision 1.55  1994/11/19  19:53:44  matt
11713  * Added code to full support different hostage head clip & message for
11714  * each hostage.
11715  *
11716  * Revision 1.54  1994/11/19  16:35:15  matt
11717  * Got rid of unused code, & made an array smaller
11718  *
11719  * Revision 1.53  1994/11/14  12:42:03  matt
11720  * Increased palette flash when hostage rescued
11721  *
11722  * Revision 1.52  1994/10/28  14:43:09  john
11723  * Added sound volumes to all sound calls.
11724  *
11725  * Revision 1.51  1994/10/23  02:10:57  matt
11726  * Got rid of obsolete hostage_info stuff
11727  *
11728  * Revision 1.50  1994/10/22  00:08:44  matt
11729  * Fixed up problems with bonus & game sequencing
11730  * Player doesn't get credit for hostages unless he gets them out alive
11731  *
11732  * Revision 1.49  1994/10/20  22:52:49  matt
11733  * Fixed compiler warnings
11734  *
11735  * Revision 1.48  1994/10/20  21:25:44  matt
11736  * Took out silly scale down/scale up code for hostage anim
11737  *
11738  * Revision 1.47  1994/10/20  12:47:28  matt
11739  * Replace old save files (MIN/SAV/HOT) with new LVL files
11740  *
11741  * Revision 1.46  1994/10/04  15:33:33  john
11742  * Took out the old PLAY_SOUND??? code and replaced it
11743  * with direct calls into digi_link_??? so that all sounds
11744  * can be made 3d.
11745  *
11746  * Revision 1.45  1994/09/28  23:10:46  matt
11747  * Made hostage rescue do palette flash
11748  *
11749  * Revision 1.44  1994/09/20  00:11:00  matt
11750  * Finished gauges for Status Bar, including hostage video display.
11751  *
11752  * Revision 1.43  1994/09/15  21:24:19  matt
11753  * Changed system to keep track of whether & what cockpit is up
11754  * Made hostage clip not queue when no cockpit
11755  *
11756  *
11757  * Revision 1.42  1994/08/25  13:45:19  matt
11758  * Made hostage vclips queue
11759  *
11760  * Revision 1.41  1994/08/14  23:15:06  matt
11761  * Added animating bitmap hostages, and cleaned up vclips a bit
11762  *
11763  * Revision 1.40  1994/08/12  22:41:11  john
11764  * Took away Player_stats; add Players array.
11765  *
11766  * Revision 1.39  1994/07/14  22:06:35  john
11767  * Fix radar/hostage vclip conflict.
11768  *
11769  * Revision 1.38  1994/07/12  18:40:21  yuan
11770  * Tweaked location of radar and hostage screen...
11771  * Still needs work.
11772  *
11773  *
11774  * Revision 1.37  1994/07/07  09:52:17  john
11775  * Moved hostage screen.
11776  *
11777  * Revision 1.36  1994/07/06  15:23:52  john
11778  * Revamped hostage sound.
11779  *
11780  * Revision 1.35  1994/07/06  15:14:54  john
11781  * Added hostage sound effect picking.
11782  *
11783  * Revision 1.34  1994/07/06  13:25:33  john
11784  * Added compress hostages functions.
11785  *
11786  * Revision 1.33  1994/07/06  12:52:59  john
11787  * Fixed compiler warnings.
11788  *
11789  * Revision 1.32  1994/07/06  12:43:50  john
11790  * Made generic messages for hostages.
11791  *
11792  * Revision 1.31  1994/07/06  10:55:07  john
11793  * New structures for hostages.
11794  *
11795  * Revision 1.30  1994/07/05  12:49:09  john
11796  * Put functionality of New Hostage spec into code.
11797  *
11798  * Revision 1.29  1994/07/02  13:08:47  matt
11799  * Increment stats when hostage rescued
11800  *
11801  * Revision 1.28  1994/07/01  18:07:46  john
11802  * y
11803  *
11804  * Revision 1.27  1994/07/01  18:07:03  john
11805  * *** empty log message ***
11806  *
11807  * Revision 1.26  1994/07/01  17:55:26  john
11808  * First version of not-working hostage system.
11809  *
11810  * Revision 1.25  1994/06/27  15:53:21  john
11811  * #define'd out the newdemo stuff
11812  *
11813  *
11814  * Revision 1.24  1994/06/20  16:08:52  john
11815  * Added volume control; made doors 3d sounds.
11816  *
11817  * Revision 1.23  1994/06/16  10:15:32  yuan
11818  * Fixed location of face.
11819  *
11820  * Revision 1.22  1994/06/15  15:05:33  john
11821  * *** empty log message ***
11822  *
11823  * Revision 1.21  1994/06/14  21:15:20  matt
11824  * Made rod objects draw lighted or not depending on a parameter, so the
11825  * materialization effect no longer darkens.
11826  *
11827  * Revision 1.20  1994/06/08  18:16:26  john
11828  * Bunch of new stuff that basically takes constants out of the code
11829  * and puts them into bitmaps.tbl.
11830  *
11831  * Revision 1.19  1994/06/02  19:30:08  matt
11832  * Moved texture-mapped rod drawing stuff (used for hostage & now for the
11833  * materialization center) to object.c
11834
11835 ------------------------------------------------------------------------
11836 main/hostage.h:
11837
11838  * Revision 1.1  1995/05/16  15:57:57  allender
11839  * Initial revision
11840  *
11841  * Revision 2.0  1995/02/27  11:27:50  john
11842  * New version 2.0, which has no anonymous unions, builds with
11843  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11844  *
11845  * Revision 1.23  1995/01/15  19:42:06  matt
11846  * Ripped out hostage faces for registered version
11847  *
11848  * Revision 1.22  1994/12/19  16:35:07  john
11849  * Made hoastage playback end when ship dies.
11850  *
11851  * Revision 1.21  1994/11/30  17:22:12  matt
11852  * Ripped out hostage faces in shareware version
11853  *
11854  * Revision 1.20  1994/11/19  19:53:43  matt
11855  * Added code to full support different hostage head clip & message for
11856  * each hostage.
11857  *
11858  * Revision 1.19  1994/11/19  16:35:28  matt
11859  * Got rid of unused code, & made an array smaller
11860  *
11861  * Revision 1.18  1994/10/23  02:10:57  matt
11862  * Got rid of obsolete hostage_info stuff
11863  *
11864  * Revision 1.17  1994/09/20  00:10:37  matt
11865  * Finished gauges for Status Bar, including hostage video display.
11866  *
11867  * Revision 1.16  1994/09/01  10:41:24  matt
11868  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
11869  * correctly if width & height of bitmap are different.
11870  *
11871  * Revision 1.15  1994/08/14  23:15:14  matt
11872  * Added animating bitmap hostages, and cleaned up vclips a bit
11873  *
11874  * Revision 1.14  1994/07/14  22:06:51  john
11875  * Fix radar/hostage vclip conflict.
11876  *
11877  * Revision 1.13  1994/07/14  22:05:41  john
11878  * Made radar display not conflict with hostage
11879  * vclip talking.
11880  *
11881  * Revision 1.12  1994/07/06  13:41:46  matt
11882  * Added support for bitmap hostages
11883  *
11884  * Revision 1.11  1994/07/06  12:43:36  john
11885  * Made generic messages for hostages.
11886  *
11887  * Revision 1.10  1994/07/06  10:55:09  john
11888  * New structures for hostages.
11889  *
11890  * Revision 1.9  1994/07/05  12:48:47  john
11891  * Put functionality of New Hostage spec into code.
11892  *
11893  * Revision 1.8  1994/07/01  17:55:14  john
11894  * First version of not-working hostage system.
11895  *
11896  * Revision 1.7  1994/06/15  14:57:10  john
11897  * Added triggers to demo recording.
11898  *
11899  * Revision 1.6  1994/06/08  18:15:49  john
11900  * Bunch of new stuff that basically takes constants out of the code
11901  * and puts them into bitmaps.tbl.
11902  *
11903  * Revision 1.5  1994/05/02  12:43:06  yuan
11904  * Fixed warnings.
11905  *
11906  * Revision 1.4  1994/04/06  14:42:46  yuan
11907  * Adding new powerups.
11908  *
11909  * Revision 1.3  1994/04/01  11:15:14  yuan
11910  * Added multiple bitmap functionality to all objects...
11911  * (hostages, powerups, lasers, etc.)
11912  * Hostages and powerups are implemented in the object system,
11913  * just need to finish function call to "affect" player.
11914  *
11915  * Revision 1.2  1994/03/31  12:04:35  matt
11916  * Added prototypes for 2 funcs
11917  *
11918  * Revision 1.1  1994/03/31  11:39:24  matt
11919  * Initial revision
11920
11921 ------------------------------------------------------------------------
11922 main/hud.c:
11923
11924  * Revision 1.4  1995/08/24  16:03:09  allender
11925  * fix up message placement
11926  *
11927  * Revision 1.3  1995/08/18  10:25:21  allender
11928  * added support for pixel doubling using PC game font
11929  *
11930  * Revision 1.2  1995/08/12  11:33:22  allender
11931  * removed #ifdef NEWDEMO -- always in
11932  *
11933  * Revision 1.1  1995/05/16  15:26:32  allender
11934  * Initial revision
11935  *
11936  * Revision 2.2  1995/03/30  16:36:40  mike
11937  * text localization.
11938  *
11939  * Revision 2.1  1995/03/06  15:23:50  john
11940  * New screen techniques.
11941  *
11942  * Revision 2.0  1995/02/27  11:30:41  john
11943  * New version 2.0, which has no anonymous unions, builds with
11944  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11945  *
11946  * Revision 1.27  1995/01/23  16:51:30  mike
11947  * Show hud messages on 3d if window in three largest sizes.
11948  *
11949  * Revision 1.26  1995/01/17  17:42:45  rob
11950  * Made message timeout for HUD messages longer.
11951  *
11952  * Revision 1.25  1995/01/04  11:39:03  rob
11953  * Made HUD text get out of the way of large HUD messages.
11954  *
11955  * Revision 1.24  1995/01/01  14:20:32  rob
11956  * longer timer for hud messages.
11957  *
11958  *
11959  * Revision 1.23  1994/12/15  13:04:34  mike
11960  * Replace Players[Player_num].time_total references with GameTime.
11961  *
11962  * Revision 1.22  1994/12/13  12:55:12  mike
11963  * move press any key to continue message when you are dead to bottom of window.
11964  *
11965  * Revision 1.21  1994/12/07  17:08:01  rob
11966  * removed unnecessary debug info.
11967  *
11968  * Revision 1.20  1994/12/07  16:24:16  john
11969  * Took out code that kept track of messages differently for different
11970  * screen modes... I made it so they just draw differently depending on screen mode.
11971  *
11972  * Revision 1.19  1994/12/07  15:42:57  rob
11973  * Added a bunch of debug stuff to look for HUD message problems in net games...
11974  *
11975  * Revision 1.18  1994/12/06  16:30:35  yuan
11976  * Localization
11977  *
11978  * Revision 1.17  1994/12/05  00:32:36  mike
11979  * fix randomness of color on status bar hud messages.
11980  *
11981  * Revision 1.16  1994/11/19  17:05:53  rob
11982  * Moved dead_player_message down to avoid overwriting HUD messages.
11983  *
11984  * Revision 1.15  1994/11/18  23:37:56  john
11985  * Changed some shorts to ints.
11986  *
11987  * Revision 1.14  1994/11/12  16:38:25  mike
11988  * clear some annoying debug messages.
11989  *
11990  * Revision 1.13  1994/11/11  15:36:39  mike
11991  * write hud messages on background if 3d window small enough
11992  *
11993  * Revision 1.12  1994/10/20  09:49:31  mike
11994  * Reduce number of messages.
11995  *
11996  * Revision 1.11  1994/10/17  10:49:15  john
11997  * Took out some warnings.
11998  *
11999  * Revision 1.10  1994/10/17  10:45:13  john
12000  * Made the player able to abort death by pressing any button or key.
12001  *
12002  * Revision 1.9  1994/10/13  15:17:33  mike
12003  * Remove afterburner references.
12004  *
12005  * Revision 1.8  1994/10/11  12:06:32  mike
12006  * Only show message advertising death sequence abort after player exploded.
12007  *
12008  * Revision 1.7  1994/10/10  17:21:53  john
12009  * Made so instead of saying too many messages, it scrolls off the
12010  * oldest message.
12011  *
12012  * Revision 1.6  1994/10/07  23:05:39  john
12013  * Fixed bug with HUD not drawing stuff sometimes...
12014  * ( I had a circular buffer that I was stepping thru
12015  * to draw text that went: for (i=first;i<last;i++)...
12016  * duh!! last could be less than first.)
12017  * /
12018  *
12019  * Revision 1.5  1994/09/16  13:08:20  mike
12020  * Arcade stuff, afterburner stuff.
12021  *
12022  * Revision 1.4  1994/09/14  16:26:57  mike
12023  * player_dead_message.
12024  *
12025  * Revision 1.3  1994/08/18  16:35:45  john
12026  * Made gauges messages stay up a bit longer.
12027  *
12028  * Revision 1.2  1994/08/18  12:10:21  john
12029  * Made HUD messages scroll.
12030  *
12031  * Revision 1.1  1994/08/18  11:22:09  john
12032  * Initial revision
12033
12034 ------------------------------------------------------------------------
12035 main/inferno.c:
12036
12037  * Revision 1.1  1995/12/05  15:57:49  allender
12038  * Initial revision
12039  *
12040  * Revision 1.19  1995/11/07  17:03:12  allender
12041  * added splash screen for descent contest
12042  *
12043  * Revision 1.18  1995/10/31  10:22:22  allender
12044  * shareware stuff
12045  *
12046  * Revision 1.17  1995/10/18  01:53:07  allender
12047  * mouse click to leave do not distribute screen
12048  *
12049  * Revision 1.16  1995/10/17  12:00:12  allender
12050  * mouse click gets past endgame screen
12051  *
12052  * Revision 1.15  1995/10/12  17:40:12  allender
12053  * read config file after digi initialized
12054  *
12055  * Revision 1.14  1995/10/05  10:38:22  allender
12056  * changed key_getch at exit to be key_inkey and moved
12057  * mouse init until after macintosh windowing init call
12058  *
12059  * Revision 1.13  1995/09/18  17:01:04  allender
12060  * put gr_init call before render buffer stuff
12061  *
12062  * Revision 1.12  1995/08/31  15:50:53  allender
12063  * call init for appletalk, and change name of intro screens
12064  *
12065  * Revision 1.11  1995/08/26  16:26:19  allender
12066  * whole bunch 'o stuff!!
12067  *
12068  * Revision 1.10  1995/07/12  21:48:18  allender
12069  * removed Int3 from beginning of program
12070  *
12071  * Revision 1.9  1995/07/05  16:45:48  allender
12072  * removed hide_cursor call
12073  *
12074  * Revision 1.8  1995/06/20  16:44:57  allender
12075  * game now renders in 640x480 at all times.  Changed code
12076  * to call game_init_render_buffers with right params
12077  *
12078  * Revision 1.7  1995/06/13  13:07:55  allender
12079  * change macintosh initialzation.  Mac windows now init'ed through gr_init.
12080  *
12081  * Revision 1.6  1995/06/08  16:36:53  allender
12082  * "ifdef" profile include
12083  *
12084  * Revision 1.5  1995/06/07  08:08:18  allender
12085  * dont' make memory info show at end of program
12086  *
12087  * Revision 1.4  1995/06/02  07:47:40  allender
12088  * removed network initialzation for now
12089  *
12090  * Revision 1.3  1995/05/26  06:54:52  allender
12091  * put digi_init after timer and key stuff since I was testing stuff
12092  * that needed the keyboard handler installed
12093  *
12094  * Revision 1.2  1995/05/19  11:28:09  allender
12095  * removed printf
12096  *
12097  * Revision 1.1  1995/05/16  15:26:39  allender
12098  * Initial revision
12099  *
12100  * Revision 2.36  1996/01/05  16:52:16  john
12101  * Improved 3d stuff.
12102  *
12103  * Revision 2.35  1995/10/07  13:20:06  john
12104  * Added new modes for LCDBIOS, also added support for -JoyNice,
12105  * and added Shift+F1-F4 to controls various stereoscopic params.
12106  *
12107  * Revision 2.34  1995/06/26  11:30:57  john
12108  * Made registration/copyright screen go away after 5 minutes.
12109  *
12110  * Revision 2.33  1995/05/31  14:26:55  unknown
12111  * Fixed ugly spacing.
12112  *
12113  * Revision 2.32  1995/05/26  16:15:28  john
12114  * Split SATURN into define's for requiring cd, using cd, etc.
12115  * Also started adding all the Rockwell stuff.
12116  *
12117  * Revision 2.31  1995/05/11  13:30:01  john
12118  * Changed 3dbios detection to work like Didde Kim wanted it to.
12119  *
12120  * Revision 2.30  1995/05/08  13:53:50  john
12121  * Added code to read vipport environemnt variable.
12122  *
12123  * Revision 2.29  1995/05/08  11:26:18  john
12124  * Reversed eyes in 3dmax mode.
12125  *
12126  * Revision 2.28  1995/05/08  11:24:06  john
12127  * Made 3dmax work like Kasan wants it to.
12128  *
12129  * Revision 2.27  1995/04/23  16:06:25  john
12130  * Moved rinvul into modem/null modem menu.
12131  *
12132  * Revision 2.26  1995/04/12  13:39:26  john
12133  * Fixed bug with -lowmem not working.
12134  *
12135  * Revision 2.25  1995/04/09  14:43:00  john
12136  * Made Dynamic sockets not print Msockets for help.
12137  *
12138  * Revision 2.24  1995/04/07  16:11:33  john
12139  * Fixed problem with VFX display when using setup.
12140  *
12141  * Revision 2.23  1995/04/06  15:40:51  john
12142  * Synced VFX with setup #'s.
12143  *
12144  * Revision 2.22  1995/04/06  12:12:53  john
12145  * Fixed some bugs with 3dmax.
12146  *
12147  * Revision 2.21  1995/03/30  16:36:51  mike
12148  * text localization.
12149  *
12150  * Revision 2.20  1995/03/29  15:33:52  john
12151  * Added code to parse descent.net file.
12152  *
12153  * Revision 2.19  1995/03/28  20:08:21  john
12154  * Took away alternate server thing.
12155  *
12156  * Revision 2.18  1995/03/27  09:43:08  john
12157  * Added VR Settings in config file.
12158  *
12159  * Revision 2.17  1995/03/23  19:02:21  john
12160  * Added descent.net file use.
12161  *
12162  * Revision 2.16  1995/03/23  12:25:11  john
12163  * Moved IPX stuff into BIOS lib.
12164  *
12165  * Revision 2.15  1995/03/21  16:52:34  john
12166  * Added 320x100.
12167  *
12168  * Revision 2.14  1995/03/21  14:40:33  john
12169  * Ifdef'd out the NETWORK code.
12170  *
12171  * Revision 2.13  1995/03/16  23:13:35  john
12172  * Fixed bug with piggy paging in bitmap not checking for disk
12173  * error, hence bogifying textures if you pull the CD out.
12174  *
12175  * Revision 2.12  1995/03/16  21:45:22  john
12176  * Made all paged modes have incompatible menus!
12177  *
12178  * Revision 2.11  1995/03/15  15:19:34  john
12179  * Took out code that changes to exe dir.
12180  *
12181  * Revision 2.10  1995/03/15  14:33:37  john
12182  * Added code to force the Descent CD-rom in the drive.
12183  *
12184  * Revision 2.9  1995/03/15  11:41:27  john
12185  * Better Saturn CD-ROM support.
12186  *
12187  * Revision 2.8  1995/03/14  18:24:46  john
12188  * Force Destination Saturn to use CD-ROM drive.
12189  *
12190  * Revision 2.7  1995/03/14  16:22:35  john
12191  * Added cdrom alternate directory stuff.
12192  *
12193  * Revision 2.6  1995/03/13  15:17:19  john
12194  * Added alternate hogfile directory.
12195  *
12196  * Revision 2.5  1995/03/10  13:05:35  john
12197  * Added code so that palette is correct for VFX1 helmets.
12198  *
12199  * Revision 2.4  1995/03/07  15:12:43  john
12200  * Fixed VFX,3dmax support.
12201  *
12202  * Revision 2.3  1995/03/07  14:19:35  mike
12203  * More destination saturn stuff.
12204  *
12205  * Revision 2.2  1995/03/06  16:47:34  mike
12206  * destination saturn
12207  *
12208  * Revision 2.1  1995/03/06  15:24:06  john
12209  * New screen techniques.
12210  *
12211  * Revision 2.0  1995/02/27  11:31:29  john
12212  * New version 2.0, which has no anonymous unions, builds with
12213  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12214  *
12215  * Revision 1.295  1995/02/23  12:02:14  john
12216  * Made mono  windows smaller.
12217  *
12218  * Revision 1.294  1995/02/16  17:35:00  john
12219  * Added code to allow dynamic socket changing.
12220  *
12221  * Revision 1.293  1995/02/14  19:29:29  john
12222  * Locked down critical error handler.
12223  *
12224  * Revision 1.292  1995/02/14  15:29:20  john
12225  * Added CR-LF to last line of menu help text.
12226  *
12227  * Revision 1.291  1995/02/14  11:39:01  john
12228  * Added polled/bios joystick readers.
12229  *
12230  * Revision 1.290  1995/02/13  20:35:03  john
12231  * Lintized
12232  *
12233  * Revision 1.289  1995/02/11  16:20:02  john
12234  * Added code to make the default mission be the one last played.
12235  *
12236  * Revision 1.288  1995/02/11  15:54:13  rob
12237  * changed cinvul to rinvul.
12238  *
12239  * Revision 1.287  1995/02/11  14:48:43  rob
12240  * Added max of 314 seconds to control invul. times
12241  *
12242  * Revision 1.286  1995/02/11  12:42:01  john
12243  * Added new song method, with FM bank switching..
12244  *
12245  * Revision 1.285  1995/02/11  11:36:11  rob
12246  * Added cinvul option.
12247  *
12248  * Revision 1.284  1995/02/10  16:07:45  matt
12249  * Took 'registered' out of printed info at startup
12250  *
12251  * Revision 1.283  1995/02/09  22:00:59  john
12252  * Added i-glasses tracking.
12253  *
12254  * Revision 1.282  1995/02/02  11:11:27  john
12255  * Added -nocyberman switch.
12256  *
12257  * Revision 1.281  1995/02/01  16:35:14  john
12258  * Linted.
12259  *
12260  * Revision 1.280  1995/01/31  02:04:25  matt
12261  * Fixed up cmdline help
12262  *
12263  * Revision 1.279  1995/01/30  16:25:55  john
12264  * Put back in graphical screen at program end.
12265  *
12266  * Revision 1.278  1995/01/28  17:05:50  matt
12267  * Changed imbedded copyright to use comma instead of hyphen
12268  *
12269  * Revision 1.277  1995/01/28  15:57:26  john
12270  * Made joystick calibration be only when wrong detected in
12271  * menu or joystick axis changed.
12272  *
12273  * Revision 1.276  1995/01/25  14:37:49  john
12274  * Made joystick only prompt for calibration once...
12275  *
12276  * Revision 1.275  1995/01/24  18:21:00  john
12277  * Added Adam's text warning.
12278  *
12279  * Revision 1.274  1995/01/22  15:57:20  john
12280  * Took out code that printed warning out as game exited.
12281  *
12282  * Revision 1.273  1995/01/22  13:31:35  matt
12283  * Added load of mission 0, so there's always a default mission
12284  *
12285  * Revision 1.272  1995/01/19  17:00:41  john
12286  * Made save game work between levels.
12287  *
12288  * Revision 1.271  1995/01/18  11:47:57  adam
12289  * changed copyright notice
12290  *
12291  * Revision 1.270  1995/01/15  13:42:42  john
12292  * Moved low_mem cutoff higher.
12293  *
12294  * Revision 1.269  1995/01/12  18:53:50  john
12295  * Put ifdef EDITOR around the code that checked for
12296  * a 800x600 mode, because this trashed some people's
12297  * computers (maybe) causing the mem allocation error in
12298  * mouse.c that many users reported.
12299  *
12300  * Revision 1.268  1995/01/12  11:41:42  john
12301  * Added external control reading.
12302  *
12303  * Revision 1.267  1995/01/06  10:26:55  john
12304  * Added -nodoscheck command line switch.
12305  *
12306  * Revision 1.266  1995/01/05  16:59:30  yuan
12307  * Don't show orderform in editor version.
12308  *
12309  * Revision 1.265  1994/12/28  15:33:51  john
12310  * Added -slowjoy option.
12311  *
12312  * Revision 1.264  1994/12/15  16:44:15  matt
12313  * Added trademark notice
12314  *
12315  * Revision 1.263  1994/12/14  20:13:59  john
12316  * Reduced physical mem requments to 2 MB.
12317  *
12318  * Revision 1.262  1994/12/14  19:06:17  john
12319  * Lowered physical memory requments to 2 MB.
12320  *
12321  * Revision 1.261  1994/12/14  09:41:29  allender
12322  * change to drive and directory (if needed) of command line invocation
12323  * so descent can be started from anywhere
12324  *
12325  * Revision 1.260  1994/12/13  19:08:59  john
12326  * Updated memory requirements.
12327  *
12328  * Revision 1.259  1994/12/13  17:30:33  john
12329  * Made the timer rate be changed right after initializing it.
12330  *
12331  * Revision 1.258  1994/12/13  02:46:25  matt
12332  * Added imbedded copyright
12333  *
12334  * Revision 1.257  1994/12/13  02:06:46  john
12335  * Added code to check stack used by descent... initial
12336  * check showed stack used 35k/50k, so we decided it wasn't
12337  * worth pursuing any more.
12338  *
12339  * Revision 1.256  1994/12/11  23:17:54  john
12340  * Added -nomusic.
12341  * Added RealFrameTime.
12342  * Put in a pause when sound initialization error.
12343  * Made controlcen countdown and framerate use RealFrameTime.
12344  *
12345  * Revision 1.255  1994/12/10  00:56:51  matt
12346  * Added -nomusic to command-line help
12347  *
12348  * Revision 1.254  1994/12/08  11:55:11  john
12349  * Took out low memory print.
12350  *
12351  * Revision 1.253  1994/12/08  11:51:00  john
12352  * Made strcpy only copy corect number of chars,.
12353  *
12354  * Revision 1.252  1994/12/08  00:38:29  matt
12355  * Cleaned up banner messages
12356  *
12357  * Revision 1.251  1994/12/07  19:14:52  matt
12358  * Cleaned up command-line options and command-line help message
12359  *
12360  * Revision 1.250  1994/12/06  19:33:28  john
12361  * Fixed text of message to make more sense.
12362  *
12363  * Revision 1.249  1994/12/06  16:30:55  john
12364  * Neatend mem message,..
12365  *
12366  * Revision 1.248  1994/12/06  16:17:35  john
12367  * Added better mem checking/printing.
12368  *
12369  * Revision 1.247  1994/12/06  14:14:37  john
12370  * Added code to set low mem based on memory.
12371  *
12372  * Revision 1.246  1994/12/05  12:29:09  allender
12373  * removed ifdefs around -norun option
12374  *
12375  * Revision 1.245  1994/12/05  00:03:30  matt
12376  * Added -norun option to exit after writing pig
12377  *
12378  * Revision 1.244  1994/12/04  14:47:01  john
12379  * MAde the intro and menu be the same song.
12380  *
12381  * Revision 1.243  1994/12/04  14:36:42  john
12382  * Added menu music.
12383  *
12384  * Revision 1.242  1994/12/02  13:50:17  yuan
12385  * Localization.
12386  *
12387  * Revision 1.241  1994/12/01  17:28:30  adam
12388  * added end-shareware stuff
12389  *
12390  * Revision 1.240  1994/11/30  12:10:57  adam
12391  * added support for PCX titles/brief screens
12392  *
12393  * Revision 1.239  1994/11/29  15:47:33  matt
12394  * Moved error_init to start of game, so error message prints last
12395  *
12396  * Revision 1.238  1994/11/29  14:19:22  jasen
12397  * reduced dos mem requirments.
12398  *
12399  * Revision 1.237  1994/11/29  03:46:35  john
12400  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
12401  * command line arg.
12402  *
12403  * Revision 1.236  1994/11/29  02:50:18  john
12404  * Increased the amount a joystick has to be off before
12405  * asking if they want to recalibrate their joystick.
12406  *
12407  * Revision 1.235  1994/11/29  02:01:29  john
12408  * Corrected some of the Descent command line help items.
12409  *
12410  * Revision 1.234  1994/11/29  01:39:56  john
12411  * Fixed minor bug with vfx_light help not wrapping correctly.
12412  *
12413  * Revision 1.233  1994/11/28  21:34:17  john
12414  * Reduced dos mem rqment to 70k.
12415  *
12416  * Revision 1.232  1994/11/28  21:20:38  john
12417  * First version with memory checking.
12418  *
12419  * Revision 1.231  1994/11/28  20:06:21  rob
12420  * Removed old serial param command line options.
12421  * Added -noserial and -nonetwork to help listing.
12422  *
12423  * Revision 1.230  1994/11/27  23:15:24  matt
12424  * Made changes for new mprintf calling convention
12425  *
12426  * Revision 1.229  1994/11/27  20:50:51  matt
12427  * Don't set mem stuff if no debug
12428  *
12429  * Revision 1.228  1994/11/27  18:46:21  matt
12430  * Cleaned up command-line switches a little
12431  *
12432  * Revision 1.227  1994/11/21  17:48:00  matt
12433  * Added text to specifiy whether shareware or registered version
12434  *
12435  * Revision 1.226  1994/11/21  14:44:20  john
12436  * Fixed some bugs with setting volumes even when -nosound was used. Duh!
12437  *
12438  * Revision 1.225  1994/11/21  13:53:42  matt
12439  * Took out dos extender copyright
12440  *
12441  * Revision 1.224  1994/11/21  09:46:54  john
12442  * Added -showmeminfo parameter.
12443  *
12444  * Revision 1.223  1994/11/20  22:12:05  mike
12445  * Make some stuff dependent on SHAREWARE.
12446  *
12447  * Revision 1.222  1994/11/20  21:14:09  john
12448  * Changed -serial to -noserial.  MAde a 1 sec delay
12449  * before leaving title screen.  Clear keyboard buffer
12450  * before asking for player name.
12451  *
12452  * Revision 1.221  1994/11/19  15:20:20  mike
12453  * rip out unused code and data
12454  *
12455  * Revision 1.220  1994/11/17  19:14:29  adam
12456  * prevented order screen from coming up when -notitles is used
12457  *
12458  * Revision 1.219  1994/11/16  11:34:39  john
12459  * Added -nottitle switch.
12460  *
12461  * Revision 1.218  1994/11/16  10:05:53  john
12462  * Added verbose messages.
12463  *
12464  * Revision 1.217  1994/11/15  20:12:34  john
12465  * Added back in inferno and parallax screens.
12466  *
12467  * Revision 1.216  1994/11/15  18:35:30  john
12468  * Added verbose setting.
12469  *
12470  * Revision 1.215  1994/11/15  17:47:44  john
12471  * Added ordering info screen.
12472  *
12473  * Revision 1.214  1994/11/15  08:57:44  john
12474  * Added MS-DOS version checking and -nonetwork option.
12475  *
12476  * Revision 1.213  1994/11/15  08:34:32  john
12477  * Added better error messages for IPX init.
12478  *
12479  * Revision 1.212  1994/11/14  20:14:18  john
12480  * Fixed some warnings.
12481  *
12482  * Revision 1.211  1994/11/14  19:50:49  john
12483  * Added joystick cal values to descent.cfg.
12484  *
12485  * Revision 1.210  1994/11/14  17:56:44  allender
12486  * make call to ReadConfigFile at startup
12487  *
12488  * Revision 1.209  1994/11/14  11:41:55  john
12489  * Fixed bug with editor/game sequencing.
12490  *
12491  * Revision 1.208  1994/11/13  17:05:11  john
12492  * Made the callsign entry be a list box and gave the ability
12493  * to delete players.
12494  *
12495  * Revision 1.207  1994/11/13  15:39:22  john
12496  * Added critical error handler to game.  Took out -editor command line
12497  * option because it didn't work anymore and wasn't worth fixing.  Made scores
12498  * not use MINER enviroment variable on release version, and made scores
12499  * not print an error if there is no descent.hi.
12500  *
12501  * Revision 1.206  1994/11/10  20:53:29  john
12502  * Used new sound install parameters.
12503  *
12504  * Revision 1.205  1994/11/10  11:07:52  mike
12505  * Set default detail level.
12506  *
12507  * Revision 1.204  1994/11/09  13:45:43  matt
12508  * Made -? work again for help
12509  *
12510  * Revision 1.203  1994/11/09  10:55:58  matt
12511  * Cleaned up initialization for editor -> game transitions
12512  *
12513  * Revision 1.202  1994/11/07  21:35:47  matt
12514  * Use new function iff_read_into_bitmap()
12515  *
12516  * Revision 1.201  1994/11/05  17:22:16  john
12517  * Fixed lots of sequencing problems with newdemo stuff.
12518  *
12519  * Revision 1.200  1994/11/05  14:05:44  john
12520  * Fixed fade transitions between all screens by making
12521  * gr_palette_fade_in and out keep track of whether the palette is
12522  * faded in or not.  Then, wherever the code needs to fade out, it
12523  * just calls gr_palette_fade_out and it will fade out if it isn't
12524  * already.  The same with fade_in.
12525  * This eliminates the need for all the flags like Menu_fade_out,
12526  * game_fade_in palette, etc.
12527  *
12528  * Revision 1.199  1994/11/04  14:36:30  allender
12529  * change Auto_demo meaning to mean autostart from menu only.  Use
12530  * FindArgs when searching for AutoDemo from command line.  also,
12531  * set N_Players to 1 when starting in editor mode.
12532  *
12533  * Revision 1.198  1994/11/02  11:59:49  john
12534  * Moved menu out of game into inferno main loop.
12535  *
12536  * Revision 1.197  1994/11/01  17:57:39  mike
12537  * -noscreens option to bypass all screens.
12538  *
12539  * Revision 1.196  1994/10/28  15:42:34  allender
12540  * don't register player if Autodemo is on
12541  *
12542  * Revision 1.195  1994/10/28  10:58:01  matt
12543  * Added copyright notice for DOS4GW
12544  *
12545  * Revision 1.194  1994/10/20  21:26:48  matt
12546  * Took out old serial name/number code, and put up message if this
12547  * is a marked version.
12548  *
12549  * Revision 1.193  1994/10/19  09:52:14  allender
12550  * Print out who descent.exe belongs to if descent.exe is stamped.
12551  *
12552  * Revision 1.192  1994/10/18  16:43:05  allender
12553  * Added check for identifier stamp and time after which descent will
12554  * no longer run.
12555  *
12556  * Revision 1.191  1994/10/17  13:07:17  john
12557  * Moved the descent.cfg info into the player config file.
12558  *
12559  * Revision 1.190  1994/10/04  10:26:31  matt
12560  * Support new menu fade in
12561  *
12562  * Revision 1.189  1994/10/03  22:58:46  matt
12563  * Changed some values of game_mode
12564  *
12565  * Revision 1.188  1994/10/03  18:55:39  rob
12566  * Changed defaults for com port settings.
12567  *
12568  * Revision 1.187  1994/10/03  13:34:47  matt
12569  * Added new (and hopefully better) game sequencing functions
12570  *
12571  * Revision 1.186  1994/09/30  12:37:28  john
12572  * Added midi,digi volume to configuration.
12573  *
12574  * Revision 1.185  1994/09/30  10:08:48  john
12575  * Changed sound stuff... made it so the reseting card doesn't hang,
12576  * made volume change only if sound is installed.
12577  *
12578  * Revision 1.184  1994/09/28  17:25:00  matt
12579  * Added first draft of game save/load system
12580  *
12581  * Revision 1.183  1994/09/28  16:18:23  john
12582  * Added capability to play midi song.
12583  *
12584  * Revision 1.182  1994/09/28  11:31:18  john
12585  * Made text output unbuffered.
12586  *
12587  * Revision 1.181  1994/09/27  19:23:44  john
12588  * Added -nojoystick and -nomouse
12589  *
12590  * Revision 1.180  1994/09/24  16:55:29  rob
12591  * No longer open COM port immediately upon program start.
12592  * No longer set Network_active is serial_active is set.
12593  *
12594  * Revision 1.179  1994/09/24  14:16:30  mike
12595  * Support new game mode constants.
12596  *
12597  * Revision 1.178  1994/09/22  17:52:31  rob
12598  * Added Findargs hooks for -serial, -speed, and -com.
12599  *
12600  * Revision 1.177  1994/09/22  16:14:11  john
12601  * Redid intro sequecing.
12602  *
12603  * Revision 1.176  1994/09/21  16:32:58  john
12604  * Made mouse and keyboard init after bm_init. Why?
12605  * Because it seems to work better under virtual
12606  * memory.
12607  *
12608  * Revision 1.175  1994/09/21  16:27:52  john
12609  * Added mouse_init
12610  *
12611  * Revision 1.174  1994/09/20  15:14:10  matt
12612  * New message for new VFX switches
12613  *
12614  * Revision 1.173  1994/09/16  16:14:27  john
12615  * Added acrade sequencing.
12616  *
12617  * Revision 1.172  1994/09/16  11:49:52  john
12618  * Added first version of arcade joystick support;
12619  * Also fixed some bugs in kconfig.c, such as reading non-present
12620  * joysticks, which killed frame rate, and not reading key_down_time
12621  * when in slide mode or bank mode.
12622  *
12623  * Revision 1.171  1994/09/15  16:11:35  john
12624  * Added support for VFX1 head tracking. Fixed bug with memory over-
12625  * write when using stereo mode.
12626  *
12627  * Revision 1.170  1994/09/12  19:38:23  john
12628  * Made some stuff that prints to the DOS screen go to the
12629  * mono instead, since it really is debugging info.
12630  *
12631  * Revision 1.169  1994/08/29  21:18:28  john
12632  * First version of new keyboard/oystick remapping stuff.
12633  *
12634  * Revision 1.168  1994/08/26  13:02:00  john
12635  * Put high score system in.
12636  *
12637  * Revision 1.167  1994/08/24  19:00:23  john
12638  * Changed key_down_time to return fixed seconds instead of
12639  * milliseconds.
12640  *
12641  * Revision 1.166  1994/08/18  16:24:20  john
12642  * changed socket to channel in text.
12643  *
12644  * Revision 1.165  1994/08/18  16:16:51  john
12645  * Added support for different sockets.
12646  *
12647  * Revision 1.164  1994/08/18  10:47:53  john
12648  * *** empty log message ***
12649  *
12650  * Revision 1.163  1994/08/12  09:15:54  john
12651  * *** empty log message ***
12652  *
12653  * Revision 1.162  1994/08/12  03:11:19  john
12654  * Made network be default off; Moved network options into
12655  * main menu.  Made starting net game check that mines are the
12656  * same.
12657  *
12658  * Revision 1.161  1994/08/10  19:57:05  john
12659  * Changed font stuff; Took out old menu; messed up lots of
12660  * other stuff like game sequencing messages, etc.
12661  *
12662  * Revision 1.160  1994/08/05  16:30:23  john
12663  * Added capability to turn off network.
12664  *
12665  * Revision 1.159  1994/08/04  19:42:51  matt
12666  * Moved serial number & name (and version name) from inferno.c to inferno.ini
12667  *
12668  * Revision 1.158  1994/08/03  10:30:23  matt
12669  * Change cybermaxx switches, updated command-line help, and added serial number system
12670  *
12671  * Revision 1.157  1994/07/29  18:30:10  matt
12672  * New parms (lack of parms, actually) for g3_init()
12673  *
12674  * Revision 1.156  1994/07/24  00:39:25  matt
12675  * Added more text to TEX file; make NewGame() take a start level; made game
12676  * load/save menus use open/close window funcs.
12677  *
12678  * Revision 1.155  1994/07/21  21:31:27  john
12679  * First cheapo version of VictorMaxx tracking.
12680  *
12681  * Revision 1.154  1994/07/21  18:15:34  matt
12682  * Ripped out a bunch of unused stuff
12683  *
12684  * Revision 1.153  1994/07/21  17:59:10  matt
12685  * Cleaned up initial mode game/editor code
12686  *
12687  * Revision 1.152  1994/07/21  13:11:19  matt
12688  * Ripped out remants of old demo system, and added demo only system that
12689  * disables object movement and game options from menu.
12690  *
12691  * Revision 1.151  1994/07/20  15:58:27  john
12692  * First installment of ipx stuff.
12693  *
12694  * Revision 1.150  1994/07/15  16:04:24  matt
12695  * Changed comment for milestone 3 version
12696  *
12697  * Revision 1.149  1994/07/15  13:59:24  matt
12698  * Fixed stupid mistake I make in the last revision
12699  *
12700  * Revision 1.148  1994/07/15  13:20:15  matt
12701  * Updated comand-line help
12702  *
12703  * Revision 1.147  1994/07/14  23:29:43  matt
12704  * Open two mono debug messages, one for errors & one for spew
12705  *
12706  * Revision 1.146  1994/07/09  22:48:05  matt
12707  * Added localizable text
12708  *
12709  * Revision 1.145  1994/07/02  13:49:47  matt
12710  * Cleaned up includes
12711  *
12712  * Revision 1.144  1994/06/30  20:04:43  john
12713  * Added -joydef support.
12714  *
12715  * Revision 1.143  1994/06/24  17:01:44  john
12716  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
12717  * took it out of game.c and into gameseq.c
12718
12719 ------------------------------------------------------------------------
12720 main/joydefs.c:
12721
12722  * Revision 1.10  1995/10/18  22:21:21  allender
12723  * fixed bug with gravis mousestick and call key_flush when
12724  * calibrating joystick since it used keystrokes for the trigger
12725  * (at least most of them do)
12726  *
12727  * Revision 1.9  1995/10/17  13:12:32  allender
12728  * fixed up controller support for mac world
12729  *
12730  * Revision 1.8  1995/10/15  19:27:04  allender
12731  * new Dave Denhart controller code
12732  *
12733  * Revision 1.7  1995/10/15  16:14:59  allender
12734  * fixed axis value for Thrustmaster rudders
12735  *
12736  * Revision 1.6  1995/09/13  11:39:39  allender
12737  * made joystick cal menu all text so buttons will work properly
12738  *
12739  * Revision 1.5  1995/09/01  13:13:13  allender
12740  * added close box on controls menu
12741  *
12742  * Revision 1.4  1995/08/18  10:22:47  allender
12743  * if thrustmaster choosen, set joystick at thrustmaster type
12744  * for proper reading in joyc.c
12745  *
12746  * Revision 1.3  1995/07/26  17:00:34  allender
12747  * put back in code to make joysticks work
12748  *
12749  * Revision 1.2  1995/07/17  08:52:21  allender
12750  * put back in code that was taken out previously
12751  *
12752  * Revision 1.1  1995/05/16  15:26:48  allender
12753  * Initial revision
12754  *
12755  * Revision 2.2  1995/06/30  12:30:22  john
12756  * Added -Xname command line.
12757  *
12758  * Revision 2.1  1995/04/06  12:13:20  john
12759  * Made so you can calibrate Gravis Gamepad.
12760  *
12761  * Revision 2.0  1995/02/27  11:30:27  john
12762  * New version 2.0, which has no anonymous unions, builds with
12763  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12764  *
12765  * Revision 1.71  1995/02/12  02:06:10  john
12766  * Fixed bug with joystick incorrectly asking for
12767  * calibration.
12768  *
12769  * Revision 1.70  1995/01/28  15:58:07  john
12770  * Made joystick calibration be only when wrong detected in
12771  * menu or joystick axis changed.
12772  *
12773  * Revision 1.69  1995/01/25  14:37:55  john
12774  * Made joystick only prompt for calibration once...
12775  *
12776  * Revision 1.68  1995/01/24  16:34:29  john
12777  * Made so that if you reconfigure joystick and
12778  * add or subtract an axis, it asks for a recalibration
12779  * upon leaving.
12780  *
12781  * Revision 1.67  1994/12/29  11:08:51  john
12782  * Fixed Thrustmaster and Logitech Wingman extreme
12783  * Hat by reading the y2 axis during the center stage
12784  * of the calibration, and using 75, 50, 27, and 3 %
12785  * as values for the 4 positions.
12786  *
12787  * Revision 1.66  1994/12/15  18:17:39  john
12788  * Fixed warning with previous.
12789  *
12790  * Revision 1.65  1994/12/15  18:15:48  john
12791  * Made the joy cal only write the .cfg file, not
12792  * the player file.
12793  *
12794  * Revision 1.64  1994/12/13  14:43:35  john
12795  * Took out the code in kconfig to build direction array.
12796  * Called kc_set_controls after selecting a new control type.
12797  *
12798  * Revision 1.63  1994/12/10  12:08:47  john
12799  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
12800  *
12801  * Revision 1.62  1994/12/09  11:01:07  mike
12802  * force calibration of joystick on joystick selection from Controls... menu.
12803  *
12804  * Revision 1.61  1994/12/07  21:50:27  john
12805  * Put stop/start time around joystick delay.
12806  *
12807  * Revision 1.60  1994/12/07  19:34:39  john
12808  * Added delay.
12809  *
12810  * Revision 1.59  1994/12/07  18:12:14  john
12811  * NEatened up joy cal.,
12812  *
12813  * Revision 1.58  1994/12/07  17:07:51  john
12814  * Fixed up joy cal.
12815  *
12816  * Revision 1.57  1994/12/07  16:48:53  yuan
12817  * localization
12818  *
12819  * Revision 1.56  1994/12/07  16:05:55  john
12820  * Changed the way joystick calibration works.
12821  *
12822  * Revision 1.55  1994/12/06  20:15:22  john
12823  * Took out code that unpauses songs that were never paused.
12824  *
12825  * Revision 1.54  1994/12/06  15:14:09  yuan
12826  * Localization
12827  *
12828  * Revision 1.53  1994/12/05  16:29:16  john
12829  * Took out music pause around the cheat menu.
12830  *
12831  * Revision 1.52  1994/12/04  12:39:10  john
12832  * MAde so that FCS calibration doesn't ask for axis #2.
12833  *
12834  * Revision 1.51  1994/12/03  15:14:59  john
12835  * Took out the delay mentioned previosuly cause it would
12836  * cause bigger problems than it helps, especially with netgames.
12837  *
12838  * Revision 1.50  1994/12/03  14:16:14  john
12839  * Put a delay between screens in joy cal to keep Yuan from
12840  * double hitting.
12841  *
12842  * Revision 1.49  1994/12/03  11:04:06  john
12843  * Changed newmenu code a bit to fix bug with bogus
12844  * backgrounds occcasionally.
12845  *
12846  * Revision 1.48  1994/12/02  11:03:44  yuan
12847  * Localization.
12848  *
12849  * Revision 1.47  1994/12/02  10:50:33  yuan
12850  * Localization
12851  *
12852  * Revision 1.46  1994/12/01  12:21:59  john
12853  * Added code to calibrate 2 joysticks separately.
12854  *
12855  * Revision 1.45  1994/12/01  11:52:31  john
12856  * Added message when you select FCS to say that if
12857  * you have WCS, see manuel.
12858  *
12859  * Revision 1.44  1994/11/29  02:26:28  john
12860  * Made the prompts for upper-left, lower right for joy
12861  * calibration more obvious.
12862  *
12863  * Revision 1.43  1994/11/26  13:13:59  matt
12864  * Changed "none" option to "keyboard only"
12865  *
12866  * Revision 1.42  1994/11/21  19:35:13  john
12867  * Replaced calls to joy_init with if (joy_present)
12868  *
12869  * Revision 1.41  1994/11/21  19:28:34  john
12870  * Changed warning for no joystick to use nm_messagebox..
12871  *
12872  * Revision 1.40  1994/11/21  19:06:25  john
12873  * Made it so that it only stops sound when your in game mode.
12874  *
12875  * Revision 1.39  1994/11/21  11:47:18  john
12876  * Made sound pause during joystick calibration.
12877  *
12878  * Revision 1.38  1994/11/10  20:34:18  rob
12879  * Removed menu-specific network mode support in favor in new stuff
12880  * in newmenu.c
12881  *
12882  * Revision 1.37  1994/11/08  21:21:38  john
12883  * Made Esc exit joystick calibration.
12884  *
12885  * Revision 1.36  1994/11/08  15:14:42  john
12886  * Added more calls so net doesn't die in net game.
12887  *
12888  * Revision 1.35  1994/11/08  14:59:12  john
12889  * Added code to respond to network while in menus.
12890  *
12891  * Revision 1.34  1994/10/24  19:56:32  john
12892  * Made the new user setup prompt for config options.
12893  *
12894  * Revision 1.33  1994/10/22  14:11:52  mike
12895  * Suppress compiler warning message.
12896  *
12897  * Revision 1.32  1994/10/19  12:44:24  john
12898  * Added hours field to player structure.
12899  *
12900  * Revision 1.31  1994/10/17  13:07:13  john
12901  * Moved the descent.cfg info into the player config file.
12902  *
12903  * Revision 1.30  1994/10/13  21:41:12  john
12904  * MAde Esc exit out of joystick calibration.
12905  *
12906  * Revision 1.29  1994/10/13  19:22:27  john
12907  * Added separate config saves for different devices.
12908  * Made all the devices work together better, such as mice won't
12909  * get read when you're playing with the joystick.
12910  *
12911  * Revision 1.28  1994/10/13  11:40:18  john
12912  * Took out warnings.
12913  *
12914  * Revision 1.27  1994/10/13  11:35:23  john
12915  * Made Thrustmaster FCS Hat work.  Put a background behind the
12916  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
12917  * menu to new menu. Made F6 be calibrate joystick.
12918  *
12919  * Revision 1.26  1994/10/11  21:29:03  matt
12920  * Made a bunch of menus have good initial selected values
12921  *
12922  * Revision 1.25  1994/10/11  17:08:39  john
12923  * Added sliders for volume controls.
12924  *
12925  * Revision 1.24  1994/10/10  17:59:21  john
12926  * Neatend previous.
12927  *
12928  * Revision 1.23  1994/10/10  17:57:59  john
12929  * Neatend previous.
12930  *
12931  * Revision 1.22  1994/10/10  17:56:11  john
12932  * Added messagebox that tells that config has been saved.
12933  *
12934  * Revision 1.21  1994/09/30  12:37:26  john
12935  * Added midi,digi volume to configuration.
12936  *
12937  * Revision 1.20  1994/09/22  16:14:14  john
12938  * Redid intro sequecing.
12939  *
12940  * Revision 1.19  1994/09/19  18:50:15  john
12941  * Added switch to disable joystick.
12942  *
12943  * Revision 1.18  1994/09/12  11:47:36  john
12944  * Made stupid cruise work better.  Make kconfig values get
12945  * read/written to disk.
12946  *
12947  * Revision 1.17  1994/09/10  15:46:47  john
12948  * First version of new keyboard configuration.
12949  *
12950  * Revision 1.16  1994/09/06  19:35:44  john
12951  * Fixed bug that didn';t load new size .cal file.
12952  *
12953  * Revision 1.15  1994/09/06  14:51:58  john
12954  * Added sensitivity adjustment, fixed bug with joystick button not
12955  * staying down.
12956  *
12957  * Revision 1.14  1994/09/02  16:13:47  john
12958  * Made keys fill in position.
12959  *
12960  * Revision 1.13  1994/08/31  17:58:50  john
12961  * Made a bit simpler.
12962  *
12963  * Revision 1.12  1994/08/31  14:17:54  john
12964  * *** empty log message ***
12965  *
12966  * Revision 1.11  1994/08/31  14:10:56  john
12967  * Made keys not work when KEY_DELETE pressed.
12968  *
12969  * Revision 1.10  1994/08/31  13:40:47  mike
12970  * Change constant
12971  *
12972  * Revision 1.9  1994/08/31  12:56:27  john
12973  * *** empty log message ***
12974  *
12975  * Revision 1.8  1994/08/30  20:38:29  john
12976  * Add more config stuff..
12977  *
12978  * Revision 1.7  1994/08/30  16:37:25  john
12979  * Added menu options to set controls.
12980  *
12981  * Revision 1.6  1994/08/30  09:27:18  john
12982  * *** empty log message ***
12983  *
12984  * Revision 1.5  1994/08/30  09:12:01  john
12985  * *** empty log message ***
12986  *
12987  * Revision 1.4  1994/08/29  21:18:32  john
12988  * First version of new keyboard/oystick remapping stuff.
12989  *
12990  * Revision 1.3  1994/08/24  19:00:29  john
12991  * Changed key_down_time to return fixed seconds instead of
12992  * milliseconds.
12993  *
12994  * Revision 1.2  1994/08/17  16:50:37  john
12995  * Added damaging fireballs, missiles.
12996  *
12997  * Revision 1.1  1994/08/17  10:07:12  john
12998  * Initial revision
12999
13000 ------------------------------------------------------------------------
13001 main/joydefs.h:
13002
13003  * Revision 2.0  1995/02/27  11:32:12  john
13004  * New version 2.0, which has no anonymous unions, builds with
13005  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13006  *
13007  * Revision 1.12  1995/01/25  14:37:52  john
13008  * Made joystick only prompt for calibration once...
13009  *
13010  * Revision 1.11  1994/10/13  11:35:43  john
13011  * Made Thrustmaster FCS Hat work.  Put a background behind the
13012  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13013  * menu to new menu. Made F6 be calibrate joystick.
13014  *
13015  * Revision 1.10  1994/09/10  15:46:49  john
13016  * First version of new keyboard configuration.
13017  *
13018  * Revision 1.9  1994/09/06  14:51:29  john
13019  * Added sensitivity adjustment, fixed bug with joystick button not
13020  * staying down.
13021  *
13022  * Revision 1.8  1994/08/31  12:56:29  john
13023  * *** empty log message ***
13024  *
13025  * Revision 1.7  1994/08/30  16:37:07  john
13026  * Added menu options to set controls.
13027  *
13028  * Revision 1.6  1994/08/29  21:18:33  john
13029  * First version of new keyboard/oystick remapping stuff.
13030  *
13031  * Revision 1.5  1994/08/24  19:00:30  john
13032  * Changed key_down_time to return fixed seconds instead of
13033  * milliseconds.
13034  *
13035  * Revision 1.4  1994/08/17  16:50:04  john
13036  * Added damaging fireballs, missiles.
13037  *
13038  * Revision 1.3  1994/07/01  10:55:18  john
13039  * Added analog joystick throttle
13040  *
13041  * Revision 1.2  1994/06/30  20:04:46  john
13042  * Added -joydef support.
13043  *
13044  * Revision 1.1  1994/06/30  18:08:12  john
13045  * Initial revision
13046
13047 ------------------------------------------------------------------------
13048 main/kconfig.c:
13049
13050  * Revision 1.18  1995/10/29  20:14:10  allender
13051  * don't read mouse 30x/sec.  Still causes problems -- left with
13052  * exposure at > 60 frame/s
13053  *
13054  * Revision 1.17  1995/10/27  14:16:35  allender
13055  * don't set lastreadtime when doing mouse stuff if we didn't
13056  * read mouse this frame
13057  *
13058  * Revision 1.16  1995/10/24  18:10:22  allender
13059  * get mouse stuff working right this time?
13060  *
13061  * Revision 1.15  1995/10/23  14:50:50  allender
13062  * corrected values for control type in kc_set_controls
13063  *
13064  * Revision 1.14  1995/10/21  16:36:54  allender
13065  * fix up mouse read time
13066  *
13067  * Revision 1.13  1995/10/20  00:46:53  allender
13068  * fix up mouse reading problem
13069  *
13070  * Revision 1.12  1995/10/19  13:36:38  allender
13071  * mouse support in kconfig screens
13072  *
13073  * Revision 1.11  1995/10/18  21:06:06  allender
13074  * removed Int3 in cruise stuff -- was in there for debugging and
13075  * now not needed
13076  *
13077  * Revision 1.10  1995/10/17  13:12:47  allender
13078  * fixed config menus so buttons don't get configured
13079  *
13080  * Revision 1.9  1995/10/15  23:07:55  allender
13081  * added return key as second button for primary fire
13082  *
13083  * Revision 1.8  1995/09/05  08:49:47  allender
13084  * change 'PADRTN' label to 'ENTER'
13085  *
13086  * Revision 1.7  1995/09/01  15:38:22  allender
13087  * took out cap of reading controls max 25 times/sec
13088  *
13089  * Revision 1.6  1995/09/01  13:33:59  allender
13090  * erase all old text
13091  *
13092  * Revision 1.5  1995/08/18  10:20:55  allender
13093  * keep controls reading to 25 times/s max so fast
13094  * frame rates don't mess up control reading
13095  *
13096  * Revision 1.4  1995/07/28  15:43:13  allender
13097  * make mousebutton control primary fire
13098  *
13099  * Revision 1.3  1995/07/26  17:04:32  allender
13100  * new defaults and make joystick main button work correctly
13101  *
13102  * Revision 1.2  1995/07/17  08:51:03  allender
13103  * fixed up configuration menus to look right
13104  *
13105  * Revision 1.1  1995/05/16  15:26:56  allender
13106  * Initial revision
13107  *
13108  * Revision 2.11  1995/08/23  16:08:04  john
13109  * Added version 2 of external controls that passes the ship
13110  * position and orientation the drivers.
13111  *
13112  * Revision 2.10  1995/07/07  16:48:01  john
13113  * Fixed bug with new interface.
13114  *
13115  * Revision 2.9  1995/07/03  15:02:32  john
13116  * Added new version of external controls for Cybermouse absolute position.
13117  *
13118  * Revision 2.8  1995/06/30  12:30:28  john
13119  * Added -Xname command line.
13120  *
13121  * Revision 2.7  1995/03/30  16:36:56  mike
13122  * text localization.
13123  *
13124  * Revision 2.6  1995/03/21  14:39:31  john
13125  * Ifdef'd out the NETWORK code.
13126  *
13127  * Revision 2.5  1995/03/16  10:53:07  john
13128  * Move VFX center to Shift+Z instead of Enter because
13129  * it conflicted with toggling HUD on/off.
13130  *
13131  * Revision 2.4  1995/03/10  13:47:24  john
13132  * Added head tracking sensitivity.
13133  *
13134  * Revision 2.3  1995/03/09  18:07:06  john
13135  * Fixed bug with iglasses tracking not "centering" right.
13136  * Made VFX have bright headlight lighting.
13137  *
13138  * Revision 2.2  1995/03/08  15:32:39  john
13139  * Made VictorMaxx head tracking use Greenleaf code.
13140  *
13141  * Revision 2.1  1995/03/06  15:23:31  john
13142  * New screen techniques.
13143  *
13144  * Revision 2.0  1995/02/27  11:29:26  john
13145  * New version 2.0, which has no anonymous unions, builds with
13146  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13147  *
13148  * Revision 1.105  1995/02/22  14:11:58  allender
13149  * remove anonymous unions from object structure
13150  *
13151  * Revision 1.104  1995/02/13  12:01:56  john
13152  * Fixed bug with buggin not mmaking player faster.
13153  *
13154  * Revision 1.103  1995/02/09  22:00:46  john
13155  * Added i-glasses tracking.
13156  *
13157  * Revision 1.102  1995/01/24  21:25:47  john
13158  * Fixed bug with slide/bank on not working with
13159  * Cyberman heading.,
13160  *
13161  * Revision 1.101  1995/01/24  16:09:56  john
13162  * Fixed bug with Wingman extreme customize text overwriting title.
13163  *
13164  * Revision 1.100  1995/01/24  12:37:46  john
13165  * Made Esc exit key define menu.
13166  *
13167  * Revision 1.99  1995/01/23  23:54:43  matt
13168  * Made keypad enter work
13169  *
13170  * Revision 1.98  1995/01/23  16:42:00  john
13171  * Made the external controls always turn banking off, leveling off
13172  * and passed automap state thru to the tsr.
13173  *
13174  * Revision 1.97  1995/01/12  11:41:33  john
13175  * Added external control reading.
13176  *
13177  * Revision 1.96  1995/01/05  10:43:58  mike
13178  * Handle case when timer_get_fixed_seconds() goes negative.  Happens at 9.1
13179  * hours.  Previously, joystick would stop functioning.  Now will work.
13180  *
13181  * Revision 1.95  1994/12/29  11:17:38  john
13182  * Took out some warnings and mprintf.
13183  *
13184  * Revision 1.94  1994/12/29  11:07:41  john
13185  * Fixed Thrustmaster and Logitech Wingman extreme
13186  * Hat by reading the y2 axis during the center stage
13187  * of the calibration, and using 75, 50, 27, and 3 %
13188  * as values for the 4 positions.
13189  *
13190  * Revision 1.93  1994/12/27  12:16:20  john
13191  * Fixed bug with slide on not working with joystick or mouse buttons.
13192  *
13193  * Revision 1.92  1994/12/20  10:34:15  john
13194  * Made sensitivity work for mouse & joystick and made
13195  * it only affect, pitch, heading, and roll.
13196  *
13197  * Revision 1.91  1994/12/16  00:11:23  matt
13198  * Made delete key act normally when debug out
13199  *
13200  * Revision 1.90  1994/12/14  17:41:15  john
13201  * Added more buttons so that  Yoke would work.
13202  *
13203  * Revision 1.89  1994/12/13  17:25:35  allender
13204  * Added Assert for bogus time for joystick reading.
13205  *
13206  * Revision 1.88  1994/12/13  14:48:01  john
13207  * Took out some debugging mprintf's
13208  *
13209  *
13210  * Revision 1.87  1994/12/13  14:43:02  john
13211  * Took out the code in kconfig to build direction array.
13212  * Called kc_set_controls after selecting a new control type.
13213  *
13214  * Revision 1.86  1994/12/13  01:11:32  john
13215  * Fixed bug with message clearing overwriting
13216  * right border.
13217  *
13218  * Revision 1.85  1994/12/12  00:35:58  john
13219  * Added or thing for keys.
13220  *
13221  * Revision 1.84  1994/12/09  17:08:06  john
13222  * Made mouse a bit less sensitive.
13223  *
13224  * Revision 1.83  1994/12/09  16:04:00  john
13225  * Increased mouse sensitivity.
13226  *
13227  * Revision 1.82  1994/12/09  00:41:26  mike
13228  * fix hang in automap print screen
13229  *
13230  * Revision 1.81  1994/12/08  11:50:37  john
13231  * Made strcpy only copy corect number of chars,.
13232  *
13233  * Revision 1.80  1994/12/07  16:16:06  john
13234  * Added command to check to see if a joystick axes has been used.
13235  *
13236  * Revision 1.79  1994/12/07  14:52:28  yuan
13237  * Localization 492
13238  *
13239  * Revision 1.78  1994/12/07  13:37:40  john
13240  * Made the joystick thrust work in reverse.
13241  *
13242  * Revision 1.77  1994/12/07  11:28:24  matt
13243  * Did a little localization support
13244  *
13245  * Revision 1.76  1994/12/04  12:30:03  john
13246  * Made the Thrustmaster stick read every frame, not every 10 frames,
13247  * because it uses analog axis as buttons.
13248  *
13249  * Revision 1.75  1994/12/03  22:35:25  yuan
13250  * Localization 412
13251  *
13252  * Revision 1.74  1994/12/03  15:39:24  john
13253  * Made numeric keypad move in conifg.
13254  *
13255  * Revision 1.73  1994/12/01  16:23:39  john
13256  * Fixed include mistake.
13257  *
13258  * Revision 1.72  1994/12/01  16:07:57  john
13259  * Fixed bug that disabled joystick in automap because it used gametime, which is
13260  * paused during automap. Fixed be used timer_Get_fixed_seconds instead of GameTime.
13261  *
13262  * Revision 1.71  1994/12/01  12:30:49  john
13263  * Made Ctrl+D delete, not Ctrl+E
13264  *
13265  * Revision 1.70  1994/12/01  11:52:52  john
13266  * Added default values for GamePad.
13267  *
13268  * Revision 1.69  1994/11/30  00:59:12  mike
13269  * optimizations.
13270  *
13271  * Revision 1.68  1994/11/29  03:45:50  john
13272  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
13273  * command line arg.
13274  *
13275  * Revision 1.67  1994/11/27  23:13:44  matt
13276  * Made changes for new mprintf calling convention
13277  *
13278  * Revision 1.66  1994/11/27  19:52:12  matt
13279  * Made screen shots work in a few more places
13280  *
13281  * Revision 1.65  1994/11/22  16:54:50  mike
13282  * autorepeat on missiles.
13283  *
13284  * Revision 1.64  1994/11/21  11:16:17  rob
13285  * Changed calls to GameLoop to calls to multi_menu_poll and changed
13286  * conditions under which they are called.
13287  *
13288  * Revision 1.63  1994/11/19  15:14:48  mike
13289  * remove unused code and data
13290  *
13291  * Revision 1.62  1994/11/18  23:37:56  john
13292  * Changed some shorts to ints.
13293  *
13294  * Revision 1.61  1994/11/17  13:36:35  rob
13295  * Added better network hook in kconfig menu.
13296  *
13297  * Revision 1.60  1994/11/14  20:09:13  john
13298  * Made Tab be default for automap.
13299  *
13300  * Revision 1.59  1994/11/13  16:34:07  matt
13301  * Fixed victormaxx angle conversions
13302  *
13303  * Revision 1.58  1994/11/12  14:47:05  john
13304  * Added support for victor head tracking.
13305  *
13306  * Revision 1.57  1994/11/08  15:14:55  john
13307  * Added more calls so net doesn't die in net game.
13308  *
13309  * Revision 1.56  1994/11/07  14:01:07  john
13310  * Changed the gamma correction sequencing.
13311  *
13312  * Revision 1.55  1994/11/01  16:40:08  john
13313  * Added Gamma correction.
13314  *
13315  * Revision 1.54  1994/10/25  23:09:26  john
13316  * Made the automap key configurable.
13317  *
13318  * Revision 1.53  1994/10/25  13:11:59  john
13319  * Made keys the way Adam speced 'em for final game.
13320  *
13321  * Revision 1.52  1994/10/24  17:44:22  john
13322  * Added stereo channel reversing.
13323  *
13324  * Revision 1.51  1994/10/22  13:23:18  john
13325  * Made default rear view key be R.
13326  *
13327  * Revision 1.50  1994/10/22  13:20:09  john
13328  * Took out toggle primary/secondary weapons.  Fixed black
13329  * background for 'axes' and 'buttons' text.
13330  *
13331  * Revision 1.49  1994/10/21  15:20:15  john
13332  * Made PrtScr do screen dump, not F2.
13333  *
13334  * Revision 1.48  1994/10/21  13:41:36  john
13335  * Allowed F2 to screen dump.
13336  *
13337  * Revision 1.47  1994/10/17  13:07:05  john
13338  * Moved the descent.cfg info into the player config file.
13339  *
13340  * Revision 1.46  1994/10/14  15:30:22  john
13341  * Added Cyberman default positions.
13342  *
13343  * Revision 1.45  1994/10/14  15:24:54  john
13344  * Made Cyberman work with config.
13345  *
13346  * Revision 1.44  1994/10/14  12:46:04  john
13347  * Added the ability to reset all to default.
13348  *
13349  * Revision 1.43  1994/10/14  12:18:31  john
13350  * Made mouse invert axis always be 0 or 1.
13351  *
13352  * Revision 1.42  1994/10/14  12:16:03  john
13353  * Changed code so that by doing DEL+F12 saves the current kconfig
13354  * values as default. Added support for drop_bomb key.  Took out
13355  * unused slots for keyboard.  Made keyboard use control_type of 0
13356  * save slots.
13357  *
13358  * Revision 1.41  1994/10/13  21:27:02  john
13359  * Made axis invert value always be 0 or 1.
13360  *
13361  * Revision 1.40  1994/10/13  20:18:15  john
13362  * Added some more system keys, such as F? and CAPSLOCK.
13363  *
13364  * Revision 1.39  1994/10/13  19:22:29  john
13365  * Added separate config saves for different devices.
13366  * Made all the devices work together better, such as mice won't
13367  * get read when you're playing with the joystick.
13368  *
13369  * Revision 1.38  1994/10/13  15:41:57  mike
13370  * Remove afterburner.
13371
13372 ------------------------------------------------------------------------
13373 main/kconfig.h:
13374
13375  * Revision 1.1  1995/05/16  15:58:27  allender
13376  * Initial revision
13377  *
13378  * Revision 2.0  1995/02/27  11:29:38  john
13379  * New version 2.0, which has no anonymous unions, builds with
13380  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13381  *
13382  * Revision 1.23  1995/01/12  11:41:44  john
13383  * Added external control reading.
13384  *
13385  * Revision 1.22  1994/12/07  16:15:30  john
13386  * Added command to check to see if a joystick axes has been used.
13387  *
13388  * Revision 1.21  1994/11/29  03:46:29  john
13389  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
13390  * command line arg.
13391  *
13392  * Revision 1.20  1994/11/22  16:54:45  mike
13393  * autorepeat on missiles.
13394  *
13395  * Revision 1.19  1994/11/07  14:01:27  john
13396  * Changed the gamma correction sequencing.
13397  *
13398  * Revision 1.18  1994/11/01  16:40:02  john
13399  * Added Gamma correction.
13400  *
13401  * Revision 1.17  1994/10/25  23:09:24  john
13402  * Made the automap key configurable.
13403  *
13404  * Revision 1.16  1994/10/24  19:56:51  john
13405  * Made the new user setup prompt for config options.
13406  *
13407  * Revision 1.15  1994/10/24  17:44:18  john
13408  * Added stereo channel reversing.
13409  *
13410  * Revision 1.14  1994/10/22  13:19:33  john
13411  * Took out toggle primary/secondary weapons.  Fixed black
13412  * background for 'axes' and 'buttons' text.
13413  *
13414  * Revision 1.13  1994/10/17  13:06:51  john
13415  * Moved the descent.cfg info into the player config file.
13416  *
13417  * Revision 1.12  1994/10/14  12:14:47  john
13418  * Changed code so that by doing DEL+F12 saves the current kconfig
13419  * values as default. Added support for drop_bomb key.  Took out
13420  * unused slots for keyboard.  Made keyboard use control_type of 0
13421  * save slots.
13422  *
13423  * Revision 1.11  1994/10/13  19:21:33  john
13424  * Added separate config saves for different devices.
13425  * Made all the devices work together better, such as mice won't
13426  * get read when you're playing with the joystick.
13427  *
13428  * Revision 1.10  1994/10/13  15:18:41  john
13429  * Started ripping out old afterburner, show message, show automap
13430  * keys in the keyboard config stuff.
13431  *
13432  * Revision 1.9  1994/10/13  11:35:27  john
13433  * Made Thrustmaster FCS Hat work.  Put a background behind the
13434  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13435  * menu to new menu. Made F6 be calibrate joystick.
13436  *
13437  * Revision 1.8  1994/10/06  14:10:50  matt
13438  * New function reset_cruise()
13439  *
13440  * Revision 1.7  1994/10/03  14:58:25  john
13441  * Added rear_view_down_state so that the rear view can
13442  * work like the automap.
13443  *
13444  * Revision 1.6  1994/09/30  12:37:25  john
13445  * Added midi,digi volume to configuration.
13446  *
13447  * Revision 1.5  1994/09/19  18:49:59  john
13448  * Added switch to disable joystick.
13449  *
13450  * Revision 1.4  1994/09/15  16:11:21  john
13451  * Added support for VFX1 head tracking. Fixed bug with memory over-
13452  * write when using stereo mode.
13453  *
13454  * Revision 1.3  1994/09/12  11:47:38  john
13455  * Made stupid cruise work better.  Make kconfig values get
13456  * read/written to disk.
13457  *
13458  * Revision 1.2  1994/09/10  15:46:55  john
13459  * First version of new keyboard configuration.
13460  *
13461  * Revision 1.1  1994/09/10  13:51:40  john
13462  * Initial revision
13463
13464 ------------------------------------------------------------------------
13465 main/kmatrix.c:
13466
13467  * Revision 1.6  1995/09/24  10:57:48  allender
13468  * made any key move off of kill matrix screen as text indicates it should
13469  *
13470  * Revision 1.5  1995/08/18  08:33:05  allender
13471  * fixed text problem with top level player names
13472  *
13473  * Revision 1.4  1995/07/26  17:03:05  allender
13474  * sort of fixed spacing for mac
13475  *
13476  * Revision 1.3  1995/06/06  15:36:14  allender
13477  * be sure to bitblt to screen inside of kmatrix loop
13478  *
13479  * Revision 1.2  1995/06/02  07:47:15  allender
13480  * removed bogus include files
13481  *
13482  * Revision 1.1  1995/05/16  15:27:07  allender
13483  * Initial revision
13484  *
13485  * Revision 2.3  1995/05/02  17:01:22  john
13486  * Fixed bug with kill list not showing up in VFX mode.
13487  *
13488  * Revision 2.2  1995/03/21  14:38:20  john
13489  * Ifdef'd out the NETWORK code.
13490  *
13491  * Revision 2.1  1995/03/06  15:22:54  john
13492  * New screen techniques.
13493  *
13494  * Revision 2.0  1995/02/27  11:25:56  john
13495  * New version 2.0, which has no anonymous unions, builds with
13496  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13497  *
13498  * Revision 1.19  1995/02/15  14:47:23  john
13499  * Added code to keep track of kills during endlevel.
13500  *
13501  * Revision 1.18  1995/02/08  11:00:06  rob
13502  * Moved string to localized file
13503  *
13504  * Revision 1.17  1995/02/01  23:45:55  rob
13505  * Fixed string.
13506  *
13507  * Revision 1.16  1995/01/30  21:47:11  rob
13508  * Added a line of instructions.
13509  *
13510  * Revision 1.15  1995/01/20  16:58:43  rob
13511  * careless careless careless...
13512  *
13513  *
13514  * Revision 1.14  1995/01/20  13:43:48  rob
13515  * Longer time to view.
13516  *
13517  * Revision 1.13  1995/01/20  13:42:34  rob
13518  * Fixed sorting bug.
13519  *
13520  * Revision 1.12  1995/01/19  17:35:21  rob
13521  * Fixed coloration of player names in team mode.
13522  *
13523  * Revision 1.11  1995/01/16  21:26:15  rob
13524  * Fixed it!!
13525  *
13526  * Revision 1.10  1995/01/16  18:55:41  rob
13527  * Added include of network.h
13528  *
13529  * Revision 1.9  1995/01/16  18:22:35  rob
13530  * Fixed problem with signs.
13531  *
13532  * Revision 1.8  1995/01/12  16:07:51  rob
13533  * ADded sorting before display.
13534  *
13535  * Revision 1.7  1995/01/04  08:46:53  rob
13536  * JOHN CHECKED IN FOR ROB !!!
13537  *
13538  * Revision 1.6  1994/12/09  20:17:20  yuan
13539  * Touched up
13540  *
13541  * Revision 1.5  1994/12/09  19:46:35  yuan
13542  * Localized the sucker.
13543  *
13544  * Revision 1.4  1994/12/09  19:24:58  rob
13545  * Yuan's fix to the centering.
13546  *
13547  * Revision 1.3  1994/12/09  19:02:37  yuan
13548  * Cleaned up a bit.
13549  *
13550  * Revision 1.2  1994/12/09  16:19:46  yuan
13551  * kill matrix stuff.
13552  *
13553  * Revision 1.1  1994/12/09  15:08:58  yuan
13554  * Initial revision
13555
13556 ------------------------------------------------------------------------
13557 main/kmatrix.h:
13558
13559  * Revision 1.1  1995/05/16  15:58:35  allender
13560  * Initial revision
13561  *
13562  * Revision 2.0  1995/02/27  11:28:51  john
13563  * New version 2.0, which has no anonymous unions, builds with
13564  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13565  *
13566  * Revision 1.3  1995/02/15  14:47:39  john
13567  * Added code to keep track of kills during endlevel.
13568  *
13569  * Revision 1.2  1994/12/09  16:19:46  yuan
13570  * kill matrix stuff.
13571  *
13572  * Revision 1.1  1994/12/09  15:58:33  yuan
13573  * Initial revision
13574
13575 ------------------------------------------------------------------------
13576 main/laser.c:
13577
13578  * Revision 1.1  1993/11/29  17:19:02  john
13579  * Initial revision
13580
13581 ------------------------------------------------------------------------
13582 main/laser.h:
13583
13584  * Revision 1.1  1995/05/16  15:58:43  allender
13585  * Initial revision
13586  *
13587  * Revision 2.0  1995/02/27  11:32:27  john
13588  * New version 2.0, which has no anonymous unions, builds with
13589  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13590  *
13591  * Revision 1.50  1995/02/01  21:03:44  john
13592  * Lintified.
13593  *
13594  * Revision 1.49  1995/02/01  16:34:11  john
13595  * Linted.
13596  *
13597  * Revision 1.48  1995/01/31  16:16:16  mike
13598  * Separate smart blobs for robot and player.
13599  *
13600  * Revision 1.47  1995/01/27  17:02:55  mike
13601  * Add LASER_ID -- why wasn't this added in June?
13602  *
13603  * Revision 1.46  1995/01/25  10:53:27  mike
13604  * make badass damage go through grates.
13605  *
13606  * Revision 1.45  1994/12/12  17:17:32  mike
13607  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
13608  *
13609  * Revision 1.44  1994/12/04  16:17:23  mike
13610  * spruce up homing missile behavior.
13611  *
13612  * Revision 1.43  1994/12/03  12:48:30  mike
13613  * make homing missile tracking not frame rate dependent (more-or-less)
13614  *
13615  * Revision 1.42  1994/10/12  08:04:54  mike
13616  * Clean up proximity/homing mess.
13617  *
13618  * Revision 1.41  1994/10/09  20:07:04  rob
13619  * Change prototype for do_laser_firing
13620  *
13621  * Revision 1.40  1994/10/09  00:15:48  mike
13622  * Add constants for super mech missile, regular mech missile, silent spreadfire.
13623  *
13624  * Revision 1.39  1994/10/08  19:52:09  rob
13625  * Added new weapon fire flags.
13626  *
13627  * Revision 1.38  1994/10/07  15:31:12  mike
13628  * Prototypes for new laser functions which don't necessarily make sound.
13629  *
13630  * Revision 1.37  1994/10/05  17:08:29  matt
13631  * Fixed a couple of small bugs, and made homing missiles alternate sides
13632  *
13633  * Revision 1.36  1994/09/28  14:28:55  rob
13634  * Added firing of missiles on networks/serial.
13635  *
13636  * Revision 1.35  1994/09/24  14:17:02  mike
13637  * Prototype do_laser_firing.
13638  *
13639  * Revision 1.34  1994/09/23  11:36:49  mike
13640  * Prototype Laser_create_new_easy.
13641  *
13642  * Revision 1.33  1994/09/20  11:55:01  mike
13643  * Fix bug.
13644  *
13645  * Revision 1.32  1994/09/20  11:48:34  mike
13646  * Change spreadfire laser to use new bitmap. (Define SPREADFIRE_ID)
13647  *
13648  * Revision 1.31  1994/09/15  16:31:28  mike
13649  * Prototype object_to_object_visibility.
13650  *
13651  * Revision 1.30  1994/09/10  17:31:40  mike
13652  * Add thrust to weapons.
13653  *
13654  * Revision 1.29  1994/09/08  14:49:44  mike
13655  * Bunch of IDs for new weapon types.
13656  *
13657  * Revision 1.28  1994/09/07  19:16:40  mike
13658  * Homing missile.
13659  *
13660  * Revision 1.27  1994/09/07  15:59:47  mike
13661  * Kill FLARE_MAX_TIME (now defined in bitmaps.tbl), add PROXIMITY_ID (shame!), prototype do_laser_firing, do_missile_firing.
13662  *
13663  * Revision 1.26  1994/09/03  15:22:41  mike
13664  * Kill Projectile_player_fire prototype.
13665  *
13666  * Revision 1.25  1994/09/02  16:39:00  mike
13667  * IDs for primary weapons.
13668  *
13669  * Revision 1.24  1994/09/02  11:55:54  mike
13670  * Define some illegal constants.
13671  *
13672  * Revision 1.23  1994/08/25  18:12:06  matt
13673  * Made player's weapons and flares fire from the positions on the 3d model.
13674  * Also added support for quad lasers.
13675  *
13676  * Revision 1.22  1994/08/19  15:22:28  mike
13677  * Define constant for MAX_LASER_LEVEL.
13678  *
13679  * Revision 1.21  1994/08/13  12:20:47  john
13680  * Made the networking uise the Players array.
13681  *
13682  * Revision 1.20  1994/08/10  10:44:05  john
13683  * Made net players fire..
13684  *
13685  * Revision 1.19  1994/06/27  18:30:57  mike
13686  * Add flares.
13687  *
13688  * Revision 1.18  1994/06/09  15:32:37  mike
13689  * Muzzle flash
13690  *
13691  * Revision 1.17  1994/05/19  09:09:00  mike
13692  * Move a bunch of laser variables to bm.h, I think.
13693  * Also, added Robot_laser_speed, instead of hard-coding Laser_speed/4.
13694  *
13695  * Revision 1.16  1994/05/14  17:16:20  matt
13696  * Got rid of externs in source (non-header) files
13697  *
13698  * Revision 1.15  1994/05/13  20:27:39  john
13699  * Version II of John's new object code.
13700  *
13701  * Revision 1.14  1994/04/20  15:06:47  john
13702  * Neatend laser code and fixed some laser bugs.
13703  *
13704  * Revision 1.13  1994/04/01  13:35:15  matt
13705  * Cleaned up laser code a bit; moved some code here object.c to laser.c
13706  *
13707  * Revision 1.12  1994/04/01  11:14:24  yuan
13708  * Added multiple bitmap functionality to all objects...
13709  * (hostages, powerups, lasers, etc.)
13710  * Hostages and powerups are implemented in the object system,
13711  * just need to finish function call to "affect" player.
13712  *
13713  * Revision 1.11  1994/03/31  09:10:09  matt
13714  * Added #define to turn crosshair off
13715  *
13716  * Revision 1.10  1994/02/17  11:33:15  matt
13717  * Changes in object system
13718  *
13719  * Revision 1.9  1994/01/06  11:56:01  john
13720  * Made lasers be lines, not purple blobs
13721  *
13722  * Revision 1.8  1994/01/05  10:53:35  john
13723  * New object code by John.
13724  *
13725  * Revision 1.7  1993/12/08  14:21:36  john
13726  * Added ExplodeObject
13727  *
13728  * Revision 1.6  1993/12/08  11:28:54  john
13729  * Made lasers look like bolts.
13730  *
13731  * Revision 1.5  1993/12/01  13:12:40  john
13732  * made lasers frame-rate independant
13733  *
13734  * Revision 1.4  1993/11/30  19:00:42  john
13735  * lasers working kinda
13736  *
13737  * Revision 1.3  1993/11/29  19:44:53  john
13738  * *** empty log message ***
13739  *
13740  * Revision 1.2  1993/11/29  17:44:55  john
13741  * *** empty log message ***
13742  *
13743  * Revision 1.1  1993/11/29  17:19:19  john
13744  * Initial revision
13745
13746 ------------------------------------------------------------------------
13747 main/lighting.c:
13748
13749  * Revision 1.4  1995/09/20  14:26:12  allender
13750  * more optimizations(?) ala MK
13751  *
13752  * Revision 1.2  1995/07/05  21:27:31  allender
13753  * new and improved lighting code by MK!
13754  *
13755  * Revision 2.1  1995/07/24  13:21:56  john
13756  * Added new lighting calculation code to speed things up.
13757  *
13758  * Revision 2.0  1995/02/27  11:27:33  john
13759  * New version 2.0, which has no anonymous unions, builds with
13760  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13761  *
13762  * Revision 1.43  1995/02/22  13:57:10  allender
13763  * remove anonymous union from object structure
13764  *
13765  * Revision 1.42  1995/02/13  20:35:07  john
13766  * Lintized
13767  *
13768  * Revision 1.41  1995/02/04  21:43:40  matt
13769  * Changed an assert() to an int3() and deal with the bad case
13770  *
13771  * Revision 1.40  1995/01/15  20:48:27  mike
13772  * support light field for powerups.
13773  *
13774  * Revision 1.39  1994/12/15  13:04:19  mike
13775  * Replace Players[Player_num].time_total references with GameTime.
13776  *
13777  * Revision 1.38  1994/11/28  21:50:41  mike
13778  * optimizations.
13779  *
13780  * Revision 1.37  1994/11/28  01:32:33  mike
13781  * lighting optimization.
13782  *
13783  * Revision 1.36  1994/11/15  12:01:00  john
13784  * Changed a bunch of code that uses timer_get_milliseconds to
13785  * timer_get_fixed_Seconds.
13786  *
13787  * Revision 1.35  1994/10/31  21:56:07  matt
13788  * Fixed bug & added error checking
13789  *
13790  * Revision 1.34  1994/10/21  11:24:57  mike
13791  * Trap divide overflows in lighting.
13792  *
13793  * Revision 1.33  1994/10/08  14:49:11  matt
13794  * If viewer changed, don't do smooth lighting hack
13795  *
13796  * Revision 1.32  1994/09/25  23:41:07  matt
13797  * Changed the object load & save code to read/write the structure fields one
13798  * at a time (rather than the whole structure at once).  This mean that the
13799  * object structure can be changed without breaking the load/save functions.
13800  * As a result of this change, the local_object data can be and has been
13801  * incorporated into the object array.  Also, timeleft is now a property
13802  * of all objects, and the object structure has been otherwise cleaned up.
13803  *
13804  * Revision 1.31  1994/09/25  15:45:15  matt
13805  * Added OBJ_LIGHT, a type of object that casts light
13806  * Added generalized lifeleft, and moved it to local_object
13807  *
13808  * Revision 1.30  1994/09/11  15:48:27  mike
13809  * Use vm_vec_mag_quick in place of vm_vec_mag in point_dist computation.
13810  *
13811  * Revision 1.29  1994/09/08  21:44:49  matt
13812  * Made lighting ramp 4x as fast; made only static (ambient) light ramp
13813  * up, but not headlight & dynamic light
13814  *
13815  * Revision 1.28  1994/09/02  14:00:07  matt
13816  * Simplified explode_object() & mutliple-stage explosions
13817  *
13818  * Revision 1.27  1994/08/29  19:06:44  mike
13819  * Make lighting proportional to square of distance, not linear.
13820  *
13821  * Revision 1.26  1994/08/25  18:08:38  matt
13822  * Made muzzle flash cast 3x as much light
13823  *
13824  * Revision 1.25  1994/08/23  16:38:31  mike
13825  * Key weapon light off bitmaps.tbl.
13826  *
13827  * Revision 1.24  1994/08/13  12:20:44  john
13828  * Made the networking uise the Players array.
13829  *
13830  * Revision 1.23  1994/08/12  22:42:18  john
13831  * Took away Player_stats; added Players array.
13832  *
13833  * Revision 1.22  1994/07/06  10:19:22  matt
13834  * Changed include
13835  *
13836  * Revision 1.21  1994/06/28  13:20:22  mike
13837  * Oops, fixed a dumb typo.
13838  *
13839  * Revision 1.20  1994/06/28  12:53:25  mike
13840  * Change lighting function for flares, make brighter and asynchronously flicker.
13841  *
13842  * Revision 1.19  1994/06/27  18:31:15  mike
13843  * Add flares.
13844  *
13845  * Revision 1.18  1994/06/20  13:41:17  matt
13846  * Added time-based gradual lighting hack for objects
13847  * Took out strobing robots
13848  *
13849  * Revision 1.17  1994/06/19  16:25:54  mike
13850  * Optimize lighting.
13851  *
13852  * Revision 1.16  1994/06/17  18:08:08  mike
13853  * Make robots cast more and variable light.
13854  *
13855  * Revision 1.15  1994/06/13  15:15:55  mike
13856  * Fix phantom light, every 64K milliseconds, muzzle flash would flash again.
13857
13858 ------------------------------------------------------------------------
13859 main/lighting.h:
13860
13861  * Revision 1.1  1995/05/16  15:58:51  allender
13862  * Initial revision
13863  *
13864  * Revision 2.0  1995/02/27  11:27:52  john
13865  * New version 2.0, which has no anonymous unions, builds with
13866  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13867  *
13868  * Revision 1.6  1994/11/28  21:50:56  mike
13869  * optimizations.
13870  *
13871  * Revision 1.5  1994/06/07  16:51:58  matt
13872  * Made object lighting work correctly; changed name of Ambient_light to
13873  * Dynamic_light; cleaned up polygobj object rendering a little.
13874  *
13875  * Revision 1.4  1994/05/31  18:41:35  matt
13876  * Added comments
13877  *
13878  * Revision 1.3  1994/05/23  15:00:08  mike
13879  * Change MIN_LIGHT_DIST.
13880  *
13881  * Revision 1.2  1994/05/22  15:30:09  mike
13882  * First version.
13883  *
13884  * Revision 1.1  1994/05/22  15:16:44  mike
13885  * Initial revision
13886
13887 ------------------------------------------------------------------------
13888 main/menu.h:
13889
13890  * Revision 1.1  1995/05/16  15:59:14  allender
13891  * Initial revision
13892  *
13893  * Revision 2.1  1995/03/06  16:47:41  mike
13894  * destination saturn
13895  *
13896  * Revision 2.0  1995/02/27  11:29:47  john
13897  * New version 2.0, which has no anonymous unions, builds with
13898  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13899  *
13900  * Revision 1.34  1994/12/12  00:16:16  john
13901  * Added auto-leveling flag.
13902  *
13903  * Revision 1.33  1994/12/07  20:04:26  mike
13904  * set Max_debris_objects.
13905  *
13906  * Revision 1.32  1994/11/14  17:23:19  rob
13907  * ADded extern for default difficulty settings.
13908  *
13909  * Revision 1.31  1994/11/10  11:08:29  mike
13910  * detail level stuff.
13911  *
13912  * Revision 1.30  1994/11/05  14:05:53  john
13913  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
13914  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
13915  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
13916  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
13917  *
13918  * Revision 1.29  1994/11/02  11:59:44  john
13919  * Moved menu out of game into inferno main loop.
13920  *
13921  * Revision 1.28  1994/10/17  20:30:59  john
13922  * Made the text for the difficulty labels global so that
13923  * the high score screen can print "rookie" or whatever.
13924  *
13925  * Revision 1.27  1994/10/04  10:47:09  matt
13926  * Made main menu remember selected item
13927  *
13928  * Revision 1.26  1994/08/10  19:55:19  john
13929  * Changed font stuff; Took out old menu; messed up lots of
13930  * other stuff like game sequencing messages, etc.
13931  *
13932  * Revision 1.25  1994/06/23  18:54:09  matt
13933  * Cleaned up game start/menu interaction, and improved main menu a little
13934  *
13935  * Revision 1.24  1994/06/21  12:11:50  yuan
13936  * Fixed up menus and added HUDisplay messages.
13937  *
13938  * Revision 1.23  1994/06/20  23:15:16  yuan
13939  * Color switching capability for the menus.
13940  *
13941  * Revision 1.22  1994/06/20  22:02:25  yuan
13942  * Made menu GREEN by POPULAR DEMAND!!
13943  *
13944  * Revision 1.21  1994/06/20  21:05:48  yuan
13945  * Fixed up menus.
13946  *
13947  * Revision 1.20  1994/06/20  19:19:29  yuan
13948  * Tidied up the menu and the "message blocks" between levels, etc.
13949  *
13950  * Revision 1.19  1994/06/17  18:01:10  john
13951  * A bunch of new stuff by John
13952  *
13953  * Revision 1.18  1994/05/16  09:37:22  matt
13954  * Got rid of global continue_flag
13955  *
13956  * Revision 1.17  1994/05/14  17:14:51  matt
13957  * Got rid of externs in source (non-header) files
13958  *
13959  * Revision 1.16  1994/05/10  12:14:26  yuan
13960  * Game save/load... Demo levels 1-5 added...
13961  * High scores fixed...
13962  *
13963  * Revision 1.15  1994/05/05  09:21:21  yuan
13964  * *** empty log message ***
13965  *
13966  * Revision 1.14  1994/04/29  14:55:40  mike
13967  * Change some menu colors.
13968  *
13969  * Revision 1.13  1994/04/28  18:04:36  yuan
13970  * Gamesave added.
13971  * Trigger problem fixed (seg pointer is replaced by index now.)
13972  *
13973  * Revision 1.12  1994/02/18  11:55:01  yuan
13974  * Fixed menu to be called from game.
13975  *
13976  * Revision 1.11  1994/02/10  17:45:39  yuan
13977  * Integrated some hacks which still need to be fixed.
13978  *
13979  * Revision 1.10  1994/02/01  22:50:23  yuan
13980  * Final menu version for demo
13981  *
13982  * Revision 1.9  1994/02/01  11:50:17  yuan
13983  * Moved quit message down just a tiny bit
13984  *
13985  * Revision 1.8  1994/01/31  17:30:16  yuan
13986  * Fixed quit not disappearing problem
13987  *
13988  * Revision 1.7  1994/01/31  12:25:20  yuan
13989  * New menu stuff
13990  *
13991  * Revision 1.6  1994/01/26  13:14:04  john
13992  * *** empty log message ***
13993  *
13994  * Revision 1.5  1993/12/29  16:44:44  yuan
13995  * Added some function definitions
13996  *
13997  * Revision 1.4  1993/12/13  18:53:12  yuan
13998  * Fixed dependency problem
13999  *
14000  * Revision 1.3  1993/12/12  13:53:51  yuan
14001  * Added menu and -g flag
14002  *
14003  * Revision 1.2  1993/12/10  16:07:17  yuan
14004  * Working on menu system.  Updated the title screen.
14005  *
14006  * Revision 1.1  1993/12/10  12:45:27  yuan
14007  * Initial revision
14008
14009 ------------------------------------------------------------------------
14010 main/mglobal.c:
14011
14012  * Revision 1.1  1995/12/05  16:03:10  allender
14013  * Initial revision
14014  *
14015  * Revision 1.3  1995/10/10  11:49:41  allender
14016  * removed malloc of static data now in ai module
14017  *
14018  * Revision 1.2  1995/07/12  12:48:52  allender
14019  * malloc out edge_list global here, not static in automap.c
14020  *
14021  * Revision 1.1  1995/05/16  15:27:40  allender
14022  * Initial revision
14023  *
14024  * Revision 2.2  1995/03/14  18:24:37  john
14025  * Force Destination Saturn to use CD-ROM drive.
14026  *
14027  * Revision 2.1  1995/03/06  16:47:23  mike
14028  * destination saturn
14029  *
14030  * Revision 2.0  1995/02/27  11:30:00  john
14031  * New version 2.0, which has no anonymous unions, builds with
14032  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14033  *
14034  * Revision 1.43  1995/01/19  17:00:53  john
14035  * Made save game work between levels.
14036  *
14037  * Revision 1.42  1994/12/05  14:23:53  adam
14038  * changed default detail to max, not custom
14039  *
14040  * Revision 1.41  1994/11/19  15:15:07  mike
14041  * remove unused code and data
14042  *
14043  * Revision 1.40  1994/11/03  10:13:19  yuan
14044  * Added #include "game.h"
14045  *
14046  * Revision 1.39  1994/11/03  10:09:59  matt
14047  * Properly initialize detail & difficulty levels
14048  *
14049  * Revision 1.38  1994/10/30  14:11:21  mike
14050  * rip out local segments stuff.
14051  *
14052  * Revision 1.37  1994/10/26  15:21:30  mike
14053  * detail level.
14054  *
14055  * Revision 1.36  1994/09/22  10:46:12  mike
14056  * Add difficulty levels.
14057  *
14058  * Revision 1.35  1994/09/13  11:19:11  mike
14059  * Add Next_missile_fire_time.
14060  *
14061  * Revision 1.34  1994/08/31  19:25:34  mike
14062  * GameTime and laser-firing limiting stuff added.
14063  *
14064  * Revision 1.33  1994/08/11  18:58:53  mike
14065  * Add Side_to_verts_int.
14066  *
14067  * Revision 1.32  1994/07/21  19:01:38  mike
14068  * Add Lsegment.
14069  *
14070  * Revision 1.31  1994/07/21  13:11:24  matt
14071  * Ripped out remants of old demo system, and added demo only system that
14072  * disables object movement and game options from menu.
14073  *
14074  * Revision 1.30  1994/06/17  18:06:48  matt
14075  * Made password be treated as lowercase, since cmdline parsing converts
14076  * everything to lowercase.
14077  *
14078  * Revision 1.29  1994/03/15  16:33:04  yuan
14079  * Cleaned up bm-loading code.
14080  * (Fixed structures too)
14081  *
14082  * Revision 1.28  1994/02/17  11:32:45  matt
14083  * Changes in object system
14084  *
14085  * Revision 1.27  1994/02/16  17:08:43  matt
14086  * Added needed include of 3d.h
14087  *
14088  * Revision 1.26  1994/02/16  13:47:58  mike
14089  * fix bugs so editor can compile out.
14090  *
14091  * Revision 1.25  1994/02/11  21:52:13  matt
14092  * Made password protection selectable by #define (and thus INFERNO.INI)
14093  *
14094  * Revision 1.24  1994/02/10  15:35:56  matt
14095  * Various changes to make editor compile out.
14096  *
14097  * Revision 1.23  1994/02/02  12:34:29  mike
14098  * take out BATS encryption.
14099  *
14100  * Revision 1.22  1994/01/21  16:08:11  matt
14101  * Added FrameCount variable
14102  *
14103  * Revision 1.21  1994/01/06  17:13:10  john
14104  * Added Video clip functionality
14105  *
14106  * Revision 1.20  1993/12/08  17:45:08  matt
14107  * Changed password again
14108  *
14109  * Revision 1.19  1993/12/08  17:41:05  matt
14110  * Changed password
14111  *
14112  * Revision 1.18  1993/12/08  10:55:10  mike
14113  * Add free_obj_list
14114  *
14115  * Revision 1.17  1993/12/07  13:46:38  john
14116  * Added Explosion bitmap array
14117  *
14118  * Revision 1.16  1993/12/06  18:40:35  matt
14119  * Changed object loading & handling
14120  *
14121  * Revision 1.15  1993/12/05  22:47:48  matt
14122  * Reworked include files in an attempt to cut down on build times
14123  *
14124  * Revision 1.14  1993/12/01  11:44:11  matt
14125  * Chagned Frfract to FrameTime
14126  *
14127  * Revision 1.13  1993/12/01  00:27:11  yuan
14128  * Implemented new bitmap structure system...
14129  * overall bitmap scheme still needs some work.
14130  *
14131  * Revision 1.12  1993/11/19  17:21:59  matt
14132  * Changed the bitmap number of object class UNICLASS
14133  * Removed static initialization for objects
14134  *
14135  * Revision 1.11  1993/11/18  13:51:47  mike
14136  * Add Classes, Class_views, Objects
14137  *
14138  * Revision 1.10  1993/11/04  18:52:36  matt
14139  * Made Vertices[] and Segment_points[] use same constant for size, since
14140  * they must be the same size anyway
14141  *
14142  * Revision 1.9  1993/11/04  14:01:06  matt
14143  * Mucked with include files
14144  *
14145  * Revision 1.8  1993/10/26  13:58:42  mike
14146  * Add password protection.
14147  *
14148  * Revision 1.7  1993/10/14  18:05:50  mike
14149  * Change Side_to_verts to use MAX_SIDES_PER_SEGMENT in place of CONNECTIVITY
14150  *
14151  * Revision 1.6  1993/10/12  13:57:19  john
14152  * added texture[]
14153  *
14154  * Revision 1.5  1993/10/12  09:58:15  mike
14155  * Move Side_to_verts here from eglobal.c, since it is needed in the game.
14156  *
14157  * Revision 1.4  1993/10/09  15:52:30  mike
14158  * Move test_pos, test_orient here from render.c.
14159  *
14160  * Revision 1.3  1993/10/02  18:15:45  mike
14161  * Killed include of segment.h, which gets included by inferno.h.
14162  *
14163  * Revision 1.2  1993/09/23  17:54:24  mike
14164  * Add Segment_points
14165  *
14166  * Revision 1.1  1993/09/23  15:01:50  mike
14167  * Initial revision
14168
14169 ------------------------------------------------------------------------
14170 main/mission.c:
14171
14172  * Revision 1.4  1995/10/31  10:21:40  allender
14173  * no mission support in shareware
14174  *
14175  * Revision 1.3  1995/10/21  22:53:04  allender
14176  * moved missions to data folder
14177  *
14178  * Revision 1.2  1995/09/13  08:47:29  allender
14179  * made to work with Chris' direct stuff
14180  *
14181  * Revision 1.1  1995/05/16  15:27:48  allender
14182  * Initial revision
14183  *
14184  * Revision 2.9  1995/05/26  16:16:32  john
14185  * Split SATURN into define's for requiring cd, using cd, etc.
14186  * Also started adding all the Rockwell stuff.
14187  *
14188  * Revision 2.8  1995/03/20  15:49:31  mike
14189  * Remove eof char from comment which confused make depend, causing
14190  * no mission.obj: line in makefile.  Pretty stupid tool, huh?
14191  *
14192  * Revision 2.7  1995/03/20  12:12:11  john
14193  * Added ifdef SATURN.
14194  *
14195  * Revision 2.6  1995/03/15  14:32:49  john
14196  * Added code to force the Descent CD-rom in the drive.
14197  *
14198  * Revision 2.5  1995/03/15  11:41:15  john
14199  * Better Saturn CD-ROM support.
14200  *
14201  * Revision 2.4  1995/03/14  18:24:14  john
14202  * Force Destination Saturn to use CD-ROM drive.
14203  *
14204  * Revision 2.3  1995/03/07  14:19:41  mike
14205  * More destination saturn stuff.
14206  *
14207  * Revision 2.2  1995/03/06  23:09:03  mike
14208  * more saturn stuff: make briefings work for saturn mission.
14209  *
14210  * Revision 2.1  1995/03/06  16:47:48  mike
14211  * destination saturn
14212  *
14213  * Revision 2.0  1995/02/27  11:27:49  john
14214  * New version 2.0, which has no anonymous unions, builds with
14215  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14216  *
14217  * Revision 1.14  1995/02/15  11:30:37  john
14218  * Fixed bug with potential mem overwrite on line 160.
14219  *
14220  * Revision 1.13  1995/02/10  17:53:20  matt
14221  * Changed mission name again
14222  *
14223  * Revision 1.12  1995/02/10  17:35:38  matt
14224  * Changed name of built-in mission
14225  *
14226  * Revision 1.11  1995/02/07  17:13:51  allender
14227  * removed return statement in load_mission so that built in mission will
14228  * actually set the Current_mission_name and _filename
14229  *
14230  * Revision 1.10  1995/01/31  01:19:45  matt
14231  * Made build_mission_list() sort missions by name
14232  *
14233  * Revision 1.9  1995/01/30  13:49:58  allender
14234  * changed build_mission_list in load_mission_by_name to include
14235  * anarchy levels.
14236  *
14237  * Revision 1.8  1995/01/30  13:03:51  matt
14238  * Fixed dumb mistake
14239  *
14240  * Revision 1.7  1995/01/30  12:55:22  matt
14241  * Added vars to point to mission names
14242  *
14243  * Revision 1.6  1995/01/22  18:57:28  matt
14244  * Made player highest level work with missions
14245  *
14246  * Revision 1.5  1995/01/22  14:13:08  matt
14247  * Added flag in mission list for anarchy-only missions
14248  *
14249  * Revision 1.4  1995/01/21  23:13:12  matt
14250  * Made high scores with (not work, really) with loaded missions
14251  * Don't give player high score when quit game
14252  *
14253  * Revision 1.3  1995/01/21  16:27:12  matt
14254  * Made endlevel briefing work with missions
14255  *
14256  * Revision 1.2  1995/01/20  22:47:50  matt
14257  * Mission system implemented, though imcompletely
14258  *
14259  * Revision 1.1  1995/01/20  13:42:19  matt
14260  * Initial revision
14261
14262 ------------------------------------------------------------------------
14263 main/mission.h:
14264
14265  * Revision 1.1  1995/05/16  15:59:22  allender
14266  * Initial revision
14267  *
14268  * Revision 2.0  1995/02/27  11:31:35  john
14269  * New version 2.0, which has no anonymous unions, builds with
14270  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14271  *
14272  * Revision 1.6  1995/01/30  12:55:41  matt
14273  * Added vars to point to mission names
14274  *
14275  * Revision 1.5  1995/01/22  18:57:21  matt
14276  * Made player highest level work with missions
14277  *
14278  * Revision 1.4  1995/01/22  14:13:21  matt
14279  * Added flag in mission list for anarchy-only missions
14280  *
14281  * Revision 1.3  1995/01/21  23:13:12  matt
14282  * Made high scores with (not work, really) with loaded missions
14283  * Don't give player high score when quit game
14284  *
14285  * Revision 1.2  1995/01/20  22:47:53  matt
14286  * Mission system implemented, though imcompletely
14287  *
14288  * Revision 1.1  1995/01/20  13:42:26  matt
14289  * Initial revision
14290
14291 ------------------------------------------------------------------------
14292 main/modem.h:
14293
14294  * Revision 1.2  1995/09/05  14:06:40  allender
14295  * checkpoint again
14296  *
14297  * Revision 1.1  1995/05/16  15:59:29  allender
14298  * Initial revision
14299  *
14300  * Revision 2.1  1995/03/21  14:40:38  john
14301  * Ifdef'd out the NETWORK code.
14302  *
14303  * Revision 2.0  1995/02/27  11:31:34  john
14304  * New version 2.0, which has no anonymous unions, builds with
14305  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14306  *
14307  * Revision 1.18  1994/11/22  17:12:05  rob
14308  * Starting working on secret level fix for modem games.
14309  *
14310  * Revision 1.17  1994/11/17  16:43:17  rob
14311  * Added prototype for com_level_sync function.
14312  *
14313  * Revision 1.16  1994/11/15  21:30:32  rob
14314  * Added prototype for new menu hook.
14315  *
14316  * Revision 1.15  1994/10/07  16:15:33  rob
14317  * Changed calls to multi_send_position.
14318  *
14319  * Revision 1.14  1994/10/07  12:52:24  rob
14320  * Fixed some problems.
14321  *
14322  * Revision 1.13  1994/10/07  11:25:47  rob
14323  * Tried to fix modem to work with new multi stuff.  Still a bit jacked up, tho.
14324  *
14325  * Revision 1.12  1994/10/05  19:14:50  rob
14326  * Exported macros and arrays to support network object mapping.
14327  *
14328  * Revision 1.11  1994/10/05  17:48:59  rob
14329  * Several changes, most to end_of_level sequencing.
14330  *
14331  * Revision 1.10  1994/10/05  14:22:54  rob
14332  * Added com_end_level.
14333  *
14334  * Revision 1.9  1994/09/30  18:37:22  rob
14335  * Another day's worth of work.  Mostly menus, error checking.  Added
14336  * level checksums during sync, carrier detect during all com calls,
14337  * generic com_abort() procedure for bailing out, and nm_messagebox
14338  * handling of QUIT instead of HUD message (which never gets seen).
14339  *
14340  * Revision 1.8  1994/09/29  20:55:16  rob
14341  * Lots of changes.
14342  *
14343  * Revision 1.7  1994/09/29  16:09:20  rob
14344  * Added explode stuff.
14345  *
14346  * Revision 1.6  1994/09/28  14:31:08  rob
14347  * Added serial setup menu.
14348  *
14349  * Revision 1.5  1994/09/27  15:02:49  rob
14350  * Null modem basic routines working.  Sending DEAD messages and
14351  * missiles still need to be done.
14352  *
14353  * Revision 1.4  1994/09/24  16:52:33  rob
14354  * Added stubbed funcs for startup and stop of serial games.
14355  *
14356  * Revision 1.3  1994/09/24  14:47:31  rob
14357  * New function protos.
14358  *
14359  * Revision 1.2  1994/09/22  17:53:29  rob
14360  * First revision, not yet functional.
14361  *
14362  * Revision 1.1  1994/09/22  12:39:25  rob
14363  * Initial revision
14364
14365 ------------------------------------------------------------------------
14366 main/morph.c:
14367
14368  * Revision 1.5  1995/08/23  21:36:10  allender
14369  * mcc compiler warnings fixed
14370  *
14371  * Revision 1.4  1995/08/12  11:34:19  allender
14372  * removed #ifdef NEWDEMO -- always in
14373  *
14374  * Revision 1.3  1995/07/28  15:39:51  allender
14375  * removed fixdiv thing
14376  *
14377  * Revision 1.2  1995/07/28  15:21:23  allender
14378  * inverse magnitude fixup thing
14379  *
14380  * Revision 1.1  1995/05/16  15:28:05  allender
14381  * Initial revision
14382  *
14383  * Revision 2.1  1995/02/27  18:26:33  john
14384  * Fixed bug that was caused by externing Polygon_models, and I had
14385  * changed the type of it in polyobj.c, thus causing page faults.
14386  *
14387  * Revision 2.0  1995/02/27  11:27:44  john
14388  * New version 2.0, which has no anonymous unions, builds with
14389  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14390  *
14391  * Revision 1.35  1995/02/22  14:45:37  allender
14392  * remove anonymous unions from object structure
14393  *
14394  * Revision 1.34  1995/01/14  19:16:52  john
14395  * First version of new bitmap paging code.
14396  *
14397  * Revision 1.33  1995/01/03  20:38:36  john
14398  * Externed MAX_MORPH_OBJECTS
14399  *
14400  * Revision 1.32  1994/11/17  15:34:04  matt
14401  * Attempt #4 to fix morph bug
14402  *
14403  * Revision 1.31  1994/11/15  10:57:14  matt
14404  * Tried again to fix morph
14405  *
14406  * Revision 1.30  1994/11/14  14:06:45  matt
14407  * Fixed stupid bug
14408  *
14409  * Revision 1.29  1994/11/14  11:55:13  matt
14410  * Added divide overflow check
14411  *
14412  * Revision 1.28  1994/09/26  17:28:14  matt
14413  * Made new multiple-object morph code work with the demo system
14414  *
14415  * Revision 1.27  1994/09/26  15:39:56  matt
14416  * Allow multiple simultaneous morphing objects
14417  *
14418  * Revision 1.26  1994/09/11  22:44:59  mike
14419  * quick on vecmat function.
14420  *
14421  * Revision 1.25  1994/08/26  15:36:00  matt
14422  * Made eclips usable on more than one object at a time
14423  *
14424  * Revision 1.24  1994/07/25  00:02:46  matt
14425  * Various changes to accomodate new 3d, which no longer takes point numbers
14426  * as parms, and now only takes pointers to points.
14427  *
14428  * Revision 1.23  1994/07/12  12:39:58  matt
14429  * Revamped physics system
14430  *
14431  * Revision 1.22  1994/06/28  11:54:51  john
14432  * Made newdemo system record/play directly to/from disk, so
14433  * we don't need the 4 MB buffer anymore.
14434  *
14435  * Revision 1.21  1994/06/27  15:53:01  john
14436  * #define'd out the newdemo stuff
14437  *
14438  *
14439  * Revision 1.20  1994/06/16  14:30:19  matt
14440  * Moved morph record data call to reder routine
14441  *
14442  * Revision 1.19  1994/06/16  13:57:23  matt
14443  * Added support for morphing objects in demos
14444  *
14445  * Revision 1.18  1994/06/16  12:24:23  matt
14446  * Made robot lighting not mess with Lighting_on so robots now night
14447  * according to this variable.
14448  *
14449  * Revision 1.17  1994/06/14  16:55:01  matt
14450  * Got rid of physics_object speed field
14451  *
14452  * Revision 1.16  1994/06/08  21:16:29  matt
14453  * Made objects spin while morphing
14454  *
14455  * Revision 1.15  1994/06/08  18:21:53  matt
14456  * Made morphing objects light correctly
14457  *
14458  * Revision 1.14  1994/06/07  16:50:49  matt
14459  * Made object lighting work correctly; changed name of Ambient_light to
14460  * Dynamic_light; cleaned up polygobj object rendering a little.
14461  *
14462  * Revision 1.13  1994/06/01  16:33:59  yuan
14463  * Fixed bug.
14464  *
14465  *
14466  * Revision 1.12  1994/06/01  16:29:08  matt
14467  * If morph_frame called on object this isn't the morph object, kill it.
14468  *
14469  * Revision 1.11  1994/06/01  12:46:34  matt
14470  * Added needed include
14471  *
14472  * Revision 1.10  1994/05/31  22:12:41  matt
14473  * Set lighting for morph objects
14474  * Don't let another object start morph while one is morphing, unless
14475  * that one dies.
14476  *
14477  * Revision 1.9  1994/05/31  18:49:53  john
14478  * Took out debugging printf's that Matt left in.
14479  *
14480  * Revision 1.8  1994/05/30  22:50:22  matt
14481  * Added morph effect for robots
14482
14483 ------------------------------------------------------------------------
14484 main/morph.h:
14485
14486  * Revision 1.2  1995/08/23  21:35:58  allender
14487  * fix mcc compiler warnings
14488  *
14489  * Revision 1.1  1995/05/16  15:59:37  allender
14490  * Initial revision
14491  *
14492  * Revision 2.0  1995/02/27  11:32:19  john
14493  * New version 2.0, which has no anonymous unions, builds with
14494  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14495  *
14496  * Revision 1.9  1995/01/04  12:20:46  john
14497  * Declearations to work better with game state save.
14498  *
14499  *
14500  * Revision 1.8  1995/01/03  20:38:44  john
14501  * Externed MAX_MORPH_OBJECTS
14502  *
14503  * Revision 1.7  1994/09/26  17:28:33  matt
14504  * Made new multiple-object morph code work with the demo system
14505  *
14506  * Revision 1.6  1994/09/26  15:40:17  matt
14507  * Allow multiple simultaneous morphing objects
14508  *
14509  * Revision 1.5  1994/06/28  11:55:19  john
14510  * Made newdemo system record/play directly to/from disk, so
14511  * we don't need the 4 MB buffer anymore.
14512  *
14513  * Revision 1.4  1994/06/16  13:57:40  matt
14514  * Added support for morphing objects in demos
14515  *
14516  * Revision 1.3  1994/06/08  18:22:03  matt
14517  * Made morphing objects light correctly
14518  *
14519  * Revision 1.2  1994/05/30  22:50:25  matt
14520  * Added morph effect for robots
14521  *
14522  * Revision 1.1  1994/05/30  12:04:19  matt
14523  * Initial revision
14524
14525 ------------------------------------------------------------------------
14526 main/multi.h:
14527
14528  * Revision 2.3  1995/04/03  08:49:50  john
14529  * Added code to get someone's player struct.
14530  *
14531  * Revision 2.2  1995/03/27  12:59:17  john
14532  * Initial version of multiplayer save games.
14533  *
14534  * Revision 2.1  1995/03/21  14:39:06  john
14535  * Ifdef'd out the NETWORK code.
14536  *
14537  * Revision 2.0  1995/02/27  11:28:34  john
14538  * New version 2.0, which has no anonymous unions, builds with
14539  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14540  *
14541  * Revision 1.74  1995/02/11  11:36:42  rob
14542  * Added new var.
14543  *
14544  * Revision 1.73  1995/02/08  18:17:41  rob
14545  * Added prototype for reset function.
14546  *
14547  * Revision 1.72  1995/02/05  14:37:42  rob
14548  * Made object mapping more efficient.
14549  *
14550  * Revision 1.71  1995/02/01  18:07:36  rob
14551  * Change object mapping to int functions.
14552  *
14553  * Revision 1.70  1995/02/01  12:55:00  rob
14554  * Changed message type.
14555  *
14556  * Revision 1.69  1995/01/31  12:46:12  rob
14557  * Fixed a bug with object overflow handling.
14558  *
14559  * Revision 1.68  1995/01/27  11:15:13  rob
14560  * removed extern of variable no longer in multi.c
14561  *
14562  * Revision 1.67  1995/01/24  11:53:13  john
14563  * Added better macro defining code.
14564  *
14565  * Revision 1.66  1995/01/24  11:32:03  john
14566  * Added new defining macro method.
14567  *
14568  * Revision 1.65  1995/01/23  17:17:06  john
14569  * Added multi_sending_message.
14570  *
14571  * Revision 1.64  1995/01/23  16:02:42  rob
14572  * Added prototype for mission select function.
14573  *
14574  * Revision 1.63  1995/01/18  19:01:21  rob
14575  * Added new message for hostage door sync.
14576  *
14577  * Revision 1.62  1995/01/14  18:39:57  rob
14578  * Added new message type for dropping robot powerups.
14579  *
14580  * Revision 1.61  1995/01/12  21:41:13  rob
14581  * Fixed incompat. with 1.0 and 1.1.
14582  *
14583  * Revision 1.60  1995/01/04  21:40:55  rob
14584  * Added new type for boss actions in coop.
14585  *
14586  * Revision 1.59  1995/01/04  11:38:09  rob
14587  * Fixed problem with lost character in messages.
14588  *
14589  * Revision 1.58  1995/01/03  20:12:44  rob
14590  * Made max message length in shareware = 40.
14591  *
14592  * Revision 1.57  1995/01/03  14:27:25  rob
14593  * ADded trigger messages.
14594  *
14595  * Revision 1.56  1995/01/02  20:08:21  rob
14596  * Added robot creation.
14597  *
14598  * Revision 1.55  1995/01/02  14:41:30  rob
14599  * Added score syncing.
14600  *
14601  * Revision 1.54  1994/12/21  21:02:01  rob
14602  * Added new message type for ROBOT_FIRE
14603  *
14604  * Revision 1.53  1994/12/21  17:27:25  rob
14605  * Changed the format for send_create_powerup messages.
14606  *
14607  *
14608  * Revision 1.52  1994/12/20  20:41:39  rob
14609  * ADded robot release message type.
14610  *
14611  * Revision 1.51  1994/12/19  19:00:12  rob
14612  * Changed buf to multibuf so it can be safely externed.
14613  *
14614  * Revision 1.50  1994/12/19  16:41:14  rob
14615  * Added new message types for robot support.
14616  * Added prototype for external use of multi_send_data (from multibot.c)
14617  *
14618  * Revision 1.49  1994/12/11  13:30:13  rob
14619  * Added new variables to get players out of nested menus.
14620  *
14621  * Revision 1.48  1994/12/11  01:58:57  rob
14622  * Added variable to track menu deth..
14623  *
14624  * Revision 1.47  1994/12/08  12:41:17  rob
14625  * Added audio taunts.
14626  *
14627  * Revision 1.46  1994/12/07  21:53:12  rob
14628  * Fixing sequencing bugginess in modem/serial.
14629  *
14630  * Revision 1.45  1994/12/07  16:46:58  rob
14631  * Added prototype.
14632  *
14633  * Revision 1.44  1994/12/01  12:22:31  rob
14634  * Added de-cloak message for demo.
14635  *
14636  * Revision 1.43  1994/12/01  00:54:14  rob
14637  * Added variable for tracking homing missiles.
14638  *
14639  * Revision 1.42  1994/11/30  16:04:39  rob
14640  * Added show reticle name variable for team games.
14641  *
14642  * Revision 1.41  1994/11/29  19:33:38  rob
14643  * Team support.
14644  *
14645  * Revision 1.40  1994/11/29  12:49:37  rob
14646  * Added more team support stuff.
14647  *
14648  * Revision 1.39  1994/11/28  21:20:49  rob
14649  * Cleaned up the .h file, removed an unused function.
14650  *
14651  * Revision 1.38  1994/11/28  21:04:50  rob
14652  * Added support for network sound-casting.
14653  *
14654  * Revision 1.37  1994/11/28  14:02:08  rob
14655  * Added protocol versioning for registered versus shareware.
14656  *
14657  * Revision 1.36  1994/11/28  13:30:04  rob
14658  * Added a define for protocol version.
14659  *
14660  * Revision 1.35  1994/11/22  19:19:48  rob
14661  * remove unused function.
14662  *
14663  * Revision 1.34  1994/11/22  18:47:34  rob
14664  * Added hooks for modem support for secret levels.
14665  *
14666  * Revision 1.33  1994/11/22  17:10:50  rob
14667  * Fix for secret levels in network play mode.
14668  *
14669  * Revision 1.32  1994/11/21  16:00:28  rob
14670  * Added secret-level hooks.
14671  *
14672  * Revision 1.31  1994/11/18  18:28:50  rob
14673  * Added new function for multiplayer score screen.
14674  *
14675  * Revision 1.30  1994/11/18  16:31:05  rob
14676  * Added kill list timer variable.
14677  *
14678  * Revision 1.29  1994/11/17  16:38:15  rob
14679  * Added creation of net powerups.
14680  *
14681  * Revision 1.28  1994/11/17  13:37:33  rob
14682  * Added prototype for multi_new_game.
14683  *
14684  * Revision 1.27  1994/11/17  12:58:45  rob
14685  * Added kill matrix.
14686  *
14687  * Revision 1.26  1994/11/16  20:35:24  rob
14688  * Changed explosion hook.
14689  *
14690  * Revision 1.25  1994/11/15  21:31:13  rob
14691  * Bumped max message size, was giving modem.c fits.
14692  *
14693  * Revision 1.24  1994/11/15  19:28:37  matt
14694  * Added prototypes
14695  *
14696  * Revision 1.23  1994/11/14  17:22:19  rob
14697  * Added extern for message macros.
14698  *
14699  * Revision 1.22  1994/11/11  18:16:44  rob
14700  * Made multi_menu_poll return a value to exit menus.
14701  *
14702  * Revision 1.21  1994/11/11  11:06:19  rob
14703  * Added prototype for multi_menu_poll.
14704  *
14705  * Revision 1.20  1994/11/10  21:48:41  rob
14706  * Changed multi_endlevel to return an int.
14707  *
14708  * Revision 1.19  1994/11/08  17:48:14  rob
14709  * Fixing endlevel stuff.
14710  *
14711  * Revision 1.18  1994/11/07  17:49:07  rob
14712  * Changed prototype for object mapping funcs.
14713  *
14714  * Revision 1.17  1994/11/07  15:46:32  rob
14715  * Changed the way remote object number mapping works, and it was a real
14716  * pain in the ass..  I think it will work more reliably now.
14717  *
14718  * Revision 1.16  1994/11/04  19:53:01  rob
14719  * Added a new message type for Player_leave 'explosions'.
14720  * Added a prototype for function moved over from network.c
14721  *
14722  * Revision 1.15  1994/11/02  18:02:33  rob
14723  * Added message type for control center firing.
14724  *
14725  * Revision 1.14  1994/11/02  11:38:00  rob
14726  * Added player-in-process-of-dying explosions to network game.
14727  *
14728  * Revision 1.13  1994/11/01  19:31:44  rob
14729  * Bumped max_net_create_objects to 20 to accomodate a fully equipped
14730  * character blowing up.
14731  *
14732  * Revision 1.12  1994/10/31  13:48:02  rob
14733  * Fixed bug in opening doors over network/modem.  Added a new message
14734  * type to multi.c that communicates door openings across the net.
14735  * Changed includes in multi.c and wall.c to accomplish this.
14736  *
14737  * Revision 1.11  1994/10/09  20:08:20  rob
14738  * Added some exported func prototypes.
14739  * Changed max net message length to 25 (from 30).
14740  * Removed some message types no longer used.
14741  *
14742  * Revision 1.10  1994/10/08  20:06:10  rob
14743  * fixed a typo.
14744  *
14745  * Revision 1.9  1994/10/08  19:59:43  rob
14746  * Moved MAX_MESSAGE_LEN to here.
14747  *
14748  * Revision 1.8  1994/10/07  23:09:54  rob
14749  * Fixed some prototypes.
14750  *
14751  * Revision 1.7  1994/10/07  18:11:19  rob
14752  * Added multi_do_death to multi.c.
14753  *
14754  * Revision 1.6  1994/10/07  16:14:32  rob
14755  * Added new message type for player reappear
14756  *
14757  * Revision 1.5  1994/10/07  12:58:17  rob
14758  * Added multi_leave_game.
14759  *
14760  * Revision 1.4  1994/10/07  12:17:17  rob
14761  * Fixed some stuff in multi_do_frame and exported the message_length
14762  * array.
14763  *
14764  * Revision 1.3  1994/10/07  11:10:17  john
14765  * Added function to parse multiple messages into individual
14766  * messages.
14767  *
14768  * Revision 1.2  1994/10/07  10:28:06  rob
14769  * Headers and stuff for multi.c (obviously)
14770  *
14771  * Revision 1.1  1994/10/06  16:07:39  rob
14772  * Initial revision
14773
14774 ------------------------------------------------------------------------
14775 main/multibot.h:
14776
14777  * Revision 1.2  1995/08/24  16:04:38  allender
14778  * fix function prototype for compiler warning
14779  *
14780  * Revision 1.1  1995/05/16  15:59:53  allender
14781  * Initial revision
14782  *
14783  * Revision 2.1  1995/03/21  14:40:18  john
14784  * Ifdef'd out the NETWORK code.
14785  *
14786  * Revision 2.0  1995/02/27  11:30:57  john
14787  * New version 2.0, which has no anonymous unions, builds with
14788  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14789  *
14790  * Revision 1.20  1995/02/06  18:18:05  rob
14791  * Tweaking cooperative stuff.
14792  *
14793  * Revision 1.19  1995/02/04  16:49:50  rob
14794  * Changed multi_send_robot_frame to return the number of robot positions that were sent.
14795  *
14796  * Revision 1.18  1995/02/04  12:29:32  rob
14797  * Added buffered fire sends.
14798  *
14799  * Revision 1.17  1995/01/30  17:22:02  rob
14800  * Added prototype for modem robot send function.
14801  *
14802  * Revision 1.16  1995/01/26  18:24:56  rob
14803  * Reduced # of controlled bots.
14804  *
14805  * Revision 1.15  1995/01/25  19:26:35  rob
14806  * Added define for robot laser agitation.
14807  *
14808  * Revision 1.14  1995/01/25  13:45:26  rob
14809  * Added prototype of robot transfer fucm.
14810  *
14811  * Revision 1.13  1995/01/14  19:01:08  rob
14812  * Added prototypes for new functionality.
14813  *
14814  * Revision 1.12  1995/01/12  16:41:53  rob
14815  * Added new prototypes.
14816  *
14817  * Revision 1.11  1995/01/12  15:42:55  rob
14818  * Fixing score awards for coop.
14819  *
14820  * Revision 1.10  1995/01/02  21:00:40  rob
14821  * added robot matcen support.
14822  *
14823  * Revision 1.9  1994/12/31  21:03:53  rob
14824  * More tweaking for robot behavior.
14825  *
14826  * Revision 1.8  1994/12/29  13:54:25  rob
14827  * Ooops.. fixed a bug..
14828  *
14829  * Revision 1.7  1994/12/29  12:51:38  rob
14830  * ADded proto for multi_robot_explode_sub
14831  *
14832  * Revision 1.6  1994/12/21  21:08:32  rob
14833  * Added new functions for robot firing.
14834  *
14835  * Revision 1.5  1994/12/21  19:04:02  rob
14836  * Fixing score accounting for multi robot games.
14837  *
14838  * Revision 1.4  1994/12/21  17:36:09  rob
14839  * Added a new func.
14840  *
14841  * Revision 1.3  1994/12/21  11:12:02  rob
14842  * Added new function and new vars.
14843  *
14844  * Revision 1.2  1994/12/19  16:41:42  rob
14845  * first revision.
14846  *
14847  * Revision 1.1  1994/12/16  15:48:20  rob
14848  * Initial revision
14849
14850 ------------------------------------------------------------------------
14851 main/netmisc.c:
14852
14853  * Revision 1.1  1995/05/16  15:28:41  allender
14854  * Initial revision
14855  *
14856  * Revision 2.0  1995/02/27  11:27:24  john
14857  * New version 2.0, which has no anonymous unions, builds with
14858  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14859  *
14860  * Revision 1.3  1994/11/19  15:19:34  mike
14861  * rip out unused code and data.
14862  *
14863  * Revision 1.2  1994/08/09  19:31:53  john
14864  * Networking changes.
14865  *
14866  * Revision 1.1  1994/08/08  11:06:07  john
14867  * Initial revision
14868
14869 ------------------------------------------------------------------------
14870 main/netmisc.h:
14871
14872  * Revision 1.1  1995/05/16  16:00:08  allender
14873  * Initial revision
14874  *
14875  * Revision 2.0  1995/02/27  11:30:18  john
14876  * New version 2.0, which has no anonymous unions, builds with
14877  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14878  *
14879  * Revision 1.2  1994/08/09  19:31:54  john
14880  * Networking changes.
14881  *
14882  * Revision 1.1  1994/08/08  11:18:40  john
14883  * Initial revision
14884
14885 ------------------------------------------------------------------------
14886 main/network.h:
14887
14888  * Revision 1.7  1995/10/31  10:20:04  allender
14889  * shareware stuff
14890  *
14891  * Revision 1.6  1995/09/21  14:31:18  allender
14892  * new appltalk type packet which contains shortpos
14893  *
14894  * Revision 1.5  1995/09/18  08:07:08  allender
14895  * added function prototype to remove netgame NBP
14896  *
14897  * Revision 1.4  1995/08/31  15:51:55  allender
14898  * new prototypes for join and start games
14899  *
14900  * Revision 1.3  1995/07/26  17:02:29  allender
14901  * implemented and working on mac
14902  *
14903  * Revision 1.2  1995/06/02  07:42:34  allender
14904  * fixed prototype for network_endlevel_poll2
14905  *
14906  * Revision 1.1  1995/05/16  16:00:15  allender
14907  * Initial revision
14908  *
14909  * Revision 2.2  1995/03/21  14:58:09  john
14910  * *** empty log message ***
14911  *
14912  * Revision 2.1  1995/03/21  14:39:43  john
14913  * Ifdef'd out the NETWORK code.
14914  *
14915  * Revision 2.0  1995/02/27  11:29:48  john
14916  * New version 2.0, which has no anonymous unions, builds with
14917  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14918  *
14919  * Revision 1.72  1995/02/11  14:24:39  rob
14920  * Added suppor for invul. cntrlcen.
14921  *
14922  * Revision 1.71  1995/02/08  19:18:43  rob
14923  * Added extern for segments checksum.
14924  *
14925  * Revision 1.70  1995/02/08  11:01:16  rob
14926  * Fixed a bug.
14927  *
14928  * Revision 1.69  1995/02/07  21:16:49  rob
14929  * Added flag for automap.
14930  *
14931  * Revision 1.68  1995/02/06  18:18:33  rob
14932  * Extern'ed Packet Urgent.
14933  *
14934  * Revision 1.67  1995/02/05  14:36:29  rob
14935  * Moved defines to network.h.
14936  *
14937  * Revision 1.66  1995/02/01  16:34:09  john
14938  * Linted.
14939  *
14940  * Revision 1.65  1995/01/30  21:14:35  rob
14941  * Fixed a bug in join menu.
14942  * Simplified mission load support.
14943  *
14944  * Revision 1.64  1995/01/30  18:19:40  rob
14945  * Added mission title to gameinfo packet.
14946  *
14947  * Revision 1.63  1995/01/28  17:02:39  rob
14948  * Fixed monitor syncing bug (minor 19).
14949  *
14950  * Revision 1.62  1995/01/27  11:15:25  rob
14951  * removed extern of variable no longer in network.c
14952  *
14953  * Revision 1.61  1995/01/26  12:17:34  rob
14954  * Added new param to network_do_frame.
14955  *
14956  * Revision 1.60  1995/01/22  17:32:11  rob
14957  * Added mission support for network games.
14958  *
14959  * Revision 1.59  1995/01/17  17:10:33  rob
14960  * Added some flags to netgame struct.
14961  *
14962  * Revision 1.58  1995/01/12  18:57:15  rob
14963  * Added score resync stuff.
14964  *
14965  * Revision 1.57  1995/01/12  16:42:18  rob
14966  * Added new prototypes.
14967  *
14968  * Revision 1.56  1995/01/05  12:12:10  rob
14969  * Fixed a problem with packet size.
14970  *
14971  * Revision 1.55  1995/01/05  11:12:36  rob
14972  * Reduced packet size by 1 byte just to be safe.
14973  *
14974  * Revision 1.54  1995/01/04  21:39:32  rob
14975  * New framedata packet for registered.
14976  *
14977  * Revision 1.53  1995/01/04  08:47:04  rob
14978  * JOHN CHECKED IN FOR ROB !!!
14979  *
14980  * Revision 1.52  1994/12/30  20:09:07  rob
14981  * ADded a toggle for showing player names on HUD.
14982  *
14983  * Revision 1.51  1994/12/29  15:59:52  rob
14984  * Centralized network disconnects.
14985  *
14986  * Revision 1.50  1994/12/09  21:21:57  rob
14987  * rolled back changes.
14988  *
14989  * Revision 1.48  1994/12/05  22:59:27  rob
14990  * added prototype for send_endlevel_packet.
14991  *
14992  * Revision 1.47  1994/12/05  21:47:34  rob
14993  * Added a new field to netgame struct.
14994  *
14995  * Revision 1.46  1994/12/05  14:39:16  rob
14996  * Added new variable to indicate new net game starting.
14997  *
14998  * Revision 1.45  1994/12/04  15:37:18  rob
14999  * Fixed a typo.
15000  *
15001  * Revision 1.44  1994/12/04  15:30:42  rob
15002  * Added new fields to netgame struct.
15003  *
15004  * Revision 1.43  1994/12/03  18:03:19  rob
15005  * ADded team kill syncing.
15006  *
15007  * Revision 1.42  1994/12/01  21:21:27  rob
15008  * Added new system for object sync on rejoin.
15009  *
15010  * Revision 1.41  1994/11/29  13:07:33  rob
15011  * Changed structure defs to .h files.
15012  *
15013  * Revision 1.40  1994/11/22  17:10:48  rob
15014  * Fix for secret levels in network play mode.
15015  *
15016  * Revision 1.39  1994/11/18  16:36:31  rob
15017  * Added variable network_rejoined to enable random placement
15018  * of rejoining palyers.
15019  *
15020  * Revision 1.38  1994/11/12  19:51:13  rob
15021  * Changed prototype for network_send_data to pass
15022  * urgent flag.
15023  *
15024  * Revision 1.37  1994/11/10  21:48:26  rob
15025  * Changed net_endlevel to return an int.
15026  *
15027  * Revision 1.36  1994/11/10  20:32:49  rob
15028  * Added extern for LastPacketTime.
15029  *
15030  * Revision 1.35  1994/11/09  11:36:34  rob
15031  * ADded return value to network_level_sync for success/fail.
15032  *
15033  * Revision 1.34  1994/11/08  21:22:31  rob
15034  * Added proto for network_endlevel_snyc
15035  *
15036  * Revision 1.33  1994/11/08  15:20:00  rob
15037  * added proto for change_playernum_to
15038  *
15039  * Revision 1.32  1994/11/07  17:45:40  rob
15040  * Added prototype for network_endlevel (called from multi.c)
15041  *
15042  * Revision 1.31  1994/11/04  19:52:37  rob
15043  * Removed a function from network.h (network_show_player_list)
15044  *
15045  * Revision 1.30  1994/11/01  19:39:26  rob
15046  * Removed a couple of variables that should be externed from multi.c
15047  * (remnants of the changover)
15048  *
15049  * Revision 1.29  1994/10/31  19:18:24  rob
15050  * Changed prototype for network_do_frame to add a parameter if you wish
15051  * to force the frame to be sent.  Important if this is a leave_game frame.
15052  *
15053  * Revision 1.28  1994/10/08  19:59:20  rob
15054  * Removed network message variables.
15055  *
15056  * Revision 1.27  1994/10/08  11:08:38  john
15057  * Moved network_delete_unused objects into multi.c,
15058  * took out network callsign stuff and used Matt's net
15059  * players[.].callsign stuff.
15060  *
15061  * Revision 1.26  1994/10/07  11:26:20  rob
15062  * Changed network_start_frame to network_do_frame,.
15063  *
15064  *
15065  * Revision 1.25  1994/10/05  13:58:10  rob
15066  * Added a new function net_endlevel that is called after each level is
15067  * completed.  Currently it only does anything if SERIAL game is in effect.
15068  *
15069  * Revision 1.24  1994/10/04  19:34:57  rob
15070  * export network_find_max_net_players.
15071  *
15072  * Revision 1.23  1994/10/04  17:31:10  rob
15073  * Exported MaxNumNetPlayers.
15074  *
15075  * Revision 1.22  1994/10/03  22:57:30  matt
15076  * Took out redundant definition of callsign_len
15077  *
15078  * Revision 1.21  1994/10/03  15:12:48  rob
15079  * Boosted MAX_CREATE_OBJECTS to 15.
15080  *
15081  * Revision 1.20  1994/09/30  18:19:51  rob
15082  * Added two new variables for tracking object creation.
15083  *
15084  * Revision 1.19  1994/09/27  15:03:18  rob
15085  * Added prototype for network_delete_extra_objects used by modem.c
15086  *
15087  * Revision 1.18  1994/09/27  14:36:45  rob
15088  * Added two new varaibles for network/serial weapon firing.
15089  *
15090  * Revision 1.17  1994/09/07  17:10:57  john
15091  * Started adding code to sync powerups.
15092  *
15093  * Revision 1.16  1994/09/06  19:29:05  john
15094  * Added trial version of rejoin function.
15095  *
15096  * Revision 1.15  1994/08/26  13:01:54  john
15097  * Put high score system in.
15098  *
15099  * Revision 1.14  1994/08/25  18:12:04  matt
15100  * Made player's weapons and flares fire from the positions on the 3d model.
15101  * Also added support for quad lasers.
15102  *
15103  * Revision 1.13  1994/08/17  16:50:00  john
15104  * Added damaging fireballs, missiles.
15105  *
15106  * Revision 1.12  1994/08/16  12:25:22  john
15107  * Added hooks for sending messages.
15108  *
15109  * Revision 1.11  1994/08/13  12:20:18  john
15110  * Made the networking uise the Players array.
15111  *
15112  * Revision 1.10  1994/08/12  22:41:27  john
15113  * Took away Player_stats; add Players array.
15114  *
15115  * Revision 1.9  1994/08/12  03:10:22  john
15116  * Made network be default off; Moved network options into
15117  * main menu.  Made starting net game check that mines are the
15118  * same.
15119  *
15120  * Revision 1.8  1994/08/11  21:57:08  john
15121  * Moved network options to main menu.
15122  *
15123  * Revision 1.7  1994/08/10  11:29:20  john
15124  * *** empty log message ***
15125  *
15126  * Revision 1.6  1994/08/10  10:44:12  john
15127  * Made net players fire..
15128  *
15129  * Revision 1.5  1994/08/09  19:31:46  john
15130  * Networking changes.
15131  *
15132  * Revision 1.4  1994/08/05  16:30:26  john
15133  * Added capability to turn off network.
15134  *
15135  * Revision 1.3  1994/08/05  16:11:43  john
15136  * Psuedo working version of networking.
15137  *
15138  * Revision 1.2  1994/07/25  12:33:34  john
15139  * Network "pinging" in.
15140  *
15141  * Revision 1.1  1994/07/20  16:09:05  john
15142  * Initial revision
15143
15144 ------------------------------------------------------------------------
15145 main/newdemo.c:
15146
15147  * Revision 1.12  1995/10/31  10:19:43  allender
15148  * shareware stuff
15149  *
15150  * Revision 1.11  1995/10/17  13:19:16  allender
15151  * close boxes for demo save
15152  *
15153  * Revision 1.10  1995/10/05  10:36:07  allender
15154  * fixed calls to digi_play_sample to account for differing volume and angle calculations
15155  *
15156  * Revision 1.9  1995/09/12  15:49:13  allender
15157  * define __useAppleExts__ if not already defined
15158  *
15159  * Revision 1.8  1995/09/05  14:28:32  allender
15160  * fixed previous N_players bug in newdemo_goto_end
15161  *
15162  * Revision 1.7  1995/09/05  14:16:51  allender
15163  * added space to allowable demo filename characters
15164  * and fixed bug with netgame demos N_players got getting
15165  * set correctly
15166  *
15167  * Revision 1.6  1995/09/01  16:10:47  allender
15168  * fixed bug with reading in N_players variable on
15169  * netgame demo playback
15170  *
15171  * Revision 1.5  1995/08/24  16:04:11  allender
15172  * fix signed byte problem
15173  *
15174  * Revision 1.4  1995/08/12  12:21:59  allender
15175  * made call to create_shortpos not swap the shortpos
15176  * elements
15177  *
15178  * Revision 1.3  1995/08/01  16:04:19  allender
15179  * made random picking of demo work
15180  *
15181  * Revision 1.2  1995/08/01  13:56:56  allender
15182  * demo system working on the mac
15183  *
15184  * Revision 1.1  1995/05/16  15:28:59  allender
15185  * Initial revision
15186  *
15187  * Revision 2.7  1995/05/26  16:16:06  john
15188  * Split SATURN into define's for requiring cd, using cd, etc.
15189  * Also started adding all the Rockwell stuff.
15190  *
15191  * Revision 2.6  1995/03/21  14:39:38  john
15192  * Ifdef'd out the NETWORK code.
15193  *
15194  * Revision 2.5  1995/03/14  18:24:31  john
15195  * Force Destination Saturn to use CD-ROM drive.
15196  *
15197  * Revision 2.4  1995/03/14  16:22:29  john
15198  * Added cdrom alternate directory stuff.
15199  *
15200  * Revision 2.3  1995/03/10  12:58:33  allender
15201  * only display rear view cockpit when cockpit mode was CM_FULL_COCKPIT.
15202  *
15203  * Revision 2.2  1995/03/08  16:12:15  allender
15204  * changes for Destination Saturn
15205  *
15206  * Revision 2.1  1995/03/08  12:11:26  allender
15207  * fix shortpos reading
15208  *
15209  * Revision 2.0  1995/02/27  11:29:40  john
15210  * New version 2.0, which has no anonymous unions, builds with
15211  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15212  *
15213  * Revision 1.189  1995/02/22  14:53:42  allender
15214  * missed some anonymous stuff
15215  *
15216  * Revision 1.188  1995/02/22  13:24:53  john
15217  * Removed the vecmat anonymous unions.
15218  *
15219  * Revision 1.187  1995/02/22  13:13:54  allender
15220  * remove anonymous unions from object structure
15221  *
15222  * Revision 1.186  1995/02/14  15:36:41  allender
15223  * fix fix for morph effect
15224  *
15225  * Revision 1.185  1995/02/14  11:25:48  allender
15226  * save cockpit mode and restore after playback.  get orientation for morph
15227  * effect when object is morph vclip
15228  *
15229  * Revision 1.184  1995/02/13  12:18:14  allender
15230  * change to decide about interpolating or not
15231  *
15232  * Revision 1.183  1995/02/12  00:46:23  adam
15233  * don't decide to skip frames until after at least 10 frames have
15234  * passed -- allender
15235  *
15236  * Revision 1.182  1995/02/11  22:34:01  john
15237  * Made textures page in for newdemos before playback time.
15238  *
15239  * Revision 1.181  1995/02/11  17:28:32  allender
15240  * strip frames from end of demo
15241  *
15242  * Revision 1.180  1995/02/11  16:40:35  allender
15243  * start of frame stripping debug code
15244  *
15245  * Revision 1.179  1995/02/10  17:40:06  allender
15246  * put back in wall_hit_process code to fix door problem
15247  *
15248  * Revision 1.178  1995/02/10  17:17:24  adam
15249  * allender } fix
15250  *
15251  * Revision 1.177  1995/02/10  17:16:24  allender
15252  * fix possible tmap problems
15253  *
15254  * Revision 1.176  1995/02/10  15:54:37  allender
15255  * changes for out of space on device.
15256  *
15257  * Revision 1.175  1995/02/09  19:55:00  allender
15258  * fix bug with morph recording -- force rendertype to RT_POLYOBJ when
15259  * playing back since it won't render until fully morphed otherwise
15260  *
15261  * Revision 1.174  1995/02/07  17:15:35  allender
15262  * DOH!!!!!
15263  *
15264  * Revision 1.173  1995/02/07  17:14:21  allender
15265  * immediately return when loading bogus level stuff when reading a frame
15266  *
15267  * Revision 1.172  1995/02/02  11:15:03  allender
15268  * after loading new level, read next frame (forward or back) always because
15269  * of co-op ships showing up when level is loaded
15270  *
15271  * Revision 1.171  1995/02/02  10:24:16  allender
15272  * removed cfile stuff.  Use standard FILE functions for demo playback
15273  *
15274  * Revision 1.170  1995/01/30  13:54:32  allender
15275  * support for missions
15276  *
15277  * Revision 1.169  1995/01/27  16:27:35  allender
15278  * put game mode to demo_game_mode when sorting multiplayer kill (and score)
15279  * list
15280  *
15281  * Revision 1.168  1995/01/27  09:52:25  allender
15282  * minor changes because of object/segment linking problems
15283  *
15284  * Revision 1.167  1995/01/27  09:22:28  allender
15285  * changed way multi-player score is recorded.  Record difference, not
15286  * actual
15287  *
15288  * Revision 1.166  1995/01/25  14:32:44  allender
15289  * changed with recorded player flags.  More checks for paused state
15290  * during interpolation reading of objects
15291  *
15292  * Revision 1.165  1995/01/25  11:23:32  allender
15293  * found bug with out of disk space problem
15294  *
15295  * Revision 1.164  1995/01/25  11:11:33  allender
15296  * coupla' things.  Fix problem with objects apparently being linked in
15297  * the wrong segment.  Put an Int3 in to check why demos will write to
15298  * end of space on drive. close demo file if demo doens't start playing
15299  * back.  Put obj->type == OBJ_ROBOT around checking for boss cloaking
15300  *
15301  * Revision 1.163  1995/01/24  19:44:30  allender
15302  * fix obscure problem with rewinding and having the wrong object linked
15303  * to the wrong segments.  will investigate further.
15304  *
15305  * Revision 1.162  1995/01/23  09:31:28  allender
15306  * add team score in team mode playback
15307  *
15308  * Revision 1.161  1995/01/20  22:47:39  matt
15309  * Mission system implemented, though imcompletely
15310  *
15311  * Revision 1.160  1995/01/20  09:30:37  allender
15312  * don't call LoadLevel with bogus data
15313  *
15314  * Revision 1.159  1995/01/20  09:13:23  allender
15315  * *&^%&*%$ typo
15316  *
15317  * Revision 1.158  1995/01/20  09:12:04  allender
15318  * record team names during demo recoring in GM_TEAM
15319  *
15320  * Revision 1.157  1995/01/19  16:31:09  allender
15321  * forgot to bump demo version for new weapon change stuff
15322  *
15323  * Revision 1.156  1995/01/19  16:29:33  allender
15324  * added new byte for weapon change (old weapon) so rewinding works
15325  * correctly for weapon changes in registered
15326  *
15327  * Revision 1.155  1995/01/19  15:00:05  allender
15328  * remove code to take away blastable walls in multiplayer demo playbacks
15329  *
15330  * Revision 1.154  1995/01/19  11:07:05  allender
15331  * put in psuedo cloaking for boss robots.  Problem is that cloaking is
15332  * time based, and that don't get done in demos, so bosses just disappear.
15333  * oh well
15334  *
15335  * Revision 1.153  1995/01/19  09:42:29  allender
15336  * record laser levels in demos
15337  *
15338  * Revision 1.152  1995/01/18  20:43:12  allender
15339  * fix laser level stuff on goto-beginning and goto-end
15340  *
15341  * Revision 1.151  1995/01/18  20:28:18  allender
15342  * cloak robots now cloak (except maybe for boss........)  Put in function
15343  * to deal with control center triggers
15344  *
15345  * Revision 1.150  1995/01/18  18:55:07  allender
15346  * bug fix
15347  *
15348  * Revision 1.149  1995/01/18  18:49:03  allender
15349  * lots 'o stuff....record laser level.  Record beginning of door opening
15350  * sequence.  Fix some problems with control center stuff.  Control center
15351  * triggers now work in reverse
15352  *
15353  * Revision 1.148  1995/01/18  08:51:40  allender
15354  * forgot to record ammo counts at beginning of demo
15355  *
15356  * Revision 1.147  1995/01/17  17:42:07  allender
15357  * added primary and secondary ammo counts.  Changed goto_end routine
15358  * to be more efficient
15359  *
15360  * Revision 1.146  1995/01/17  13:46:35  allender
15361  * fix problem with destroyed control center and rewinding a demo.
15362  * Save callsign and restore after demo playback
15363  *
15364  * Revision 1.145  1995/01/12  10:21:53  allender
15365  * fixes for 1.0 to 1.1 demo incompatibility
15366  *
15367  * Revision 1.144  1995/01/05  13:51:43  allender
15368  * fixed type of player num variable
15369  *
15370  * Revision 1.143  1995/01/04  16:58:28  allender
15371  * bumped up demo version number
15372  *
15373  * Revision 1.142  1995/01/04  14:59:02  allender
15374  * added more information to end of demo for registered.  Forced game mode
15375  * to be GM_NORMAL on demo playback
15376  *
15377  * Revision 1.141  1995/01/03  17:30:47  allender
15378  * fixed logic problem with cloak stuf
15379  *
15380  * Revision 1.140  1995/01/03  17:12:23  allender
15381  * fix for getting cloak stuff at end of demo for shareware
15382  *
15383  * Revision 1.139  1995/01/03  15:20:24  allender
15384  * fix goto_end for shareware -- changes to goto_end for registered
15385  *
15386  * Revision 1.138  1995/01/03  13:13:26  allender
15387  * add } I forgot
15388  *
15389  * Revision 1.137  1995/01/03  13:10:29  allender
15390  * make score work forwards and backwards
15391  *
15392  * Revision 1.136  1995/01/03  11:45:20  allender
15393  * added code to record players scores
15394  *
15395  * Revision 1.135  1994/12/30  10:03:57  allender
15396  * put cloak stuff at end of demo for fast forward to the end
15397  *
15398  * Revision 1.134  1994/12/29  17:02:55  allender
15399  * spelling fix on SHAREWARE
15400  *
15401  * Revision 1.133  1994/12/29  16:43:41  allender
15402  * lots of new multiplayer stuff.  wrapped much code with SHAREWARE defines
15403  *
15404  * Revision 1.132  1994/12/28  14:15:01  allender
15405  * added routines to deal with connecting and reconnecting players when
15406  * recording multiplayer demos
15407  *
15408  * Revision 1.131  1994/12/21  12:57:59  allender
15409  * bug fix
15410  *
15411  * Revision 1.130  1994/12/21  12:46:53  allender
15412  * record multi player deaths and kills
15413  *
15414  * Revision 1.129  1994/12/19  16:37:27  allender
15415  * pick good filename when trying to save in network play and player
15416  * gets bumped out of menu by multi-player code
15417  *
15418  * Revision 1.128  1994/12/14  10:49:01  allender
15419  * reset bad_read variable when starting demo playback
15420  *
15421  * Revision 1.127  1994/12/14  08:53:06  allender
15422  * lowered watermark for out of space
15423  *
15424  * Revision 1.126  1994/12/14  08:49:52  allender
15425  * put up warning when starting demo recording if not enough space and
15426  * not let them record
15427  *
15428  * Revision 1.125  1994/12/13  00:01:37  allender
15429  * CLOAK FIX -- (I'm tempted to take cloak out of game because I can't
15430  * seem to get it right in demo playback)
15431  *
15432  * Revision 1.124  1994/12/12  14:51:21  allender
15433  * more fixed to multiplayer cloak stuff
15434  *
15435  * Revision 1.123  1994/12/12  11:33:11  allender
15436  * fixed rearview mode to work again
15437  *
15438  * Revision 1.122  1994/12/12  11:00:16  matt
15439  * Added code to handle confusion with attached objects
15440  *
15441  * Revision 1.121  1994/12/12  00:31:29  allender
15442  * give better warning when out of space when recording.  Don't record
15443  * until no space left.  We have 500K watermark when we now stop recording
15444  *
15445  * Revision 1.120  1994/12/10  16:44:54  matt
15446  * Added debugging code to track down door that turns into rock
15447  *
15448  * Revision 1.119  1994/12/09  18:46:15  matt
15449  * Added code to handle odd error condition
15450  *
15451  * Revision 1.118  1994/12/09  17:27:37  allender
15452  * force playernum to 0 when demo is done playing
15453  *
15454  * Revision 1.117  1994/12/09  16:40:39  allender
15455  * yet more cloak stuff.  Assign cloak/invuln time when starting demo
15456  * if flags are set.  Check cloak and invuln time when demo
15457  * even when paused
15458  *
15459  * Revision 1.116  1994/12/09  14:59:22  matt
15460  * Added system to attach a fireball to another object for rendering purposes,
15461  * so the fireball always renders on top of (after) the object.
15462  *
15463  * Revision 1.115  1994/12/09  12:21:45  allender
15464  * only allow valid chars when typing in demo filename
15465  *
15466  * Revision 1.114  1994/12/08  23:19:02  allender
15467  * final(?) fix for getting cloak gauge to work on demo playback
15468  * with forward and reverse
15469  *
15470  * Revision 1.113  1994/12/08  21:34:38  allender
15471  * record old and new player flags to accuratedly record cloaking and
15472  * decloaking
15473  * ./
15474  *
15475  * Revision 1.112  1994/12/08  18:04:47  allender
15476  * bashed playernum right after reading it in demo header so shields
15477  * and energy are put in right place
15478  *
15479  * Revision 1.111  1994/12/08  17:10:07  allender
15480  * encode playernum in demo header.  Bash viewer segment to 0 if in
15481  * bogus segnum.  Don't link render objs for same reason
15482  *
15483  * Revision 1.110  1994/12/08  15:36:12  allender
15484  * cloak stuff works forwards and backwards
15485  *
15486  * Revision 1.109  1994/12/08  13:46:03  allender
15487  * don't record rearview anymore, but leave in case statement for playback
15488  * purposes.  change the way letterbox <--> cockpit transitions happen
15489  *
15490  * Revision 1.108  1994/12/08  12:36:06  matt
15491  * Added new object allocation & deallocation functions so other code
15492  * could stop messing around with internal object data structures.
15493  *
15494  * Revision 1.107  1994/12/08  11:19:04  allender
15495  * handle out of space (more) gracefully then before
15496  *
15497  * Revision 1.106  1994/12/08  00:29:49  allender
15498  * fixed bug that didn't load level on goto_beginning
15499  *
15500  * Revision 1.105  1994/12/08  00:11:51  mike
15501  * change matrix interpolation.
15502  *
15503  * Revision 1.104  1994/12/07  23:46:37  allender
15504  * changed invulnerability and cloak to work (almost) correctly both
15505  * in single and multi player
15506  *
15507  * Revision 1.103  1994/12/07  11:48:49  adam
15508  * BY ALLENDER -- added dampening of interpolation factor to 1 if greater
15509  * than 1 (although I have not seen this happen).  this is attempt to
15510  * get wobbling problem solved
15511  *
15512  * Revision 1.102  1994/12/07  11:23:56  allender
15513  * attempt at getting rid of wobbling on demo playback
15514  *
15515  * Revision 1.101  1994/12/06  19:31:17  allender
15516  * moved blastable wall stuff code to where we load level during demo
15517  * playback
15518  *
15519  * Revision 1.100  1994/12/06  19:21:51  allender
15520  * multi games, destroy blastable walls.  Do wall toggle when control center
15521  * destroyed
15522  *
15523  * Revision 1.99  1994/12/06  16:54:48  allender
15524  * fixed code so if demo automatically started from menu, don't bring up
15525  * message if demo is too old
15526  *
15527  * Revision 1.98  1994/12/06  13:55:15  matt
15528  * Use new rounding func, f2ir()
15529  *
15530  * Revision 1.97  1994/12/06  13:44:45  allender
15531  * suppressed compiler warnings
15532  *
15533  * Revision 1.96  1994/12/06  13:38:03  allender
15534  * removed recording of wall hit process.  I think that all bases are covered
15535  * elsewhere
15536  *
15537  * Revision 1.95  1994/12/06  12:57:35  allender
15538  * added recording of multi_decloaking.  Fixed some other cloaking code so
15539  * that cloak should last as long as player was cloaked.  We will lose the
15540  * guage effect, but the time is probably more important on playback
15541  *
15542  * Revision 1.94  1994/12/05  23:37:17  matt
15543  * Took out calls to warning() function
15544  *
15545  * Revision 1.93  1994/12/03  17:52:04  yuan
15546  * Localization 380ish
15547  *
15548  * Revision 1.92  1994/12/02  12:53:39  allender
15549  * fixed goto_beginning and goto_end on demo playback
15550  *
15551  * Revision 1.91  1994/12/01  12:01:49  allender
15552  * added multi player cloak stuff
15553  *
15554  * Revision 1.90  1994/11/30  09:33:58  allender
15555  * added field in header to tell what version (shareware or registered)
15556  * demo was recorded with.  Don't allow demo recorded on one to playback
15557  * on the other
15558  *
15559  * Revision 1.89  1994/11/29  00:31:01  allender
15560  * major changes -- added level recording feature which records level
15561  * advancement.  Changes to internal code to handle this.
15562  *
15563  * Revision 1.88  1994/11/27  23:13:54  matt
15564  * Made changes for new mprintf calling convention
15565  *
15566  * Revision 1.87  1994/11/27  23:07:35  allender
15567  * starting on code to get all level transitions recorded. not done yet
15568  *
15569  * Revision 1.86  1994/11/27  17:39:47  matt
15570  * Don't xlate tmap numbers when editor compiled out
15571  *
15572  * Revision 1.85  1994/11/23  09:27:21  allender
15573  * put up info box with message if demo version is too old or level
15574  * cannot be loaded
15575  *
15576  * Revision 1.84  1994/11/22  19:37:39  allender
15577  * fix array mistake
15578  *
15579  * Revision 1.83  1994/11/22  19:35:09  allender
15580  * record player ship colors in multiplayer demo recordings
15581  *
15582  * Revision 1.82  1994/11/19  15:36:42  mike
15583  * fix fix.
15584  *
15585  * Revision 1.81  1994/11/19  15:23:21  mike
15586  * rip out unused code
15587  *
15588  * Revision 1.80  1994/11/16  14:51:49  rob
15589  * Fixed network/demo incompatibility.
15590  *
15591  * Revision 1.79  1994/11/15  10:55:48  allender
15592  * made start of demo playback read initial demo information so
15593  * level will get loaded.  Made demo record to single file which
15594  * will get renamed.  Added numerics after old filename so
15595  * sequential filenames would be defaulted to
15596  *
15597  * Revision 1.78  1994/11/15  09:46:06  allender
15598  * added versioning.  Fixed problems with trying to interpolating a completely
15599  * 0 orientation matrix
15600  *
15601  * Revision 1.77  1994/11/14  14:34:31  matt
15602  * Fixed up handling when textures can't be found during remap
15603  *
15604  * Revision 1.76  1994/11/14  09:15:29  allender
15605  * make ESC from file save menu exit w/o saving.  Fix letterbox, rear view,
15606  * to normal cockpit mode transition to work correctly when skipping and
15607  * interpolating frames
15608  *
15609  * Revision 1.75  1994/11/11  16:22:07  allender
15610  * made morphing objects record only the object being morphed.
15611  *
15612  * Revision 1.74  1994/11/08  14:59:19  john
15613  * Added code to respond to network while in menus.
15614  *
15615  * Revision 1.73  1994/11/08  14:52:20  adam
15616  * *** empty log message ***
15617  *
15618  * Revision 1.72  1994/11/07  15:47:04  allender
15619  * prompt for filename when done recording demo
15620  *
15621  * Revision 1.71  1994/11/07  11:47:19  allender
15622  * when interpolating frames, delete weapon, fireball, and debris objects
15623  * from an inpolated frame if they don't appear in the next recorded
15624  * frame
15625  *
15626  * Revision 1.70  1994/11/07  11:02:41  allender
15627  * more with interpolation. I believe that I have it right now
15628  *
15629  * Revision 1.69  1994/11/07  08:47:40  john
15630  * Made wall state record.
15631  *
15632  * Revision 1.68  1994/11/05  17:22:51  john
15633  * Fixed lots of sequencing problems with newdemo stuff.
15634  *
15635  * Revision 1.67  1994/11/04  20:11:52  john
15636  * Neatening up palette stuff with demos.
15637  *
15638  * Revision 1.66  1994/11/04  16:49:44  allender
15639  * changed newdemo_do_interpolate to default to on
15640  *
15641  * Revision 1.65  1994/11/04  16:44:51  allender
15642  * added filename support for demo recording.  more auto demo stuff
15643  *
15644  * Revision 1.64  1994/11/04  13:05:31  allender
15645  * fixing the lifeleft variable again.  (I think I got it right this time)
15646  *
15647  * Revision 1.63  1994/11/04  11:37:37  allender
15648  * commented out fprintfs and fixed compiler warning
15649  *
15650  * Revision 1.62  1994/11/04  11:33:50  allender
15651  * added OBJ_FLARE and OBJ_LIGHT to obj->lifeleft recording
15652  *
15653  * Revision 1.61  1994/11/04  11:29:21  allender
15654  * more interpolation stuff -- not done yet.  Fixed so hostage vclips
15655  * render correctly.  Changed lifeleft to full precision, but only
15656  * write it when object is fireball or weapon type of object
15657  *
15658  * Revision 1.60  1994/11/03  10:00:11  allender
15659  * fixed divide by zero in calculating render time.  more interpolation
15660  * stuff which isn't quite done
15661  *
15662  * Revision 1.59  1994/11/02  17:10:59  allender
15663  * never play recorded frames when interpolation is occuring
15664  *
15665  * Revision 1.58  1994/11/02  14:28:58  allender
15666  * profile total playback time and average frame render time
15667  *
15668  * Revision 1.57  1994/11/02  14:09:03  allender
15669  * record rear view.  start of playback interpolation code -- this
15670  * is not yet done
15671  *
15672  * Revision 1.56  1994/11/01  13:25:30  allender
15673  * drop frames if playing back demo on slower machine
15674  *
15675  * Revision 1.55  1994/10/31  16:10:40  allender
15676  * record letterbox mode on death seq, and then restore
15677  *
15678  * Revision 1.54  1994/10/29  16:01:38  allender
15679  * added ND_STATE_NODEMOS to indicate that there are no demos currently
15680  * available for playback
15681  *
15682  * Revision 1.53  1994/10/29  15:38:42  allender
15683  * in newdemo_start_playback, make Newdemo_at_eof = 0
15684  *
15685  * Revision 1.52  1994/10/28  14:45:28  john
15686  * fixed typo from last checkin.
15687  *
15688  * Revision 1.51  1994/10/28  14:42:55  john
15689  * Added sound volumes to all sound calls.
15690  *
15691  * Revision 1.50  1994/10/28  14:31:57  allender
15692  * homing missle and autodemo stuff
15693  *
15694  * Revision 1.49  1994/10/28  12:42:14  allender
15695  * record homing distance
15696  *
15697  * Revision 1.48  1994/10/27  16:57:54  allender
15698  * changed demo vcr to be able to play any number of frames by storing
15699  * frame length (in bytes) in the demo file.  Added blowing up monitors
15700  *
15701  * Revision 1.47  1994/10/26  16:50:50  allender
15702  * put two functions inside of VCR_MODE ifdef
15703  *
15704  * Revision 1.46  1994/10/26  15:20:32  allender
15705  * added CT_REMOTE as valid control type for recording
15706  *
15707  * Revision 1.45  1994/10/26  14:45:35  allender
15708  * completed hacked in vcr demo playback stuff
15709  *
15710  * Revision 1.44  1994/10/26  13:40:52  allender
15711  * vcr playback of demo stuff
15712  *
15713  * Revision 1.43  1994/10/26  08:51:57  allender
15714  * record player weapon change
15715  *
15716  * Revision 1.42  1994/10/25  15:48:01  allender
15717  * add shields, energy, and player flags to demo recording.
15718  * ,
15719  *
15720  * Revision 1.41  1994/10/24  08:19:35  allender
15721  * fixed compilation errors
15722  *
15723  * Revision 1.40  1994/10/23  19:17:08  matt
15724  * Fixed bug with "no key" messages
15725  *
15726  * Revision 1.39  1994/10/22  14:15:08  mike
15727  * Suppress compiler warnings.
15728  *
15729  * Revision 1.38  1994/10/21  15:24:55  allender
15730  * compressed writing of object structures with specialized code
15731  * to write out only pertinent object structures.
15732  *
15733  * Revision 1.37  1994/10/20  13:03:17  matt
15734  * Replaced old save files (MIN/SAV/HOT) with new LVL files
15735  *
15736  * Revision 1.36  1994/09/28  23:13:10  matt
15737  * Macroized palette flash system
15738  *
15739  * Revision 1.35  1994/09/26  17:28:32  matt
15740  * Made new multiple-object morph code work with the demo system
15741  *
15742  * Revision 1.34  1994/09/10  13:31:54  matt
15743  * Made exploding walls a type of blastable walls.
15744  * Cleaned up blastable walls, making them tmap2 bitmaps.
15745  *
15746  * Revision 1.33  1994/08/15  18:05:28  john
15747  * *** empty log message ***
15748  *
15749  * Revision 1.32  1994/08/15  17:56:38  john
15750  * ,
15751  *
15752  * Revision 1.31  1994/08/10  09:44:54  john
15753  * *** empty log message ***
15754  *
15755  * Revision 1.30  1994/07/22  12:35:48  matt
15756  * Cleaned up editor/game interactions some more.
15757  *
15758  * Revision 1.29  1994/07/21  13:06:45  matt
15759  * Ripped out remants of old demo system, and added demo only system that
15760  * disables object movement and game options from menu.
15761  *
15762  * Revision 1.28  1994/07/18  16:22:44  john
15763  * Made all file read/writes call the same routine.
15764  *
15765  * Revision 1.27  1994/07/14  22:38:27  matt
15766  * Added exploding doors
15767  *
15768  * Revision 1.26  1994/07/05  12:49:04  john
15769  * Put functionality of New Hostage spec into code.
15770  *
15771  * Revision 1.25  1994/06/29  11:05:38  john
15772  * Made demos read in compressed.
15773  *
15774  * Revision 1.24  1994/06/29  09:14:06  john
15775  * Made files write out uncompressed and read in compressed.
15776  *
15777  * Revision 1.23  1994/06/28  11:55:28  john
15778  * Made newdemo system record/play directly to/from disk, so
15779  * we don't need the 4 MB buffer anymore.
15780  *
15781  * Revision 1.22  1994/06/27  15:52:38  john
15782  * #define'd out the newdemo stuff
15783  *
15784  *
15785  * Revision 1.21  1994/06/22  00:29:04  john
15786  * Fixed bug with playing demo then playing game without
15787  * loading new mine.
15788  *
15789  * Revision 1.20  1994/06/22  00:14:23  john
15790  * Attempted to fix sign.
15791  *
15792  * Revision 1.19  1994/06/21  23:57:54  john
15793  * Hopefully fixed bug with negative countdowns.
15794  *
15795  * Revision 1.18  1994/06/21  23:47:44  john
15796  * MAde Malloc always 4*1024*1024.
15797  *
15798  * Revision 1.17  1994/06/21  22:58:47  john
15799  * Added error if out of memory.
15800  *
15801  * Revision 1.16  1994/06/21  22:15:48  john
15802  * Added  % done to demo recording.
15803  *
15804  *
15805  * Revision 1.15  1994/06/21  19:45:55  john
15806  * Added palette effects to demo recording.
15807  *
15808  * Revision 1.14  1994/06/21  15:08:54  john
15809  * Made demo record HUD message and cleaned up the HUD code.
15810  *
15811  * Revision 1.13  1994/06/21  14:20:08  john
15812  * Put in hooks to record HUD messages.
15813  *
15814  * Revision 1.12  1994/06/20  11:50:15  john
15815  * Made demo record flash effect, and control center triggers.
15816  *
15817  * Revision 1.11  1994/06/17  18:01:33  john
15818  * A bunch of new stuff by John
15819  *
15820  * Revision 1.10  1994/06/17  12:13:31  john
15821  * More newdemo stuff; made editor->game transition start in slew mode.
15822  *
15823  * Revision 1.9  1994/06/16  13:14:36  matt
15824  * Fixed typo
15825  *
15826  * Revision 1.8  1994/06/16  13:02:07  john
15827  * Added morph hooks.
15828  *
15829  * Revision 1.7  1994/06/15  19:01:33  john
15830  * Added the capability to make 3d sounds play just once for the
15831  * laser hit wall effects.
15832  *
15833  * Revision 1.6  1994/06/15  14:56:59  john
15834  * Added triggers to demo recording.
15835  *
15836  * Revision 1.5  1994/06/14  20:42:15  john
15837  * Made robot matztn cntr not work until no robots or player are
15838  * in the segment.
15839  *
15840  * Revision 1.4  1994/06/14  14:43:27  john
15841  * Made doors work with newdemo system.
15842  *
15843  * Revision 1.3  1994/06/14  11:32:29  john
15844  * Made Newdemo record & restore the current mine.
15845  *
15846  * Revision 1.2  1994/06/13  21:02:43  john
15847  * Initial version of new demo recording system.
15848  *
15849  * Revision 1.1  1994/06/13  11:09:00  john
15850  * Initial revision
15851
15852 ------------------------------------------------------------------------
15853 main/newdemo.h:
15854
15855  * Revision 1.1  1995/05/16  16:00:24  allender
15856  * Initial revision
15857  *
15858  * Revision 2.0  1995/02/27  11:27:18  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.43  1995/01/19  09:41:43  allender
15863  * prototype for laser level recording
15864  *
15865  * Revision 1.42  1995/01/18  18:48:49  allender
15866  * added function prototype for door_open
15867  *
15868  * Revision 1.41  1995/01/17  17:42:31  allender
15869  * new prototypes for ammo counts
15870  *
15871  * Revision 1.40  1995/01/04  15:04:27  allender
15872  * added some different prototypes for registered
15873  *
15874  * Revision 1.39  1995/01/03  11:45:11  allender
15875  * extern function definition
15876  *
15877  * Revision 1.38  1994/12/29  16:43:31  allender
15878  * new function prototype
15879  *
15880  * Revision 1.37  1994/12/28  14:15:27  allender
15881  * new function prototypes
15882  *
15883  * Revision 1.36  1994/12/21  12:46:41  allender
15884  * new functions for multiplayer deaths and kills
15885  *
15886  * Revision 1.35  1994/12/12  11:32:55  allender
15887  * added new record function to restore after in rearview mode
15888  *
15889  * Revision 1.34  1994/12/08  21:03:15  allender
15890  * added new param to record_player_flags
15891  *
15892  * Revision 1.33  1994/12/08  13:47:01  allender
15893  * removed function call to record_rearview
15894  *
15895  * Revision 1.32  1994/12/06  12:57:10  allender
15896  * added new prototype for multi decloaking
15897  *
15898  * Revision 1.31  1994/12/01  11:46:34  allender
15899  * added recording prototype for multi player cloak
15900  *
15901  * Revision 1.30  1994/11/27  23:04:22  allender
15902  * function prototype for recording new levels
15903  *
15904  * Revision 1.29  1994/11/07  08:47:43  john
15905  * Made wall state record.
15906  *
15907  * Revision 1.28  1994/11/05  17:22:53  john
15908  * Fixed lots of sequencing problems with newdemo stuff.
15909  *
15910  * Revision 1.27  1994/11/04  16:48:49  allender
15911  * extern Newdemo_do_interpolate variable
15912  *
15913  * Revision 1.26  1994/11/02  14:08:53  allender
15914  * record rearview
15915  *
15916  * Revision 1.25  1994/10/31  13:35:04  allender
15917  * added two record functions to save and restore cockpit state on
15918  * death sequence
15919  *
15920  * Revision 1.24  1994/10/29  16:01:11  allender
15921  * added ND_STATE_NODEMOS to indicate that there are no demos currently
15922  * available for playback
15923  *
15924  * Revision 1.23  1994/10/28  12:41:58  allender
15925  * add homing distance recording event
15926  *
15927  * Revision 1.22  1994/10/27  16:57:32  allender
15928  * removed VCR_MODE stuff, and added monitor blowup effects
15929  *
15930  * Revision 1.21  1994/10/26  14:44:48  allender
15931  * completed hacked in vcr type demo playback states
15932  *
15933  * Revision 1.20  1994/10/26  13:40:38  allender
15934  * more vcr demo playback defines
15935  *
15936  * Revision 1.19  1994/10/26  08:51:26  allender
15937  * record player weapon change
15938  *
15939  * Revision 1.18  1994/10/25  16:25:31  allender
15940  * prototypes for shield, energy and flags
15941  *
15942  * Revision 1.17  1994/08/15  18:05:30  john
15943  * *** empty log message ***
15944  *
15945  * Revision 1.16  1994/07/21  13:11:26  matt
15946  * Ripped out remants of old demo system, and added demo only system that
15947  * disables object movement and game options from menu.
15948  *
15949  * Revision 1.15  1994/07/05  12:49:02  john
15950  * Put functionality of New Hostage spec into code.
15951  *
15952  * Revision 1.14  1994/06/27  15:53:12  john
15953  * #define'd out the newdemo stuff
15954  *
15955  *
15956  * Revision 1.13  1994/06/24  17:01:25  john
15957  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
15958  * took it out of game.c and into gameseq.c
15959  *
15960  * Revision 1.12  1994/06/21  19:46:05  john
15961  * Added palette effects to demo recording.
15962  *
15963  * Revision 1.11  1994/06/21  14:19:58  john
15964  * Put in hooks to record HUD messages.
15965  *
15966  * Revision 1.10  1994/06/20  11:50:42  john
15967  * Made demo record flash effect, and control center triggers.
15968  *
15969  * Revision 1.9  1994/06/17  18:01:29  john
15970  * A bunch of new stuff by John
15971  *
15972  * Revision 1.8  1994/06/17  12:13:34  john
15973  * More newdemo stuff; made editor->game transition start in slew mode.
15974  *
15975  * Revision 1.7  1994/06/16  13:02:02  john
15976  * Added morph hooks.
15977  *
15978  * Revision 1.6  1994/06/15  19:01:42  john
15979  * Added the capability to make 3d sounds play just once for the
15980  * laser hit wall effects.
15981  *
15982  * Revision 1.5  1994/06/15  14:57:11  john
15983  * Added triggers to demo recording.
15984  *
15985  * Revision 1.4  1994/06/14  20:42:19  john
15986  * Made robot matztn cntr not work until no robots or player are
15987  * in the segment.
15988  *
15989  * Revision 1.3  1994/06/14  14:43:52  john
15990  * Made doors work with newdemo system.
15991  *
15992  * Revision 1.2  1994/06/13  21:02:44  john
15993  * Initial version of new demo recording system.
15994  *
15995  * Revision 1.1  1994/06/13  15:51:09  john
15996  * Initial revision
15997
15998 ------------------------------------------------------------------------
15999 main/newmenu.c:
16000
16001  * Revision 1.26  1996/04/14  21:07:35  allender
16002  * some change for update
16003  *
16004  * Revision 1.25  1995/10/31  10:19:25  allender
16005  * shareware stuff
16006  *
16007  * Revision 1.24  1995/10/27  11:09:04  allender
16008  * always cd to descent dir before any menu processing --
16009  * sanity check because of way mac does volume mounting and
16010  * other file stuff
16011  *
16012  * Revision 1.23  1995/10/24  18:11:19  allender
16013  * do_appl_quit saves and restores background -- don't
16014  * do any special processing.  fixed newmenu_do3 to pass width
16015  * and height to ...do_4
16016  *
16017  * Revision 1.22  1995/10/21  23:26:25  allender
16018  * can't do cmd-q in multiplayer games
16019  *
16020  * Revision 1.21  1995/10/21  22:53:25  allender
16021  * menus need to be 8 byte multiple wide -- printscreen stuff
16022  *
16023  * Revision 1.20  1995/10/20  00:50:15  allender
16024  * redbook stuff and make esc leave menu always
16025  *
16026  * Revision 1.19  1995/10/17  13:14:52  allender
16027  * mouse support for other menus now operational -- dragging
16028  * mouse will also move sliders
16029  *
16030  * Revision 1.18  1995/10/12  17:35:19  allender
16031  * mouse support for pilot and demos
16032  *
16033  * Revision 1.17  1995/10/11  12:17:47  allender
16034  * removed event loop processing
16035  *
16036  * Revision 1.16  1995/10/10  11:51:29  allender
16037  * align menus to 8 byte boundry
16038  *
16039  * Revision 1.15  1995/10/05  14:09:36  allender
16040  * lowered starting x location on menus to fixup network
16041  * status screen chopping off characters
16042  *
16043  * Revision 1.14  1995/09/24  10:52:27  allender
16044  * made close boxes work
16045  * maybe some other minor stuff?
16046  *
16047  * Revision 1.13  1995/09/15  09:02:04  allender
16048  * started putting mouse support in listboxes
16049  *
16050  * Revision 1.12  1995/09/13  08:50:14  allender
16051  * close box in this rev?  Worked on getting list box better
16052  * looking
16053  *
16054  * Revision 1.11  1995/09/01  10:52:37  allender
16055  * fixed up list boxes
16056  *
16057  * Revision 1.10  1995/08/24  16:23:08  allender
16058  * mouse support for most menus
16059  *
16060  * Revision 1.9  1995/08/08  13:46:56  allender
16061  * added macsys header file
16062  *
16063  * Revision 1.8  1995/08/01  16:03:54  allender
16064  * added file list with Desalvo's directory stuff
16065  *
16066  * Revision 1.7  1995/07/26  17:03:37  allender
16067  * show then hide cursor during newmenu operations -- not quite
16068  * right yet
16069  *
16070  * Revision 1.6  1995/07/17  08:56:26  allender
16071  * fixed up menus to look better with new high res fonts
16072  *
16073  * Revision 1.5  1995/07/12  10:35:52  allender
16074  * removed old debug thing
16075  *
16076  * Revision 1.4  1995/06/23  10:23:21  allender
16077  * menus should work in any resolution now
16078  *
16079  * Revision 1.3  1995/06/20  09:11:19  allender
16080  * changed menu system to support 640x480 instead of 320x200
16081  *
16082  * Revision 1.2  1995/06/13  13:07:30  allender
16083  * added special key to move 320x200 window to upper left corner of screen
16084  *
16085  * Revision 1.1  1995/05/16  15:29:13  allender
16086  * Initial revision
16087  *
16088  * Revision 2.8  1995/05/26  16:16:28  john
16089  * Split SATURN into define's for requiring cd, using cd, etc.
16090  * Also started adding all the Rockwell stuff.
16091  *
16092  * Revision 2.7  1995/04/23  14:54:17  john
16093  * Fixed bug with background breaking in first menu.
16094  *
16095  * Revision 2.6  1995/03/21  14:38:46  john
16096  * Ifdef'd out the NETWORK code.
16097  *
16098  * Revision 2.5  1995/03/15  14:33:29  john
16099  * Added code to force the Descent CD-rom in the drive.
16100  *
16101  * Revision 2.4  1995/03/14  18:24:28  john
16102  * Force Destination Saturn to use CD-ROM drive.
16103  *
16104  * Revision 2.3  1995/03/14  16:22:23  john
16105  * Added cdrom alternate directory stuff.
16106  *
16107  * Revision 2.2  1995/03/06  18:30:51  john
16108  * Fixed bug with newmenu trashing editor font.
16109  *
16110  * Revision 2.1  1995/03/06  15:23:17  john
16111  * New screen techniques.
16112  *
16113  * Revision 2.0  1995/02/27  11:27:55  john
16114  * New version 2.0, which has no anonymous unions, builds with
16115  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16116  *
16117  * Revision 1.129  1995/02/11  16:19:56  john
16118  * Added code to make the default mission be the one last played.
16119  *
16120  * Revision 1.128  1995/02/02  19:41:33  john
16121  * Added 10 save game slots.
16122  *
16123  * Revision 1.127  1995/02/01  18:13:52  john
16124  * Fixed some constants.
16125  *
16126  * Revision 1.126  1995/02/01  18:04:01  yuan
16127  * Added 50 characters to list.
16128  *
16129  * Revision 1.125  1995/02/01  13:39:35  john
16130  * Made menu text that changes not overwrite.
16131  *
16132  * Revision 1.124  1995/01/31  10:47:57  john
16133  * Added menu that you can specify the width of the menu.
16134  *
16135  * Revision 1.123  1995/01/28  17:18:12  john
16136  * Added file list box.
16137  *
16138  * Revision 1.122  1995/01/27  17:15:55  john
16139  * Made prev comment actually work.
16140  *
16141  * Revision 1.121  1995/01/27  16:49:03  john
16142  * *** empty log message ***
16143  *
16144  * Revision 1.120  1995/01/27  16:46:40  john
16145  * Made so that input_menu only clears text if -empty-.
16146  *
16147  * Revision 1.119  1995/01/27  15:25:04  john
16148  * Delete saved game when deleteing a pilot file.
16149  *
16150  * Revision 1.118  1995/01/25  16:36:09  john
16151  * Made so that when you hit enter during
16152  * game save, -empty- goes away.
16153  *
16154  * Revision 1.117  1995/01/24  16:59:30  john
16155  * took out mono debugging text.
16156  *
16157  * Revision 1.116  1995/01/24  16:23:16  john
16158  * Fixed some bugs with listboxes.
16159  *
16160  * Revision 1.115  1995/01/23  23:47:36  matt
16161  * Made keypad enter work in menus
16162  *
16163  * Revision 1.114  1995/01/23  19:29:59  john
16164  * Added scrolling listbox menus.
16165  *
16166  * Revision 1.113  1995/01/19  12:33:34  john
16167  * Made keys jump to sliders, etc in menus.
16168  *
16169  * Revision 1.112  1995/01/15  14:33:08  rob
16170  * Fixed problem with nested nm_messageboxes.
16171  *
16172  * Revision 1.111  1995/01/03  17:33:40  john
16173  * Made scrolling textbox. Used it for scores cool saying.
16174  *
16175  * Revision 1.110  1994/12/28  10:42:58  john
16176  * More VFX tweaking.
16177  *
16178  * Revision 1.109  1994/12/28  10:26:39  john
16179  * Fixed some VFX problems.
16180  *
16181  * Revision 1.108  1994/12/15  23:18:10  john
16182  * Added fix so that VFX mode doesn't hang.
16183  *
16184  * Revision 1.107  1994/12/15  12:19:55  john
16185  * Made menu use clipped bitblt functions.
16186  *
16187  * Revision 1.106  1994/12/09  00:41:30  mike
16188  * fix hang in automap print screen
16189  *
16190  * Revision 1.105  1994/12/08  10:01:34  john
16191  * Changed the way the player callsign stuff works.
16192  *
16193  * Revision 1.104  1994/12/04  15:34:30  john
16194  * Fixed bug with newmenu not restoring font properly.
16195  *
16196  * Revision 1.103  1994/12/03  17:47:09  john
16197  * Fixed bug that didn't free filename mem when not .plr files found.
16198  *
16199  * Revision 1.102  1994/12/03  15:06:15  john
16200  * If no pilot exists, bring up box asking for name.
16201  *
16202  * Revision 1.101  1994/12/03  11:04:02  john
16203  * Changed newmenu code a bit to fix bug with bogus
16204  * backgrounds occcasionally.
16205  *
16206  * Revision 1.100  1994/12/01  20:15:48  yuan
16207  * Localization.
16208  *
16209  * Revision 1.99  1994/12/01  10:33:28  john
16210  * Fixed bug with large menu backgrounds not drawing correctly.
16211  *
16212  * Revision 1.98  1994/12/01  02:41:56  john
16213  * Fixed warnining.
16214  *
16215  * Revision 1.97  1994/11/30  22:52:43  john
16216  * Fixed bug in code that made the backgrounds behind menus.
16217  *
16218  * Revision 1.96  1994/11/30  19:47:42  john
16219  * Added a check for out o' memory when mallocing background.
16220  *
16221  * Revision 1.95  1994/11/30  19:39:10  john
16222  * ..
16223  *
16224  * Revision 1.94  1994/11/30  19:38:27  john
16225  * fixed bug with previous.
16226  *
16227  * Revision 1.93  1994/11/30  19:36:47  john
16228  * Made Gravis Ultrasound work again.  Made the scores blink
16229  * at a constant rate.  Revamped the newmenu background storage,
16230  * which hopefully fixed some bugs.  Made menus in ame not pause
16231  * sound, except for the pause key.               ^== Game!
16232  *
16233  * Revision 1.92  1994/11/30  18:06:05  matt
16234  * When player types space in callsign, comes up as underscore
16235  *
16236  * Revision 1.91  1994/11/30  12:28:22  adam
16237  * added PCX support
16238  *
16239  * Revision 1.90  1994/11/30  12:10:59  adam
16240  * added support for PCX titles/brief screens
16241  *
16242  * Revision 1.89  1994/11/29  00:59:12  allender
16243  * change newmenu_get_filename so demo files can be deleted too
16244  *
16245  * Revision 1.88  1994/11/27  21:16:18  allender
16246  * made some return values in newmenu_get_filename 0 instead of -1
16247  *
16248  * Revision 1.87  1994/11/27  16:58:17  matt
16249  * Made printscreen work all the time (not just when no ndebug) and made it
16250  * work when getting a filename.
16251  *
16252  * Revision 1.86  1994/11/27  16:47:51  john
16253  * Made the call to fade in palette only happen if it needs to be, just
16254  * because I thought it might reduce code paging with vm in menus.
16255  *
16256  * Revision 1.85  1994/11/26  15:30:16  matt
16257  * Allow escape out of change pilot menu
16258  *
16259  * Revision 1.84  1994/11/26  14:17:26  matt
16260  * Player can now only enter valid chars for his name
16261  *
16262  * Revision 1.83  1994/11/23  14:13:17  allender
16263  * if no demo files, displays less "techy" message
16264  *
16265  * Revision 1.82  1994/11/21  11:55:52  john
16266  * Fixed some sound pausing in menus bugs.
16267  *
16268  * Revision 1.81  1994/11/19  15:14:58  mike
16269  * remove unused code and data
16270  *
16271  * Revision 1.80  1994/11/18  23:37:54  john
16272  * Changed some shorts to ints.
16273  *
16274  * Revision 1.79  1994/11/15  09:29:21  john
16275  * Made it so that pressing a letter when selecting players moves to
16276  * a matching choice.
16277  *
16278  * Revision 1.78  1994/11/14  17:12:28  adam
16279  * *** empty log message ***
16280  *
16281  * Revision 1.77  1994/11/14  16:58:31  rob
16282  * Tried to fix a problem with save demo dialog.
16283  *
16284  * Revision 1.76  1994/11/14  16:13:46  matt
16285  * Fixed handling of players with DOS device names
16286  *
16287  * Revision 1.75  1994/11/13  18:12:53  matt
16288  * Fixed handling of filenames that are the same as DOS devices
16289  *
16290  * Revision 1.74  1994/11/13  17:20:44  john
16291  * Fixed text a bit.
16292  *
16293  * Revision 1.73  1994/11/13  17:18:22  john
16294  * Changed wording of new pilot.
16295  *
16296  * Revision 1.72  1994/11/13  17:14:21  john
16297  * Fixed bug with player list box.
16298  *
16299  * Revision 1.71  1994/11/13  17:12:48  john
16300  * Fixed broken demo file list.
16301  *
16302  * Revision 1.70  1994/11/13  17:04:49  john
16303  * Made the callsign entry be a list box and gave the ability
16304  * to delete players.
16305  *
16306  * Revision 1.69  1994/11/13  15:38:03  john
16307  * Added critical error handler to game.  Took out -editor command line
16308  * option because it didn't work anymore and wasn't worth fixing.  Made scores
16309  * not use MINER enviroment variable on release version, and made scores
16310  * not print an error if there is no descent.hi.
16311  *
16312  * Revision 1.68  1994/11/11  18:17:03  rob
16313  * Made multi_menu_poll return a value to exit menus.
16314  *
16315  * Revision 1.67  1994/11/11  11:07:06  rob
16316  * Added include of multi.h
16317  *
16318  * Revision 1.66  1994/11/10  20:25:16  rob
16319  * John's stuff to make network menus work.
16320  *
16321  * Revision 1.65  1994/11/08  14:51:39  john
16322  * Added nm_messagebox1, (like the original, only you can pass a function).
16323  *
16324  * Revision 1.64  1994/11/08  08:30:39  john
16325  * Fixed bug with centering titles.
16326  *
16327  * Revision 1.63  1994/11/08  08:27:00  john
16328  * Made titles and subtitles center.
16329  *
16330  * Revision 1.62  1994/11/07  09:40:48  john
16331  * Neatend file list box some.
16332  *
16333  * Revision 1.61  1994/11/05  17:22:41  john
16334  * Fixed lots of sequencing problems with newdemo stuff.
16335  *
16336  * Revision 1.60  1994/11/05  15:04:08  john
16337  * Added non-popup menu for the main menu, so that scores and credits don't have to save
16338  * the background.
16339  *
16340  * Revision 1.59  1994/11/05  14:03:52  john
16341  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
16342  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
16343  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
16344  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
16345  *
16346  * Revision 1.58  1994/11/04  20:11:50  john
16347  * Neatening up palette stuff with demos.
16348  *
16349  * Revision 1.57  1994/11/04  13:49:24  allender
16350  * fixed newmenu_get_filename to work with less than 10 files
16351  *
16352  * Revision 1.56  1994/11/03  19:37:44  john
16353  * Added scrolling file list box
16354  *
16355  * Revision 1.55  1994/10/31  18:16:42  john
16356  * Made Pad arrows work with menus.
16357  *
16358  * Revision 1.54  1994/10/28  14:54:25  john
16359  * Added forward dec. for newmenu_close.
16360  * .\
16361  *
16362  * Revision 1.53  1994/10/28  14:53:00  john
16363  * Fixed hideous bug that would bomb if you called newmenu_draw_background
16364  * before any menus were ever displayed.
16365  *
16366  * Revision 1.52  1994/10/24  19:56:53  john
16367  * Made the new user setup prompt for config options.
16368  *
16369  * Revision 1.51  1994/10/24  15:15:49  john
16370  * Made Esc exit nm_messagebox's,
16371  * ,
16372  *
16373  * Revision 1.50  1994/10/21  15:20:20  john
16374  * Made PrtScr do screen dump, not F2.
16375  *
16376  * Revision 1.49  1994/10/18  12:33:38  john
16377  * Only used copy the item text into the saved_text field
16378  * if it is an inputbox or inputbox_menu.
16379  *
16380  * Revision 1.48  1994/10/17  11:04:01  john
16381  * Made backtab work also.
16382  *
16383  * Revision 1.47  1994/10/17  10:47:49  john
16384  * MAde Tab work like down arrow.
16385  *
16386  * Revision 1.46  1994/10/17  10:45:10  john
16387  * Made the player able to abort death by pressing any button or key.
16388  *
16389  * Revision 1.45  1994/10/13  21:52:02  john
16390  * Made it so that if a messagebox has 1 choice, then
16391  * Esc will return -1.
16392  *
16393  * Revision 1.44  1994/10/13  11:35:38  john
16394  * Made Thrustmaster FCS Hat work.  Put a background behind the
16395  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
16396  * menu to new menu. Made F6 be calibrate joystick.
16397  *
16398  * Revision 1.43  1994/10/11  17:18:52  john
16399  * Fixed bug with sliders always starting at -1.
16400  *
16401  * Revision 1.42  1994/10/11  17:08:29  john
16402  * Added sliders for volume controls.
16403  *
16404  * Revision 1.41  1994/10/06  16:04:40  john
16405  * Made text items color differently than others. Adam
16406  * is gonna make a diff colored font for these.
16407  *
16408  * Revision 1.40  1994/10/06  15:08:23  rob
16409  * Allowed any negative key value to abort the menu and return.
16410  *
16411  * Revision 1.39  1994/10/04  10:26:06  matt
16412  * Changed fade in to happen every time a global var is set
16413  *
16414  * Revision 1.38  1994/10/04  09:16:08  john
16415  * If you pass -1 as choice in newmenu_do1, then
16416  * no item is highlighted until you press up or
16417  * down arrows.
16418  *
16419  * Revision 1.37  1994/10/03  23:44:37  matt
16420  * Save & restore palette effect around menus & pause message
16421  *
16422  * Revision 1.36  1994/10/03  22:59:40  matt
16423  * Re-enabled backspace to generate Int3()
16424  *
16425  * Revision 1.35  1994/10/03  19:11:21  matt
16426  * Changed string input cursor to blinking underscore
16427  *
16428  * Revision 1.34  1994/10/03  14:44:15  john
16429  * Added newmenu_do1, which allows you to pass the starting
16430  * item to the menu system
16431  *
16432  * Revision 1.33  1994/09/30  11:51:21  john
16433  * Added Matt's NM_TYPE_INPUT_MENU
16434  *
16435  * Revision 1.32  1994/09/28  17:22:56  matt
16436  * Added extra space between subtitle and menu items
16437  * Made shortcut key check ignore leading spaces in text
16438  *
16439  * Revision 1.31  1994/09/15  16:11:22  john
16440  * Added support for VFX1 head tracking. Fixed bug with memory over-
16441  * write when using stereo mode.
16442  *
16443  * Revision 1.30  1994/09/12  09:52:59  john
16444  * Made global flush function that flushes keyboard,mouse, and joystick.
16445  *
16446  * Revision 1.29  1994/09/10  19:10:54  matt
16447  * Fixed a few things (like arrow key handling) for menus with all
16448  * text items, such as the key help message.
16449  *
16450  * Revision 1.28  1994/09/01  18:55:38  john
16451  * freed scores.lbm
16452  *
16453  * Revision 1.27  1994/09/01  18:03:50  john
16454  * Neatened up scores a bit.
16455  *
16456  * Revision 1.26  1994/08/30  20:38:13  john
16457  * Passed citem in newmenu sub.
16458  *
16459  * Revision 1.25  1994/08/30  11:13:01  john
16460  * Added beveled edges to menus.
16461  *
16462  * Revision 1.24  1994/08/26  13:01:58  john
16463  * Put high score system in.
16464  *
16465  * Revision 1.23  1994/08/16  00:18:44  john
16466  * Made pressing the first letter of a menu
16467  * item move to it.
16468  *
16469  * Revision 1.22  1994/08/15  23:17:43  john
16470  * *** empty log message ***
16471  *
16472  * Revision 1.21  1994/08/15  23:15:28  john
16473  * Made 1 menu/checkbox return with any keypress.
16474  *
16475  * Revision 1.20  1994/08/12  10:18:23  john
16476  * *** empty log message ***
16477  *
16478  * Revision 1.19  1994/08/12  10:09:11  john
16479  * Made borders better.
16480  *
16481  * Revision 1.18  1994/08/12  03:11:16  john
16482  * Made network be default off; Moved network options into
16483  * main menu.  Made starting net game check that mines are the
16484  * same.
16485  *
16486  * Revision 1.17  1994/08/11  22:14:43  john
16487  * Free'd up some memory that I forgot to free.
16488  *
16489  * Revision 1.16  1994/08/11  19:27:35  john
16490  * Made the Backspace drop into the debugger only
16491  * if you're not in an inputbox.
16492  *
16493  * Revision 1.15  1994/08/11  18:01:49  matt
16494  * Added F2 and BACKSPACE keys to new menu system
16495  *
16496  * Revision 1.14  1994/08/11  14:25:58  john
16497  * *** empty log message ***
16498  *
16499  * Revision 1.13  1994/08/11  14:25:40  john
16500  * *** empty log message ***
16501  *
16502  * Revision 1.12  1994/08/11  13:47:02  john
16503  * Made newmenu have subtitles, passed key through to
16504  * the newmenu subfunctions.
16505  *
16506  * Revision 1.11  1994/08/11  12:45:08  john
16507  * *** empty log message ***
16508  *
16509  * Revision 1.10  1994/08/11  12:25:45  john
16510  * Made right_offset spacing different
16511  *
16512  * Revision 1.9  1994/08/11  12:09:49  john
16513  * Made work with bitmapped fonts.
16514  *
16515  * Revision 1.8  1994/08/10  19:56:16  john
16516  * Changed font stuff; Took out old menu; messed up lots of
16517  * other stuff like game sequencing messages, etc.
16518  *
16519  * Revision 1.7  1994/07/27  16:12:23  john
16520  * Changed newmenu system to have a callback function.
16521  * /.
16522  *
16523  * Revision 1.6  1994/07/25  15:10:23  john
16524  * *** empty log message ***
16525  *
16526  * Revision 1.5  1994/07/25  12:33:35  john
16527  * Network "pinging" in.
16528  *
16529  * Revision 1.4  1994/07/24  18:21:27  john
16530  * Took out first time stuff.
16531  *
16532  * Revision 1.3  1994/07/24  17:32:47  john
16533  * Added percent item.  Also neatend up a bit.
16534  *
16535  * Revision 1.2  1994/07/22  17:48:13  john
16536  * Added new menuing system.
16537  *
16538  * Revision 1.1  1994/07/22  13:55:38  john
16539  * Initial revision
16540
16541 ------------------------------------------------------------------------
16542 main/newmenu.h:
16543
16544  * Revision 1.3  1995/10/17  13:15:19  allender
16545  * new call to nm_listbox for close_box
16546  *
16547  * Revision 1.2  1995/09/13  08:48:50  allender
16548  * new prototype for newmenu -- have close box
16549  *
16550  * Revision 1.1  1995/05/16  16:00:32  allender
16551  * Initial revision
16552  *
16553  * Revision 2.0  1995/02/27  11:32:28  john
16554  * New version 2.0, which has no anonymous unions, builds with
16555  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16556  *
16557  * Revision 1.24  1995/02/11  16:20:05  john
16558  * Added code to make the default mission be the one last played.
16559  *
16560  * Revision 1.23  1995/01/31  10:21:41  john
16561  * Added code to specify width, height.
16562  *
16563  * Revision 1.22  1995/01/28  17:09:21  john
16564  * *** empty log message ***
16565  *
16566  * Revision 1.21  1995/01/23  18:38:43  john
16567  * Added listbox function.
16568  *
16569  * Revision 1.20  1994/11/26  15:29:55  matt
16570  * Allow escape out of change pilot menu
16571  *
16572  * Revision 1.19  1994/11/26  14:17:05  matt
16573  * Player can now only enter valid chars for his name
16574  *
16575  * Revision 1.18  1994/11/18  16:17:13  mike
16576  * prototype Max_linear_depth_objects.
16577  *
16578  * Revision 1.17  1994/11/08  14:51:17  john
16579  * Added nm_messagebox1, (like the original, only you can pass a function).
16580  *
16581  * Revision 1.16  1994/11/05  14:31:45  john
16582  * Added a new menu function for the background.
16583  *
16584  * Revision 1.15  1994/11/05  14:05:46  john
16585  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
16586  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
16587  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
16588  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
16589  *
16590  * Revision 1.14  1994/11/03  19:37:35  john
16591  * Added scrolling file list box
16592  *
16593  * Revision 1.13  1994/10/13  11:34:03  john
16594  * Made Thrustmaster FCS Hat work.  Put a background behind the
16595  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
16596  * menu to new menu. Made F6 be calibrate joystick.
16597  *
16598  * Revision 1.12  1994/10/11  17:08:32  john
16599  * Added sliders for volume controls.
16600  *
16601  * Revision 1.11  1994/10/04  10:26:23  matt
16602  * Changed fade in to happen every time a global var is set
16603  *
16604  * Revision 1.10  1994/10/03  14:43:56  john
16605  * Added newmenu_do1, which allows you to pass the starting
16606  * item to the menu system
16607  *
16608  * Revision 1.9  1994/09/30  11:51:33  john
16609  * Added Matt's NM_TYPE_INPUT_MENU
16610  *
16611  * Revision 1.8  1994/08/30  20:38:28  john
16612  * Passed citem in newmenu sub.
16613  *
16614  * Revision 1.7  1994/08/12  03:11:00  john
16615  * Made network be default off; Moved network options into
16616  * main menu.  Made starting net game check that mines are the
16617  * same.
16618  *
16619  * Revision 1.6  1994/08/11  13:47:05  john
16620  * Made newmenu have subtitles, passed key through to
16621  * the newmenu subfunctions.
16622  *
16623  * Revision 1.5  1994/07/27  16:12:24  john
16624  * Changed newmenu system to have a callback function.
16625  * /.
16626  *
16627  * Revision 1.4  1994/07/24  17:41:38  john
16628  * *** empty log message ***
16629  *
16630  * Revision 1.3  1994/07/24  17:33:01  john
16631  * Added percent item.  Also neatend up a bit.
16632  *
16633  * Revision 1.2  1994/07/22  17:48:12  john
16634  * Added new menuing system.
16635  *
16636  * Revision 1.1  1994/07/22  13:55:51  john
16637  * Initial revision
16638
16639 ------------------------------------------------------------------------
16640 main/object.c:
16641
16642  * Revision 1.5  1995/10/26  14:08:03  allender
16643  * optimization to do physics on objects that didn't render last
16644  * frame only every so often
16645  *
16646  * Revision 1.4  1995/10/20  00:50:57  allender
16647  * make alt texture for player ship work correctly when cloaked
16648  *
16649  * Revision 1.3  1995/09/14  14:11:32  allender
16650  * fix_object_segs returns void
16651  *
16652  * Revision 1.2  1995/08/12  11:31:01  allender
16653  * removed #ifdef NEWDEMO -- always in
16654  *
16655  * Revision 1.1  1995/05/16  15:29:23  allender
16656  * Initial revision
16657  *
16658  * Revision 2.3  1995/06/15  12:30:51  john
16659  * Fixed bug with multiplayer ships cloaking out wrongly.
16660  *
16661  * Revision 2.2  1995/05/15  11:34:53  john
16662  * Fixed bug as Matt directed that fixed problems with the exit
16663  * triggers being missed on slow frame rate computer.
16664  *
16665  * Revision 2.1  1995/03/21  14:38:51  john
16666  * Ifdef'd out the NETWORK code.
16667  *
16668  * Revision 2.0  1995/02/27  11:28:14  john
16669  * New version 2.0, which has no anonymous unions, builds with
16670  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16671  *
16672  * Revision 1.335  1995/02/22  12:57:30  allender
16673  * remove anonymous unions from object structure
16674  *
16675  * Revision 1.334  1995/02/09  22:04:40  mike
16676  * fix lifeleft on badass weapons.
16677  *
16678  * Revision 1.333  1995/02/08  12:54:00  matt
16679  * Fixed object freeing code which was deleting some explosions it shouldn't
16680  *
16681  * Revision 1.332  1995/02/08  11:37:26  mike
16682  * Check for failures in call to obj_create.
16683  *
16684  * Revision 1.331  1995/02/05  17:48:52  rob
16685  * Changed assert in obj_relink, more robust.
16686  *
16687  * Revision 1.330  1995/02/05  13:39:48  mike
16688  * remove invulnerability effect code (actually, comment out).
16689  *
16690  * Revision 1.329  1995/02/04  12:29:52  rob
16691  * Get rid of potential assert error for explosion detachment.
16692  *
16693  * Revision 1.328  1995/02/01  18:15:57  rob
16694  * Removed debugging output from engine glow change.
16695  *
16696  * Revision 1.327  1995/02/01  16:20:12  matt
16697  * Made engine glow vary over a wider range, and made the glow be based
16698  * on thrust/speed, without regard to direction.
16699  *
16700  * Revision 1.326  1995/01/29  14:46:24  rob
16701  * Fixed invul. vclip to only appear on player who is invul.
16702  *
16703  * Revision 1.325  1995/01/29  13:48:16  mike
16704  * Add invulnerability graphical effect viewable by other players.
16705  *
16706  * Revision 1.324  1995/01/29  11:39:25  mike
16707  * Add invulnerability effect.
16708  *
16709  * Revision 1.323  1995/01/27  17:02:41  mike
16710  * add more information to an Error call.
16711  *
16712  * Revision 1.322  1995/01/26  22:11:30  mike
16713  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
16714  *
16715  * Revision 1.321  1995/01/25  20:04:10  matt
16716  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
16717  *
16718  * Revision 1.320  1995/01/25  12:11:35  matt
16719  * Make sure orient matrix is orthogonal when resetting player object
16720  *
16721  * Revision 1.319  1995/01/21  21:46:22  mike
16722  * Optimize code in Assert (and prevent warning message).
16723  *
16724  * Revision 1.318  1995/01/21  21:22:16  rob
16725  * Removed HUD clear messages.
16726  * Added more Asserts to try and find illegal control type bug.
16727  *
16728  * Revision 1.317  1995/01/15  15:34:30  matt
16729  * When freeing object slots, don't free fireballs that will be deleting
16730  * other objects.
16731  *
16732  * Revision 1.316  1995/01/14  19:16:48  john
16733  * First version of new bitmap paging code.
16734  *
16735  * Revision 1.315  1995/01/12  18:53:37  john
16736  * Fixed parameter passing error.
16737  *
16738  * Revision 1.314  1995/01/12  12:09:47  yuan
16739  * Added coop object capability.
16740  *
16741  * Revision 1.313  1994/12/15  16:45:44  matt
16742  * Took out slew stuff for release version
16743  *
16744  * Revision 1.312  1994/12/15  13:04:25  mike
16745  * Replace Players[Player_num].time_total references with GameTime.
16746  *
16747  * Revision 1.311  1994/12/15  11:01:04  mike
16748  * add Object_minus_one for debugging.
16749  *
16750  * Revision 1.310  1994/12/15  03:03:33  matt
16751  * Added error checking for NULL return from object_create_explosion()
16752  *
16753  * Revision 1.309  1994/12/14  17:25:31  matt
16754  * Made next viewer func based on release not ndebug
16755  *
16756  * Revision 1.308  1994/12/13  12:55:42  mike
16757  * hostages on board messages for when you die.
16758  *
16759  * Revision 1.307  1994/12/12  17:18:11  mike
16760  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
16761  *
16762  * Revision 1.306  1994/12/12  00:27:11  matt
16763  * Added support for no-levelling option
16764  *
16765  * Revision 1.305  1994/12/11  22:41:14  matt
16766  * Added command-line option, -nolevel, which turns off player ship levelling
16767  *
16768  * Revision 1.304  1994/12/11  22:03:23  mike
16769  * free up object slots as necessary.
16770  *
16771  * Revision 1.303  1994/12/11  14:09:31  mike
16772  * make boss explosion sounds softer.
16773  *
16774  * Revision 1.302  1994/12/11  13:25:11  matt
16775  * Restored calls to fix_object_segs() when debugging is turned off, since
16776  * it's not a big routine, and could fix some possibly bad problems.
16777  *
16778  * Revision 1.301  1994/12/11  12:38:25  mike
16779  * make boss explosion sounds louder in create_small_fireball.
16780  *
16781  * Revision 1.300  1994/12/10  15:28:37  matt
16782  * Added asserts for debugging
16783  *
16784  * Revision 1.299  1994/12/09  16:18:51  matt
16785  * Fixed init_player_object, for editor
16786  *
16787  * Revision 1.298  1994/12/09  15:03:10  matt
16788  * Two changes for Mike:
16789  *   1.  Do better placement of camera during death sequence (prevents hang)
16790  *   2.  Only record dodging information if the player fired in a frame
16791  *
16792  * Revision 1.297  1994/12/09  14:59:12  matt
16793  * Added system to attach a fireball to another object for rendering purposes,
16794  * so the fireball always renders on top of (after) the object.
16795  *
16796  * Revision 1.296  1994/12/08  20:05:07  matt
16797  * Removed unneeded debug message
16798  *
16799  * Revision 1.295  1994/12/08  12:36:02  matt
16800  * Added new object allocation & deallocation functions so other code
16801  * could stop messing around with internal object data structures.
16802  *
16803  * Revision 1.294  1994/12/07  20:13:37  matt
16804  * Added debris object limiter
16805  *
16806  * Revision 1.293  1994/12/06  16:58:38  matt
16807  * Killed warnings
16808  *
16809  * Revision 1.292  1994/12/05  22:34:35  matt
16810  * Make tmap_override objects use override texture as alt texture.  This
16811  * should have the effect of making simpler models use the override texture.
16812  *
16813  * Revision 1.291  1994/12/05  12:23:53  mike
16814  * make camera start closer, but move away from player in death sequence.
16815  *
16816  * Revision 1.290  1994/12/02  11:11:18  mike
16817  * hook sound effect to player small explosions (ctrlcen, too).
16818  *
16819  * Revision 1.289  1994/11/28  21:50:52  mike
16820  * optimizations.
16821  *
16822  * Revision 1.288  1994/11/27  23:12:28  matt
16823  * Made changes for new mprintf calling convention
16824  *
16825  * Revision 1.287  1994/11/27  20:35:50  matt
16826  * Fixed dumb mistake
16827  *
16828  * Revision 1.286  1994/11/27  20:30:52  matt
16829  * Got rid of warning
16830  *
16831  * Revision 1.285  1994/11/21  11:43:21  mike
16832  * ndebug stuff.
16833  *
16834  * Revision 1.284  1994/11/19  15:19:37  mike
16835  * rip out unused code and data.
16836  *
16837  * Revision 1.283  1994/11/18  23:41:59  john
16838  * Changed some shorts to ints.
16839  *
16840  * Revision 1.282  1994/11/18  16:16:17  mike
16841  * Separate depth on objects vs. walls.
16842  *
16843  * Revision 1.281  1994/11/18  12:05:35  rob
16844  * Removed unnecessary invulnerability flag set in player death.
16845  * (I hope its unnecessary.. its commented out if it proves crucial)
16846  * fixes powerup dropping bug for net play.
16847  *
16848  * Revision 1.280  1994/11/16  20:36:34  rob
16849  * Changed player explosion (small) code.
16850  *
16851  * Revision 1.279  1994/11/16  18:26:04  matt
16852  * Clear tmap override on player, to fix "rock ship" bug
16853  *
16854  * Revision 1.278  1994/11/16  14:54:12  rob
16855  * Moved hook for network explosions.
16856  *
16857  * Revision 1.277  1994/11/14  11:40:42  mike
16858  * plot inner polygon on laser based on detail level.
16859  *
16860  * Revision 1.276  1994/11/10  14:02:59  matt
16861  * Hacked in support for player ships with different textures
16862  *
16863  * Revision 1.275  1994/11/08  12:19:08  mike
16864  * Make a generally useful function for putting small explosions on any object.
16865  *
16866  * Revision 1.274  1994/11/04  19:55:54  rob
16867  * Changed calls to player_explode to accomodate new parameter.
16868  *
16869  * Revision 1.273  1994/11/02  21:54:27  matt
16870  * Delete the camera when the death sequence is done
16871  *
16872  * Revision 1.272  1994/11/02  11:36:35  rob
16873  * Added player-in-process-of-dying explosions to network play.
16874  *
16875  * Revision 1.271  1994/10/31  17:25:33  matt
16876  * Fixed cloaked bug
16877  *
16878  * Revision 1.270  1994/10/31  16:11:19  allender
16879  * on demo recording, store letterbox mode in demo.
16880  *
16881  * Revision 1.269  1994/10/31  10:36:18  mike
16882  * Make cloak effect fadein/fadeout different for robots versus player.
16883  *
16884  * Revision 1.268  1994/10/30  14:11:44  mike
16885  * rip out repair center stuff.
16886  *
16887  * Revision 1.267  1994/10/28  19:43:52  mike
16888  * Boss cloaking effect.
16889  *
16890  * Revision 1.266  1994/10/27  11:33:42  mike
16891  * Add Highest_ever_object_index -- high water mark in object creation.
16892  *
16893  * Revision 1.265  1994/10/25  10:51:12  matt
16894  * Vulcan cannon powerups now contain ammo count
16895  *
16896  * Revision 1.264  1994/10/24  20:49:24  matt
16897  * Made cloaked objects pulse
16898  *
16899  * Revision 1.263  1994/10/21  12:19:45  matt
16900  * Clear transient objects when saving (& loading) games
16901  *
16902  * Revision 1.262  1994/10/21  11:25:23  mike
16903  * Use new constant IMMORTAL_TIME.
16904  *
16905  * Revision 1.261  1994/10/19  16:50:35  matt
16906  * If out of segment, put player in center of segment when checking objects
16907  *
16908  *
16909  * Revision 1.260  1994/10/17  23:21:55  mike
16910  * Clean up robot cloaking, move more to ai.c
16911  *
16912  * Revision 1.259  1994/10/17  21:34:49  matt
16913  * Added support for new Control Center/Main Reactor
16914  *
16915  * Revision 1.258  1994/10/17  21:18:04  mike
16916  * robot cloaking.
16917  *
16918  * Revision 1.257  1994/10/17  14:12:23  matt
16919  * Cleaned up problems with player dying from mine explosion
16920  *
16921  * Revision 1.256  1994/10/15  19:04:31  mike
16922  * Don't remove proximity bombs after you die.
16923  *
16924  * Revision 1.255  1994/10/14  15:57:00  mike
16925  * Don't show ids in network mode.
16926  * Fix, I hope, but in death sequence.
16927  *
16928  * Revision 1.254  1994/10/12  08:04:29  mike
16929  * Don't decloak player on death.
16930  *
16931  * Revision 1.253  1994/10/11  20:36:16  matt
16932  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
16933  *
16934  * Revision 1.252  1994/10/11  12:24:09  matt
16935  * Cleaned up/change badass explosion calls
16936  *
16937  * Revision 1.251  1994/10/08  19:30:20  matt
16938  * Fixed (I hope) a bug in cloaking of multiplayer objects
16939  *
16940  * Revision 1.250  1994/10/08  14:03:15  rob
16941  * Changed cloaking routine.
16942  *
16943  * Revision 1.249  1994/10/07  22:17:27  mike
16944  * Asserts on valid segnum.
16945  *
16946  * Revision 1.248  1994/10/07  19:11:14  matt
16947  * Added cool cloak transition effect
16948
16949 ------------------------------------------------------------------------
16950 main/object.h:
16951
16952  * Revision 1.6  1995/09/20  14:24:45  allender
16953  * swap bytes on extractshortpos
16954  *
16955  * Revision 1.5  1995/09/14  14:11:42  allender
16956  * fix_object_segs returns void
16957  *
16958  * Revision 1.4  1995/08/12  12:02:44  allender
16959  * added flag to create_shortpos
16960  *
16961  * Revision 1.3  1995/07/12  12:55:08  allender
16962  * move structures back to original form as found on PC because
16963  * of network play
16964  *
16965  * Revision 1.2  1995/06/19  07:55:06  allender
16966  * rearranged structure members for possible better alignment
16967  *
16968  * Revision 1.1  1995/05/16  16:00:40  allender
16969  * Initial revision
16970  *
16971  * Revision 2.1  1995/03/31  12:24:10  john
16972  * I had changed alt_textures from a pointer to a byte. This hosed old
16973  * saved games, so I restored it to an int.
16974  *
16975  * Revision 2.0  1995/02/27  11:26:47  john
16976  * New version 2.0, which has no anonymous unions, builds with
16977  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16978  *
16979  * Revision 1.122  1995/02/22  12:35:53  allender
16980  * remove anonymous unions
16981  *
16982  * Revision 1.121  1995/02/06  20:43:25  rob
16983  * Extern'ed Dead_player_camera so it can be reset by multi.c
16984  *
16985  * Revision 1.120  1995/02/01  16:34:07  john
16986  * Linted.
16987  *
16988  * Revision 1.119  1995/01/29  13:46:42  mike
16989  * adapt to new create_small_fireball_on_object prototype.
16990  *
16991  * Revision 1.118  1995/01/26  22:11:27  mike
16992  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
16993  *
16994  * Revision 1.117  1995/01/24  12:09:29  mike
16995  * Boost MAX_OBJECTS from 250 to 350.
16996  *
16997  * Revision 1.116  1995/01/13  19:39:51  rob
16998  * Removed outdated remote_info structure.  (looking for cause of bugs
16999  *
17000  * Revision 1.115  1995/01/12  12:09:38  yuan
17001  * Added coop object capability.
17002  *
17003  * Revision 1.114  1994/12/15  13:04:20  mike
17004  * Replace Players[Player_num].time_total references with GameTime.
17005  *
17006  * Revision 1.113  1994/12/12  17:18:09  mike
17007  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
17008  *
17009  * Revision 1.112  1994/12/09  14:58:42  matt
17010  * Added system to attach a fireball to another object for rendering purposes,
17011  * so the fireball always renders on top of (after) the object.
17012  *
17013  * Revision 1.111  1994/12/08  12:35:35  matt
17014  * Added new object allocation & deallocation functions so other code
17015  * could stop messing around with internal object data structures.
17016  *
17017  * Revision 1.110  1994/11/21  17:30:21  matt
17018  * Increased max number of objects
17019  *
17020  * Revision 1.109  1994/11/18  23:41:52  john
17021  * Changed some shorts to ints.
17022  *
17023  * Revision 1.108  1994/11/10  14:02:45  matt
17024  * Hacked in support for player ships with different textures
17025  *
17026  * Revision 1.107  1994/11/08  12:19:27  mike
17027  * Small explosions on objects.
17028  *
17029  * Revision 1.106  1994/10/25  10:51:17  matt
17030  * Vulcan cannon powerups now contain ammo count
17031  *
17032  * Revision 1.105  1994/10/21  12:19:41  matt
17033  * Clear transient objects when saving (& loading) games
17034  *
17035  * Revision 1.104  1994/10/21  11:25:04  mike
17036  * Add IMMORTAL_TIME.
17037  *
17038  * Revision 1.103  1994/10/17  21:34:54  matt
17039  * Added support for new Control Center/Main Reactor
17040  *
17041  * Revision 1.102  1994/10/14  18:12:28  mike
17042  * Make egg dropping return object number.
17043  *
17044  * Revision 1.101  1994/10/12  21:07:19  matt
17045  * Killed unused field in object structure
17046  *
17047  * Revision 1.100  1994/10/12  10:38:24  mike
17048  * Add field OF_SILENT to obj->flags.
17049  *
17050  * Revision 1.99  1994/10/11  20:35:48  matt
17051  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
17052  *
17053  * Revision 1.98  1994/10/03  20:56:13  rob
17054  * Added velocity to shortpos strucutre.
17055  *
17056  * Revision 1.97  1994/09/30  18:24:00  rob
17057  * Added new control type CT_REMOTE for remote controlled objects.
17058  * Also added a union struct 'remote_info' for this type.
17059  *
17060  * Revision 1.96  1994/09/28  09:23:05  mike
17061  * Prototype Object_type_names.
17062  *
17063  * Revision 1.95  1994/09/25  23:32:37  matt
17064  * Changed the object load & save code to read/write the structure fields one
17065  * at a time (rather than the whole structure at once).  This mean that the
17066  * object structure can be changed without breaking the load/save functions.
17067  * As a result of this change, the local_object data can be and has been
17068  * incorporated into the object array.  Also, timeleft is now a property
17069  * of all objects, and the object structure has been otherwise cleaned up.
17070  *
17071  * Revision 1.94  1994/09/25  15:45:28  matt
17072  * Added OBJ_LIGHT, a type of object that casts light
17073  * Added generalized lifeleft, and moved it to local_object
17074  *
17075  * Revision 1.93  1994/09/24  17:41:19  mike
17076  * Add stuff to Local_object structure for materialization centers.
17077  *
17078  * Revision 1.92  1994/09/24  13:16:50  matt
17079  * Added (hacked in, really) support for overriding the bitmaps used on to
17080  * texture map a polygon object, and using a new bitmap for all the faces.
17081  *
17082  * Revision 1.91  1994/09/22  19:02:14  mike
17083  * Prototype functions extract_shortpos and create_shortpos which reside in
17084  * gameseg.c, but are prototyped here to prevent circular dependencies.
17085  *
17086  * Revision 1.90  1994/09/15  21:47:14  mike
17087  * Prototype dead_player_end().
17088  *
17089  * Revision 1.89  1994/09/15  16:34:47  mike
17090  * Add danger_laser_num and danger_laser_signature to object_local to
17091  * enable robots to efficiently (too efficiently!) avoid player fire.
17092  *
17093  * Revision 1.88  1994/09/11  22:46:19  mike
17094  * Death_sequence_aborted prototyped.
17095  *
17096  * Revision 1.87  1994/09/09  20:04:30  mike
17097  * Add vclips for weapons.
17098  *
17099  * Revision 1.86  1994/09/09  14:20:54  matt
17100  * Added flag that says object uses thrust
17101  *
17102  * Revision 1.85  1994/09/08  14:51:32  mike
17103  * Make a crucial name change to a field of local_object struct.
17104  *
17105  * Revision 1.84  1994/09/07  19:16:45  mike
17106  * Homing missile.
17107  *
17108  * Revision 1.83  1994/09/06  17:05:43  matt
17109  * Added new type for dead player
17110  *
17111  * Revision 1.82  1994/09/02  11:56:09  mike
17112  * Add persistency (PF_PERSISTENT) to physics_info.
17113  *
17114  * Revision 1.81  1994/08/28  19:10:28  mike
17115  * Add Player_is_dead.
17116  *
17117  * Revision 1.80  1994/08/18  15:11:44  mike
17118  * powerup stuff.
17119  *
17120  * Revision 1.79  1994/08/15  15:24:54  john
17121  * Made players know who killed them; Disabled cheat menu
17122  * during net player; fixed bug with not being able to turn
17123  * of invulnerability; Made going into edit/starting new leve
17124  * l drop you out of a net game; made death dialog box.
17125  *
17126  * Revision 1.78  1994/08/14  23:15:12  matt
17127  * Added animating bitmap hostages, and cleaned up vclips a bit
17128  *
17129  * Revision 1.77  1994/08/13  14:58:27  matt
17130  * Finished adding support for miscellaneous objects
17131  *
17132  * Revision 1.76  1994/08/09  16:04:13  john
17133  * Added network players to editor.
17134  *
17135  * Revision 1.75  1994/08/03  21:06:19  matt
17136  * Added prototype for fix_object_segs(), and renamed now-unused spawn_pos
17137  *
17138  * Revision 1.74  1994/08/02  12:30:27  matt
17139  * Added support for spinning objects
17140  *
17141  * Revision 1.73  1994/07/27  20:53:25  matt
17142  * Added rotational drag & thrust, so turning now has momemtum like moving
17143  *
17144  * Revision 1.72  1994/07/27  19:44:21  mike
17145  * Objects containing objects.
17146  *
17147  * Revision 1.71  1994/07/22  20:43:29  matt
17148  * Fixed flares, by adding a physics flag that makes them stick to walls.
17149  *
17150  * Revision 1.70  1994/07/21  12:42:10  mike
17151  * Prototype new find_object_seg and update_object_seg.
17152  *
17153  * Revision 1.69  1994/07/19  15:26:39  mike
17154  * New ai_static structure.
17155  *
17156  * Revision 1.68  1994/07/13  00:15:06  matt
17157  * Moved all (or nearly all) of the values that affect player movement to
17158  * bitmaps.tbl
17159  *
17160  * Revision 1.67  1994/07/12  12:40:12  matt
17161  * Revamped physics system
17162  *
17163  * Revision 1.66  1994/07/06  15:26:23  yuan
17164  * Added chase mode.
17165
17166 ------------------------------------------------------------------------
17167 main/paging.c:
17168
17169  * Revision 1.5  1995/10/30  11:06:58  allender
17170  * added change to paging code ala John -- check tmap_override
17171  * when paging in robots
17172  *
17173  * Revision 1.4  1995/09/13  08:48:28  allender
17174  * John's new paging code
17175  *
17176  * Revision 1.3  1995/08/18  10:20:31  allender
17177  * changed hard coded black pixel value to use BM_XRGB
17178  *
17179  * Revision 1.2  1995/07/26  17:02:10  allender
17180  * small fix to page in effect bitmaps correctly
17181  *
17182  * Revision 1.1  1995/05/16  15:29:35  allender
17183  * Initial revision
17184  *
17185  * Revision 2.5  1995/10/07  13:18:21  john
17186  * Added PSX debugging stuff that builds .PAG files.
17187  *
17188  * Revision 2.4  1995/08/24  13:40:03  john
17189  * Added code to page in vclip for powerup disapperance and to
17190  * fix bug that made robot makers not page in the correct bot
17191  * textures.
17192  *
17193  * Revision 2.3  1995/07/26  12:09:19  john
17194  * Made code that pages in weapon_info->robot_hit_vclip not
17195  * page in unless it is a badass weapon.  Took out old functionallity
17196  * of using this if no robot exp1_vclip, since all robots have these.
17197  *
17198  * Revision 2.2  1995/07/24  13:22:11  john
17199  * Made sure everything gets paged in at the
17200  * level start.  Fixed bug with robot effects not
17201  * getting paged in correctly.
17202  *
17203  * Revision 2.1  1995/05/12  15:50:16  allender
17204  * fix to check effects dest_bm_num > -1 before paging in
17205  *
17206  * Revision 2.0  1995/02/27  11:27:39  john
17207  * New version 2.0, which has no anonymous unions, builds with
17208  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17209  *
17210  * Revision 1.18  1995/02/22  14:12:28  allender
17211  * remove anonyous union from object structure
17212  *
17213  * Revision 1.17  1995/02/11  22:54:15  john
17214  * Made loading for pig not show up for demos.
17215  *
17216  * Revision 1.16  1995/02/11  22:37:04  john
17217  * Made cockpit redraw.
17218  *
17219  * Revision 1.15  1995/01/28  16:29:35  john
17220  * *** empty log message ***
17221  *
17222  * Revision 1.14  1995/01/27  17:16:18  john
17223  * Added code to page in all the weapons.
17224  *
17225  * Revision 1.13  1995/01/24  21:51:22  matt
17226  * Clear the boxed message to fix a mem leakage
17227  *
17228  * Revision 1.12  1995/01/23  13:00:46  john
17229  * Added hostage vclip paging.
17230  *
17231  * Revision 1.11  1995/01/23  12:29:52  john
17232  * Added code to page in eclip on robots, dead control center,
17233  * gauges bitmaps, and weapon pictures.
17234  *
17235  * Revision 1.10  1995/01/21  12:54:15  adam
17236  * *** empty log message ***
17237  *
17238  * Revision 1.9  1995/01/21  12:41:29  adam
17239  * changed orb to loading box
17240  *
17241  * Revision 1.8  1995/01/18  15:09:02  john
17242  * Added start/stop time around paging.
17243  * Made paging clear screen around globe.
17244  *
17245  * Revision 1.7  1995/01/18  10:37:00  john
17246  * Added code to page in exploding monitors.
17247  *
17248  * Revision 1.6  1995/01/17  19:03:35  john
17249  * Added cool spinning orb during loading.
17250  *
17251  * Revision 1.5  1995/01/17  14:49:26  john
17252  * Paged in weapons.
17253  *
17254  * Revision 1.4  1995/01/17  12:14:07  john
17255  * Made walls, object explosion vclips load at level start.
17256  *
17257  * Revision 1.3  1995/01/15  13:23:24  john
17258  * First working version
17259  *
17260  * Revision 1.2  1995/01/15  11:56:45  john
17261  * Working version of paging.
17262  *
17263  * Revision 1.1  1995/01/15  11:33:37  john
17264  * Initial revision
17265
17266 ------------------------------------------------------------------------
17267 main/paging.h:
17268
17269  * Revision 1.1  1995/05/16  16:00:48  allender
17270  * Initial revision
17271  *
17272  * Revision 2.0  1995/02/27  11:30:12  john
17273  * New version 2.0, which has no anonymous unions, builds with
17274  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17275  *
17276  * Revision 1.2  1995/01/15  11:56:39  john
17277  * Working version of paging.
17278  *
17279  * Revision 1.1  1995/01/15  11:33:52  john
17280  * Initial revision
17281
17282 ------------------------------------------------------------------------
17283 main/physics.c:
17284
17285  * Revision 1.5  1995/10/12  17:28:08  allender
17286  * put in code to move and object to center of segment in
17287  * do_physics sim when fvi fails with bad point
17288  *
17289  * Revision 1.4  1995/08/23  21:32:44  allender
17290  * fix mcc compiler warnings
17291  *
17292  * Revision 1.3  1995/07/28  15:38:56  allender
17293  * removed isqrt thing -- not required here
17294  *
17295  * Revision 1.2  1995/07/28  15:13:29  allender
17296  * fixed vector magnitude thing
17297  *
17298  * Revision 1.1  1995/05/16  15:29:42  allender
17299  * Initial revision
17300  *
17301  * Revision 2.2  1995/03/24  14:48:54  john
17302  * Added cheat for player to go thru walls.
17303  *
17304  * Revision 2.1  1995/03/20  18:15:59  john
17305  * Added code to not store the normals in the segment structure.
17306  *
17307  * Revision 2.0  1995/02/27  11:32:06  john
17308  * New version 2.0, which has no anonymous unions, builds with
17309  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17310  *
17311  * Revision 1.213  1995/02/22  13:40:48  allender
17312  * remove anonymous unions from object structure
17313  *
17314  * Revision 1.212  1995/02/22  13:24:42  john
17315  * Removed the vecmat anonymous unions.
17316  *
17317  * Revision 1.211  1995/02/06  19:46:59  matt
17318  * New function (untested), set_thrust_from_velocity()
17319  *
17320  * Revision 1.210  1995/02/02  16:26:12  matt
17321  * Changed assert that was causing a problem
17322  *
17323  * Revision 1.209  1995/02/02  14:07:00  matt
17324  * Fixed confusion about which segment you are touching when you're
17325  * touching a wall.  This manifested itself in spurious lava burns.
17326  *
17327  * Revision 1.208  1995/02/01  21:03:24  john
17328  * Lintified.
17329  *
17330  * Revision 1.207  1995/01/25  13:53:35  rob
17331  * Removed an Int3 from multiplayer games.
17332  *
17333  * Revision 1.206  1995/01/23  17:30:47  rob
17334  * Removed Int3 on bogus sim time.
17335  *
17336  * Revision 1.205  1995/01/17  11:08:56  matt
17337  * Disable new-ish FVI edge checking for all objects except the player,
17338  * since it was causing problems with the fusion cannon.
17339  *
17340  * Revision 1.204  1995/01/05  09:43:49  matt
17341  * Took out int3s from new code
17342  *
17343  * Revision 1.203  1995/01/04  22:19:23  matt
17344  * Added hack to keep player from squeezing through closed walls/doors
17345  *
17346  * Revision 1.202  1995/01/02  12:38:48  mike
17347  * physics hack to crazy josh not get hung up on proximity bombs.  Matt notified via email.
17348  *
17349  * Revision 1.201  1994/12/13  15:39:22  mike
17350  * #ifndef NDEBUG some code.
17351  *
17352  * Revision 1.200  1994/12/13  13:28:34  yuan
17353  * Fixed type.
17354  *
17355  * Revision 1.199  1994/12/13  13:25:00  matt
17356  * Made bump hack compile out if so desired
17357  *
17358  * Revision 1.198  1994/12/13  12:02:39  matt
17359  * Added hack to bump player a little if stuck
17360  *
17361  * Revision 1.197  1994/12/12  00:32:23  matt
17362  * When objects other than player go out of mine, jerk to center of segment
17363  *
17364  * Revision 1.196  1994/12/10  22:52:42  mike
17365  * make physics left-the-mine checking always be in.
17366  *
17367  * Revision 1.195  1994/12/08  00:53:01  mike
17368  * oops...phys rot bug.
17369  *
17370  * Revision 1.194  1994/12/07  12:54:54  mike
17371  * tweak rotvel applied from collisions.
17372  *
17373  * Revision 1.193  1994/12/07  00:36:08  mike
17374  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
17375  *
17376  * Revision 1.192  1994/12/05  17:23:10  matt
17377  * Made a bunch of debug code compile out
17378  *
17379  * Revision 1.191  1994/12/05  16:30:10  matt
17380  * Was illegally changing an object's segment...shoot me.
17381  *
17382  * Revision 1.190  1994/12/05  11:58:51  mike
17383  * fix stupid apply_force_rot() bug.
17384  *
17385  * Revision 1.189  1994/12/05  09:42:17  mike
17386  * fix 0 mag problem when object applies force to itself.
17387  *
17388  * Revision 1.188  1994/12/04  22:48:40  matt
17389  * Physics & FVI now only build seglist for player objects, and they
17390  * responsilby deal with buffer full conditions
17391  *
17392  * Revision 1.187  1994/12/04  22:14:07  mike
17393  * apply instantaneous rotation to an object due to a force blow.
17394  *
17395  * Revision 1.186  1994/12/04  18:51:30  matt
17396  * When weapons get stuck, delete them!
17397  *
17398  * Revision 1.185  1994/12/04  18:38:56  matt
17399  * Added better handling of point-not-in-seg problem
17400  *
17401  * Revision 1.184  1994/11/27  23:13:42  matt
17402  * Made changes for new mprintf calling convention
17403  *
17404  * Revision 1.183  1994/11/25  23:46:18  matt
17405  * Fixed drag problems with framerates over 60Hz
17406  *
17407  * Revision 1.182  1994/11/25  22:15:52  matt
17408  * Added asserts to try to trap frametime < 0 bug
17409  *
17410  * Revision 1.181  1994/11/21  11:42:44  mike
17411  * ndebug stuff.
17412  *
17413  * Revision 1.180  1994/11/19  15:15:04  mike
17414  * remove unused code and data
17415  *
17416  * Revision 1.179  1994/11/16  11:25:22  matt
17417  * Abort physics if negative frametime
17418  *
17419  * Revision 1.178  1994/10/05  19:50:41  rob
17420  * Removed a non-critical Int3 where an object's segnum is checked.
17421  * Left mprintf message.
17422  *
17423  * Revision 1.177  1994/10/03  22:57:50  matt
17424  * Fixed problem with matrix corruption of non-moving (but rotating) objects
17425  *
17426  * Revision 1.176  1994/09/28  09:23:28  mike
17427  * Add useful information to mprintf(1,... error messages.
17428  *
17429  * Revision 1.175  1994/09/21  17:16:54  mike
17430  * Make objects stuck in doors go away when door opens.
17431  *
17432  * Revision 1.174  1994/09/12  14:19:06  matt
17433  * Drag & thrust now handled differently
17434  *
17435  * Revision 1.173  1994/09/09  14:21:12  matt
17436  * Use new thrust flag
17437  *
17438  * Revision 1.172  1994/09/08  16:21:57  matt
17439  * Cleaned up player-hit-wall code, and added object scrape handling
17440  * Also added weapon-on-weapon hit sound
17441  *
17442  * Revision 1.171  1994/09/02  12:30:37  matt
17443  * Fixed weapons which go through objects
17444  *
17445  * Revision 1.170  1994/09/02  11:55:14  mike
17446  * Kill redefinition of a constant which is properly defined in object.h
17447  *
17448  * Revision 1.169  1994/09/02  11:35:01  matt
17449  * Fixed typo
17450  *
17451  * Revision 1.168  1994/09/02  11:32:48  matt
17452  * Fixed object/object collisions, so you can't fly through robots anymore.
17453  * Cleaned up object damage system.
17454  *
17455  * Revision 1.167  1994/08/30  21:58:15  matt
17456  * Made phys_apply_force() do nothing to an object if it's not a phys object
17457  *
17458  * Revision 1.166  1994/08/26  10:47:01  john
17459  * New version of controls.
17460  *
17461  * Revision 1.165  1994/08/25  21:53:57  mike
17462  * Prevent counts of -1 which eventually add up to a positive number in do_ai_frame, causing
17463  * the too-many-retries behavior.
17464  *
17465  * Revision 1.164  1994/08/25  18:43:33  john
17466  * First revision of new control code.
17467  *
17468  * Revision 1.163  1994/08/17  22:18:05  mike
17469  * Make robots which have rotvel or rotthrust, but not movement, move.
17470  *
17471  * Revision 1.162  1994/08/13  17:31:18  mike
17472  * retry count stuff.
17473  *
17474  * Revision 1.161  1994/08/11  18:59:16  mike
17475  * *** empty log message ***
17476  *
17477  * Revision 1.160  1994/08/10  19:53:47  mike
17478  * Debug code (which is still in...)
17479  * and adapt to changed interface to create_path_to_player.
17480  *
17481  * Revision 1.159  1994/08/08  21:38:43  matt
17482  * Cleaned up a code a little and optimized a little
17483  *
17484  * Revision 1.158  1994/08/08  15:21:50  mike
17485  * Trap retry count >= 4, but don't do AI hack unless >= 6.
17486  *
17487  * Revision 1.157  1994/08/08  11:47:15  matt
17488  * Cleaned up fvi and physics a little
17489  *
17490  * Revision 1.156  1994/08/05  10:10:10  yuan
17491  * Commented out debug stuff that was killing framerate.
17492  *
17493  * Revision 1.155  1994/08/04  19:12:36  matt
17494  * Changed a bunch of vecmat calls to use multiple-function routines, and to
17495  * allow the use of C macros for some functions
17496  *
17497  * Revision 1.154  1994/08/04  16:33:57  mike
17498  * Kill a pile of RCS stuff.
17499  * Call create_path_to_player for a stuck object.
17500  *
17501  * Revision 1.153  1994/08/04  00:21:02  matt
17502  * Cleaned up fvi & physics error handling; put in code to make sure objects
17503  * are in correct segment; simplified segment finding for objects and points
17504  *
17505  * Revision 1.152  1994/08/01  16:25:34  matt
17506  * Check for moved_time == 0 when computing hit speed
17507  *
17508  * Revision 1.151  1994/08/01  13:30:32  matt
17509  * Made fvi() check holes in transparent walls, and changed fvi() calling
17510  * parms to take all input data in query structure.
17511  *
17512  * Revision 1.150  1994/07/29  23:41:46  matt
17513  * Fixed turn banking, which changed when I added rotational velocity
17514  *
17515  * Revision 1.149  1994/07/27  20:53:23  matt
17516  * Added rotational drag & thrust, so turning now has momemtum like moving
17517
17518 ------------------------------------------------------------------------
17519 main/physics.h:
17520
17521  * Revision 1.2  1995/08/23  21:33:04  allender
17522  * fix mcc compiler warnings
17523  *
17524  * Revision 1.1  1995/05/16  16:00:56  allender
17525  * Initial revision
17526  *
17527  * Revision 2.0  1995/02/27  11:33:06  john
17528  * New version 2.0, which has no anonymous unions, builds with
17529  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17530  *
17531  * Revision 1.29  1995/02/06  19:47:18  matt
17532  * New function (untested), set_thrust_from_velocity()
17533  *
17534  * Revision 1.28  1994/12/04  22:14:20  mike
17535  * apply instantaneous rotation to an object due to a force blow.
17536  *
17537  * Revision 1.27  1994/08/01  13:29:42  matt
17538  * Made fvi() check holes in transparent walls, and changed fvi() calling
17539  * parms to take all input data in query structure.
17540  *
17541  * Revision 1.26  1994/07/28  12:35:22  matt
17542  * Added prototype
17543  *
17544  * Revision 1.25  1994/07/13  21:48:05  matt
17545  * FVI() and physics now keep lists of segments passed through which the
17546  * trigger code uses.
17547  *
17548  * Revision 1.24  1994/06/30  19:01:55  matt
17549  * Moved flying controls code from physics.c to controls.c
17550  *
17551  * Revision 1.23  1994/06/16  14:14:20  mike
17552  * Change physics_lookahead to return hit_info.
17553  *
17554  * Revision 1.22  1994/06/09  09:58:43  matt
17555  * Moved find_vector_intersection() from physics.c to new file fvi.c
17556  *
17557  * Revision 1.21  1994/05/20  16:11:07  matt
17558  * Added new parm, ignore_obj, to find_vector_intersection()
17559  *
17560  * Revision 1.20  1994/05/20  15:16:58  matt
17561  * Added new fvi return type; took out some troublesome (and troubling) asserts
17562
17563 ------------------------------------------------------------------------
17564 main/piggy.c:
17565
17566  * Revision 1.16  1995/11/09  17:27:47  allender
17567  * put in missing quote on new gauge name
17568  *
17569  * Revision 1.15  1995/11/08  17:28:03  allender
17570  * add PC gauges to gauge list of non-substitutatble bitmaps
17571  *
17572  * Revision 1.14  1995/11/08  15:14:49  allender
17573  * fixed horrible bug where the piggy cache size was incorrect
17574  * for mac shareware
17575  *
17576  * Revision 1.13  1995/11/03  12:53:37  allender
17577  * shareware changes
17578  *
17579  * Revision 1.12  1995/10/21  22:25:14  allender
17580  * added bald guy cheat
17581  *
17582  * Revision 1.11  1995/10/20  22:42:15  allender
17583  * changed load path of descent.pig to :data:descent.pig
17584  *
17585  * Revision 1.10  1995/10/20  00:08:01  allender
17586  * put in event loop calls when loading data (hides it nicely
17587  * from user) so TM can get it's strokes stuff
17588  *
17589  * Revision 1.9  1995/09/13  08:48:01  allender
17590  * added lower memory requirement to load alternate bitmaps
17591  *
17592  * Revision 1.8  1995/08/16  09:39:13  allender
17593  * moved "loading" text up a little
17594  *
17595  * Revision 1.7  1995/08/08  13:54:26  allender
17596  * added macsys header file
17597  *
17598  * Revision 1.6  1995/07/12  12:49:56  allender
17599  * total hack for bitmaps > 512 bytes wide -- check these by name
17600  *
17601  * Revision 1.5  1995/07/05  16:47:05  allender
17602  * kitchen stuff
17603  *
17604  * Revision 1.4  1995/06/23  08:55:28  allender
17605  * make "loading data" text y loc based off of curcanv
17606  *
17607  * Revision 1.3  1995/06/08  14:08:52  allender
17608  * PPC aligned data sets
17609  *
17610  * Revision 1.2  1995/05/26  06:54:27  allender
17611  * removed refences to sound data at end of pig file (since they will
17612  * now be Macintosh snd resources for effects
17613  *
17614  * Revision 1.1  1995/05/16  15:29:51  allender
17615  * Initial revision
17616  *
17617  * Revision 2.10  1995/10/07  13:17:26  john
17618  * Made all bitmaps paged out by default.
17619  *
17620  * Revision 2.9  1995/04/14  14:05:24  john
17621  * *** empty log message ***
17622  *
17623  * Revision 2.8  1995/04/12  13:39:37  john
17624  * Fixed bug with -lowmem not working.
17625  *
17626  * Revision 2.7  1995/03/29  23:23:17  john
17627  * Fixed major bug with sounds not building into pig right.
17628  *
17629  * Revision 2.6  1995/03/28  18:05:00  john
17630  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
17631  *
17632  * Revision 2.5  1995/03/16  23:13:06  john
17633  * Fixed bug with piggy paging in bitmap not checking for disk
17634  * error, hence bogifying textures if you pull the CD out.
17635  *
17636  * Revision 2.4  1995/03/14  16:22:27  john
17637  * Added cdrom alternate directory stuff.
17638  *
17639  * Revision 2.3  1995/03/06  15:23:20  john
17640  * New screen techniques.
17641  *
17642  * Revision 2.2  1995/02/27  13:13:40  john
17643  * Removed floating point.
17644  *
17645  * Revision 2.1  1995/02/27  12:31:25  john
17646  * Made work without editor.
17647  *
17648  * Revision 2.0  1995/02/27  11:28:02  john
17649  * New version 2.0, which has no anonymous unions, builds with
17650  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17651  *
17652  * Revision 1.85  1995/02/09  12:54:24  john
17653  * Made paged out bitmaps have bm_data be a valid pointer
17654  * instead of NULL, in case anyone accesses it.
17655  *
17656  * Revision 1.84  1995/02/09  12:50:59  john
17657  * Bullet-proofed the piggy loading code.
17658  *
17659  * Revision 1.83  1995/02/07  17:08:51  john
17660  * Added some error handling stuff instead of asserts.
17661  *
17662  * Revision 1.82  1995/02/03  17:06:48  john
17663  * Changed sound stuff to allow low memory usage.
17664  * Also, changed so that Sounds isn't an array of digi_sounds, it
17665  * is a ubyte pointing into GameSounds, this way the digi.c code that
17666  * locks sounds won't accidentally unlock a sound that is already playing, but
17667  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
17668  *
17669  * Revision 1.81  1995/02/02  21:56:39  matt
17670  * Added data for new gauge bitmaps
17671  *
17672  * Revision 1.80  1995/02/01  23:31:57  john
17673  * Took out loading bar.
17674  *
17675  * Revision 1.79  1995/01/28  15:13:18  allender
17676  * bumped up Piggy_bitmap_cache_size
17677  *
17678  * Revision 1.78  1995/01/26  12:30:43  john
17679  * Took out prev.
17680  *
17681  * Revision 1.77  1995/01/26  12:12:17  john
17682  * Made buffer be big for bitmaps.
17683  *
17684  * Revision 1.76  1995/01/25  20:15:38  john
17685  * Made editor allocate all mem.
17686  *
17687  * Revision 1.75  1995/01/25  14:52:56  john
17688  * Made bitmap buffer be 1.5 MB.
17689  *
17690  * Revision 1.74  1995/01/22  16:03:19  mike
17691  * localization.
17692  *
17693  * Revision 1.73  1995/01/22  15:58:36  mike
17694  * localization
17695  *
17696  * Revision 1.72  1995/01/18  20:51:20  john
17697  * Took out warnings.
17698  *
17699  * Revision 1.71  1995/01/18  20:47:21  john
17700  * Added code to allocate sounds & bitmaps into diff
17701  * buffers, also made sounds not be compressed for registered.
17702  *
17703  * Revision 1.70  1995/01/18  15:08:41  john
17704  * Added start/stop time around paging.
17705  * Made paging clear screen around globe.
17706  *
17707  * Revision 1.69  1995/01/18  10:07:51  john
17708  *
17709  * Took out debugging mprintfs.
17710  *
17711  * Revision 1.68  1995/01/17  14:27:42  john
17712  * y
17713  *
17714  * Revision 1.67  1995/01/17  12:14:39  john
17715  * Made walls, object explosion vclips load at level start.
17716  *
17717  * Revision 1.66  1995/01/15  13:15:44  john
17718  * Made so that paging always happens, lowmem just loads less.
17719  * Also, make KB load print to hud.
17720  *
17721  * Revision 1.65  1995/01/15  11:56:28  john
17722  * Working version of paging.
17723  *
17724  * Revision 1.64  1995/01/14  19:17:07  john
17725  * First version of new bitmap paging code.
17726  *
17727  * Revision 1.63  1994/12/15  12:26:44  john
17728  * Added -nolowmem function.
17729  *
17730  * Revision 1.62  1994/12/14  21:12:26  john
17731  * Fixed bug with page fault when exiting and using
17732  * -nosound.
17733  *
17734  * Revision 1.61  1994/12/14  11:35:31  john
17735  * Evened out thermometer for pig read.
17736  *
17737  * Revision 1.60  1994/12/14  10:51:00  john
17738  * Sped up sound loading.
17739  *
17740  * Revision 1.59  1994/12/14  10:12:08  john
17741  * Sped up pig loading.
17742  *
17743  * Revision 1.58  1994/12/13  09:14:47  john
17744  * *** empty log message ***
17745  *
17746  * Revision 1.57  1994/12/13  09:12:57  john
17747  * Made the bar always fill up.
17748  *
17749  * Revision 1.56  1994/12/13  03:49:08  john
17750  * Made -lowmem not load the unnecessary bitmaps.
17751  *
17752  * Revision 1.55  1994/12/06  16:06:35  john
17753  * Took out piggy sorting.
17754  *
17755  * Revision 1.54  1994/12/06  15:11:14  john
17756  * Fixed bug with reading pigs.
17757  *
17758  * Revision 1.53  1994/12/06  14:14:47  john
17759  * Added code to set low mem based on memory.
17760  *
17761  * Revision 1.52  1994/12/06  14:01:10  john
17762  * Fixed bug that was causing -lowmem all the time..
17763  *
17764  * Revision 1.51  1994/12/06  13:33:48  john
17765  * Added lowmem option.
17766  *
17767  * Revision 1.50  1994/12/05  19:40:10  john
17768  * If -nosound or no sound card selected, don't load sounds from pig.
17769  *
17770  * Revision 1.49  1994/12/05  12:17:44  john
17771  * Added code that locks/unlocks digital sounds on demand.
17772  *
17773  * Revision 1.48  1994/12/05  11:39:03  matt
17774  * Fixed little mistake
17775  *
17776  * Revision 1.47  1994/12/05  09:29:22  john
17777  * Added clength to the sound field.
17778  *
17779  * Revision 1.46  1994/12/04  15:27:15  john
17780  * Fixed my stupid bug that looked at -nosound instead of digi_driver_card
17781  * to see whether or not to lock down sound memory.
17782  *
17783  * Revision 1.45  1994/12/03  14:17:00  john
17784  * Took out my debug mprintf.
17785  *
17786  * Revision 1.44  1994/12/03  13:32:37  john
17787  * Fixed bug with offscreen bitmap.
17788  *
17789  * Revision 1.43  1994/12/03  13:07:13  john
17790  * Made the pig read/write compressed sounds.
17791  *
17792  * Revision 1.42  1994/12/03  11:48:51  matt
17793  * Added option to not dump sounds to pigfile
17794  *
17795  * Revision 1.41  1994/12/02  20:02:20  matt
17796  * Made sound files constant match constant for table
17797  *
17798  * Revision 1.40  1994/11/29  11:03:09  adam
17799  * upped # of sounds
17800  *
17801  * Revision 1.39  1994/11/27  23:13:51  matt
17802  * Made changes for new mprintf calling convention
17803  *
17804  * Revision 1.38  1994/11/20  18:40:34  john
17805  * MAde the piggy.lst and piggy.all not dump for release.
17806  *
17807  * Revision 1.37  1994/11/19  23:54:45  mike
17808  * up number of bitmaps for shareware version.
17809  *
17810  * Revision 1.36  1994/11/19  19:53:05  mike
17811  * change MAX_BITMAP_FILES
17812  *
17813  * Revision 1.35  1994/11/19  10:42:56  matt
17814  * Increased number of bitmaps for non-shareware version
17815  *
17816  * Revision 1.34  1994/11/19  09:11:52  john
17817  * Added avg_color to bitmaps saved in pig.
17818  *
17819  * Revision 1.33  1994/11/19  00:07:05  john
17820  * Fixed bug with 8 char sound filenames not getting read from pig.
17821  *
17822  * Revision 1.32  1994/11/18  22:24:54  john
17823  * Added -bigpig command line that doesn't rle your pig.
17824  *
17825  * Revision 1.31  1994/11/18  21:56:53  john
17826  * Added a better, leaner pig format.
17827  *
17828  * Revision 1.30  1994/11/16  12:06:16  john
17829  * Fixed bug with calling .bbms abms.
17830  *
17831  * Revision 1.29  1994/11/16  12:00:56  john
17832  * Added piggy.all dump.
17833  *
17834  * Revision 1.28  1994/11/10  21:16:02  adam
17835  * nothing important
17836  *
17837  * Revision 1.27  1994/11/10  13:42:00  john
17838  * Made sounds not lock down if using -nosound.
17839  *
17840  * Revision 1.26  1994/11/09  19:55:40  john
17841  * Added full rle support with texture rle caching.
17842  *
17843  * Revision 1.25  1994/11/09  16:36:42  john
17844  * First version with RLE bitmaps in Pig.
17845  *
17846  * Revision 1.24  1994/10/27  19:42:59  john
17847  * Disable the piglet option.
17848  *
17849  * Revision 1.23  1994/10/27  18:51:40  john
17850  * Added -piglet option that only loads needed textures for a
17851  * mine.  Only saved ~1MB, and code still doesn't free textures
17852  * before you load a new mine.
17853  *
17854  * Revision 1.22  1994/10/25  13:11:42  john
17855  * Made the sounds sort. Dumped piggy.lst.
17856  *
17857  * Revision 1.21  1994/10/06  17:06:23  john
17858  * Took out rle stuff.
17859  *
17860  * Revision 1.20  1994/10/06  15:45:36  adam
17861  * bumped MAX_BITMAP_FILES again!
17862  *
17863  * Revision 1.19  1994/10/06  11:01:17  yuan
17864  * Upped MAX_BITMAP_FILES
17865  *
17866  * Revision 1.18  1994/10/06  10:44:45  john
17867  * Added diagnostic message and psuedo run-length-encoder
17868  * to see how much memory we would save by storing bitmaps
17869  * in a RLE method.  Also, I commented out the code that
17870  * stores 4K bitmaps on a 4K boundry to reduce pig size
17871  * a bit.
17872  *
17873  * Revision 1.17  1994/10/04  20:03:13  matt
17874  * Upped maximum number of bitmaps
17875  *
17876  * Revision 1.16  1994/10/03  18:04:20  john
17877  * Fixed bug with data_offset not set right for bitmaps
17878  * that are 64x64 and not aligned on a 4k boundry.
17879  *
17880  * Revision 1.15  1994/09/28  11:30:55  john
17881  * changed inferno.pig to descent.pig, changed the way it
17882  * is read.
17883  *
17884  * Revision 1.14  1994/09/22  16:14:17  john
17885  * Redid intro sequecing.
17886  *
17887  * Revision 1.13  1994/09/19  14:42:47  john
17888  * Locked down sounds with Virtual memory.
17889  *
17890  * Revision 1.12  1994/09/10  17:31:52  mike
17891  * Increase number of loadable bitmaps.
17892  *
17893  * Revision 1.11  1994/09/01  19:32:49  mike
17894  * Boost texture map allocation.
17895  *
17896  * Revision 1.10  1994/08/16  11:51:02  john
17897  * Added grwased pigs.
17898  *
17899  * Revision 1.9  1994/07/06  09:18:03  adam
17900  * upped bitmap #s
17901  *
17902  * Revision 1.8  1994/06/20  22:02:15  matt
17903  * Fixed bug from last change
17904  *
17905  * Revision 1.7  1994/06/20  21:33:18  matt
17906  * Made bm.h not include sounds.h, to reduce dependencies
17907  *
17908  * Revision 1.6  1994/06/20  16:52:19  john
17909  * cleaned up init output a bit.
17910  *
17911  * Revision 1.5  1994/06/08  14:20:57  john
17912  * Made piggy dump before going into game.
17913  *
17914  * Revision 1.4  1994/06/02  18:59:22  matt
17915  * Clear selector field of bitmap loaded from pig file
17916  *
17917  * Revision 1.3  1994/05/06  15:31:41  john
17918  * Made name field a bit longer.
17919  *
17920  * Revision 1.2  1994/05/06  13:02:44  john
17921  * Added piggy stuff; worked on supertransparency
17922  *
17923  * Revision 1.1  1994/05/06  11:47:26  john
17924  * Initial revision
17925
17926 ------------------------------------------------------------------------
17927 main/piggy.h:
17928
17929  * Revision 1.1  1995/05/16  16:01:04  allender
17930  * Initial revision
17931  *
17932  * Revision 2.0  1995/02/27  11:31:21  john
17933  * New version 2.0, which has no anonymous unions, builds with
17934  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17935  *
17936  * Revision 1.10  1995/02/03  17:08:29  john
17937  * Changed sound stuff to allow low memory usage.
17938  * Also, changed so that Sounds isn't an array of digi_sounds, it
17939  * is a ubyte pointing into GameSounds, this way the digi.c code that
17940  * locks sounds won't accidentally unlock a sound that is already playing, but
17941  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
17942  *
17943  * Revision 1.9  1995/01/24  14:33:49  john
17944  * *** empty log message ***
17945  *
17946  * Revision 1.8  1995/01/24  14:32:35  john
17947  * Took out paging in code.
17948  *
17949  * Revision 1.7  1995/01/23  12:30:17  john
17950  * Made debug code that mprintf what bitmap gets paged in.
17951  *
17952  * Revision 1.6  1995/01/17  14:11:37  john
17953  * Added function that is called after level loaded.
17954  *
17955  * Revision 1.5  1995/01/14  19:16:58  john
17956  * First version of new bitmap paging code.
17957  *
17958  * Revision 1.4  1994/10/27  18:51:57  john
17959  * Added -piglet option that only loads needed textures for a
17960  * mine.  Only saved ~1MB, and code still doesn't free textures
17961  * before you load a new mine.
17962  *
17963  * Revision 1.3  1994/06/08  14:20:47  john
17964  * Made piggy dump before going into game.
17965  *
17966  * Revision 1.2  1994/05/06  13:02:40  john
17967  * Added piggy stuff; worked on supertransparency
17968  *
17969  * Revision 1.1  1994/05/06  11:47:46  john
17970  * Initial revision
17971
17972 ------------------------------------------------------------------------
17973 main/player.h:
17974
17975  * Revision 1.1  1995/05/16  16:01:11  allender
17976  * Initial revision
17977  *
17978  * Revision 2.0  1995/02/27  11:30:25  john
17979  * New version 2.0, which has no anonymous unions, builds with
17980  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17981  *
17982  * Revision 1.41  1994/12/20  17:56:43  yuan
17983  * Multiplayer object capability.
17984  *
17985  * Revision 1.40  1994/12/02  15:04:42  matt
17986  * Fixed bogus weapon constants and arrays
17987  *
17988  * Revision 1.39  1994/11/25  22:47:08  matt
17989  * Made saved game descriptions longer
17990  *
17991  * Revision 1.38  1994/11/21  17:29:38  matt
17992  * Cleaned up sequencing & game saving for secret levels
17993  *
17994  * Revision 1.37  1994/11/17  12:57:13  rob
17995  * Changed net_kills_level to net_killed_total.
17996  *
17997  * Revision 1.36  1994/11/14  17:20:33  rob
17998  * Bumped player file version.
17999  *
18000  * Revision 1.35  1994/11/04  19:55:06  rob
18001  * Changed a previously unused pad character to represent whether or not
18002  * the player is connected to a net game (used to be objnum=-1 but we
18003  * want to keep the objnum info in case of re-joins)
18004  *
18005  * Revision 1.34  1994/10/22  14:13:54  mike
18006  * Add homing_object_dist field to player struct.
18007  *
18008  * Revision 1.33  1994/10/22  00:08:45  matt
18009  * Fixed up problems with bonus & game sequencing
18010  * Player doesn't get credit for hostages unless he gets them out alive
18011  *
18012  * Revision 1.32  1994/10/21  20:43:03  mike
18013  * Add hostages_on_board to player struct.
18014  *
18015  * Revision 1.31  1994/10/19  20:00:00  john
18016  * Added bonus points at the end of level based on skill level.
18017  *
18018  * Revision 1.30  1994/10/19  15:14:24  john
18019  * Took % hits out of player structure, made %kills work properly.
18020  *
18021  * Revision 1.29  1994/10/19  12:12:27  john
18022  * Added hour variable.
18023  *
18024  * Revision 1.28  1994/10/17  17:24:48  john
18025  * Added starting_level to player struct.
18026  *
18027  * Revision 1.27  1994/10/13  15:42:02  mike
18028  * Remove afterburner.
18029  *
18030  * Revision 1.26  1994/10/10  17:00:23  mike
18031  * Lower number of players from 10 to 8.
18032  *
18033  * Revision 1.25  1994/10/09  14:53:26  matt
18034  * Made player cockpit state & window size save/restore with saved games & automap
18035  *
18036  * Revision 1.24  1994/10/08  20:24:10  matt
18037  * Added difficulty level to player structure for game load/save
18038  *
18039  * Revision 1.23  1994/10/05  17:39:53  rob
18040  * Changed killer_objnum to a short (was char)
18041  *
18042  * Revision 1.22  1994/10/03  22:59:07  matt
18043  * Limit callsign to 8 chars long, so we can use it as filename
18044  *
18045  * Revision 1.21  1994/09/23  10:14:30  mike
18046  * Rename PLAYER_FLAGS_INVINCIBLE to PLAYER_FLAGS_INVULNERABLE.
18047  * Add INVULNERABLE_TIME_MAX = 30 seconds.
18048  *
18049  * Revision 1.20  1994/09/21  20:44:22  matt
18050  * Player explosion fireball now specified in bitmaps.tbl
18051  *
18052  * Revision 1.19  1994/09/21  12:27:37  mike
18053  * Move CLOAK_TIME_MAX here from game.c
18054  *
18055  * Revision 1.18  1994/09/16  13:10:16  mike
18056  * Add afterburner and cloak stuff.
18057  *
18058  * Revision 1.17  1994/09/11  20:30:26  matt
18059  * Cleaned up thrust vars, changing a few names
18060  *
18061  * Revision 1.16  1994/09/09  14:22:45  matt
18062  * Added extra gun for player
18063  *
18064  * Revision 1.15  1994/09/07  13:30:11  john
18065  * Added code to tell how many packets were lost.
18066  *
18067  * Revision 1.14  1994/09/02  11:56:33  mike
18068  * Alignment on the player struct.
18069  *
18070  * Revision 1.13  1994/08/25  18:12:05  matt
18071  * Made player's weapons and flares fire from the positions on the 3d model.
18072  * Also added support for quad lasers.
18073  *
18074  * Revision 1.12  1994/08/22  15:49:40  mike
18075  * change spelling on num_missles -> num_missiles.
18076  *
18077  * Revision 1.11  1994/08/18  10:47:32  john
18078  * Cleaned up game sequencing and player death stuff
18079  * in preparation for making the player explode into
18080  * pieces when dead.
18081  *
18082  * Revision 1.10  1994/08/17  16:50:05  john
18083  * Added damaging fireballs, missiles.
18084  *
18085  * Revision 1.9  1994/08/15  00:24:10  john
18086  * First version of netgame with players killing
18087  * each other. still buggy...
18088  *
18089  * Revision 1.8  1994/08/12  22:41:26  john
18090  * Took away Player_stats; add Players array.
18091  *
18092  * Revision 1.7  1994/08/09  17:53:25  adam
18093  * *** empty log message ***
18094  *
18095  * Revision 1.6  1994/07/13  00:15:05  matt
18096  * Moved all (or nearly all) of the values that affect player movement to
18097  * bitmaps.tbl
18098  *
18099  * Revision 1.5  1994/07/08  21:44:17  matt
18100  * Made laser powerups saturate correctly
18101  *
18102  * Revision 1.4  1994/07/07  14:59:02  john
18103  * Made radar powerups.
18104  *
18105  *
18106  * Revision 1.3  1994/07/02  13:49:39  matt
18107  * Cleaned up includes
18108  *
18109  * Revision 1.2  1994/07/02  13:10:03  matt
18110  * Moved player stats struct from gameseq.h to player.h
18111  *
18112  * Revision 1.1  1994/07/02  11:00:43  matt
18113  * Initial revision
18114
18115 ------------------------------------------------------------------------
18116 main/playsave.c:
18117
18118  * Revision 1.1  1995/12/05  16:05:47  allender
18119  * Initial revision
18120  *
18121  * Revision 1.10  1995/11/03  12:53:24  allender
18122  * shareware changes
18123  *
18124  * Revision 1.9  1995/10/31  10:19:12  allender
18125  * shareware stuff
18126  *
18127  * Revision 1.8  1995/10/23  14:50:11  allender
18128  * set control type for new player *before* calling kc_set_controls
18129  *
18130  * Revision 1.7  1995/10/21  22:25:31  allender
18131  * *** empty log message ***
18132  *
18133  * Revision 1.6  1995/10/17  15:57:42  allender
18134  * removed line setting wrong COnfig_control_type
18135  *
18136  * Revision 1.5  1995/10/17  13:16:44  allender
18137  * new controller support
18138  *
18139  * Revision 1.4  1995/08/24  16:03:38  allender
18140  * call joystick code when player file uses joystick
18141  *
18142  * Revision 1.3  1995/08/03  15:15:39  allender
18143  * got player save file working (more to go for shareware)
18144  *
18145  * Revision 1.2  1995/08/01  13:57:20  allender
18146  * macified the player file stuff -- in a seperate folder
18147  *
18148  * Revision 1.1  1995/05/16  15:30:00  allender
18149  * Initial revision
18150  *
18151  * Revision 2.3  1995/05/26  16:16:23  john
18152  * Split SATURN into define's for requiring cd, using cd, etc.
18153  * Also started adding all the Rockwell stuff.
18154  *
18155  * Revision 2.2  1995/03/24  17:48:21  john
18156  * Made player files from saturn excrement the highest level for
18157  * normal descent levels.
18158  *
18159  * Revision 2.1  1995/03/21  14:38:49  john
18160  * Ifdef'd out the NETWORK code.
18161  *
18162  * Revision 2.0  1995/02/27  11:27:59  john
18163  * New version 2.0, which has no anonymous unions, builds with
18164  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18165  *
18166  * Revision 1.57  1995/02/13  20:34:55  john
18167  * Lintized
18168  *
18169  * Revision 1.56  1995/02/13  13:23:24  john
18170  * Fixed bug with new player joystick selection.
18171  *
18172  * Revision 1.55  1995/02/13  12:01:19  john
18173  * Fixed bug with joystick throttle still asking for
18174  * calibration with new pilots.
18175  *
18176  * Revision 1.54  1995/02/13  10:29:12  john
18177  * Fixed bug with creating new player not resetting everything to default.
18178  *
18179  * Revision 1.53  1995/02/03  10:58:46  john
18180  * Added code to save shareware style saved games into new format...
18181  * Also, made new player file format not have the saved game array in it.
18182  *
18183  * Revision 1.52  1995/02/02  21:09:28  matt
18184  * Let player start of level 8 if he made it to level 7 in the shareware
18185  *
18186  * Revision 1.51  1995/02/02  18:50:14  john
18187  * Added warning for FCS when new pilot chooses.
18188  *
18189  * Revision 1.50  1995/02/02  11:21:34  john
18190  * Made joystick calibrate when new user selects.
18191  *
18192  * Revision 1.49  1995/02/01  18:06:38  rob
18193  * Put defaults macros into descent.tex
18194  *
18195  * Revision 1.48  1995/01/25  14:37:53  john
18196  * Made joystick only prompt for calibration once...
18197  *
18198  * Revision 1.47  1995/01/24  19:37:12  matt
18199  * Took out incorrect mprintf
18200  *
18201  * Revision 1.46  1995/01/22  18:57:22  matt
18202  * Made player highest level work with missions
18203  *
18204  * Revision 1.45  1995/01/21  16:36:05  matt
18205  * Made starting level system work for now, pending integration with
18206  * mission code.
18207  *
18208  * Revision 1.44  1995/01/20  22:47:32  matt
18209  * Mission system implemented, though imcompletely
18210  *
18211  * Revision 1.43  1995/01/04  14:58:39  rob
18212  * Fixed for shareware build.
18213  *
18214  * Revision 1.42  1995/01/04  11:36:43  rob
18215  * Added compatibility with older shareware pilot files.
18216  *
18217  * Revision 1.41  1995/01/03  11:01:58  rob
18218  * fixed a default macro.
18219  *
18220  * Revision 1.40  1995/01/03  10:44:06  rob
18221  * Added default taunt macros.
18222  *
18223  * Revision 1.39  1994/12/13  10:01:16  allender
18224  * pop up message box when unable to correctly save player file
18225  *
18226  * Revision 1.38  1994/12/12  11:37:14  matt
18227  * Fixed auto leveling defaults & saving
18228  *
18229  * Revision 1.37  1994/12/12  00:26:59  matt
18230  * Added support for no-levelling option
18231  *
18232  * Revision 1.36  1994/12/10  19:09:54  matt
18233  * Added assert for valid player number when loading game
18234  *
18235  * Revision 1.35  1994/12/08  10:53:07  rob
18236  * Fixed a bug in highest_level tracking.
18237  *
18238  * Revision 1.34  1994/12/08  10:01:36  john
18239  * Changed the way the player callsign stuff works.
18240  *
18241  * Revision 1.33  1994/12/07  18:30:38  rob
18242  * Load highest level along with player (used to be only if higher)
18243  * Capped at LAST_LEVEL in case a person loads a registered player in shareware.
18244  *
18245  * Revision 1.32  1994/12/03  16:01:12  matt
18246  * When player file has bad version, force player to choose another
18247  *
18248  * Revision 1.31  1994/12/02  19:54:00  yuan
18249  * Localization.
18250  *
18251  * Revision 1.30  1994/12/02  11:01:36  yuan
18252  * Localization.
18253  *
18254  * Revision 1.29  1994/11/29  03:46:28  john
18255  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
18256  * command line arg.
18257  *
18258  * Revision 1.28  1994/11/29  01:10:23  john
18259  * Took out code that allowed new players to
18260  * configure keyboard.
18261  *
18262  * Revision 1.27  1994/11/25  22:47:10  matt
18263  * Made saved game descriptions longer
18264  *
18265  * Revision 1.26  1994/11/22  12:10:42  rob
18266  * Fixed file handle left open if player file versions don't
18267  * match.
18268  *
18269  * Revision 1.25  1994/11/21  19:35:30  john
18270  * Replaced calls to joy_init with if (joy_present)
18271  *
18272  * Revision 1.24  1994/11/21  17:29:34  matt
18273  * Cleaned up sequencing & game saving for secret levels
18274  *
18275  * Revision 1.23  1994/11/21  11:10:01  john
18276  * Fixed bug with read-only .plr file making the config file
18277  * not update.
18278  *
18279  * Revision 1.22  1994/11/20  19:03:08  john
18280  * Fixed bug with if not having a joystick, default
18281  * player input device is cyberman.
18282  *
18283  * Revision 1.21  1994/11/17  12:24:07  matt
18284  * Made an array the right size, to fix error loading games
18285  *
18286  * Revision 1.20  1994/11/14  17:52:54  allender
18287  * add call to WriteConfigFile when player files gets written
18288  *
18289  * Revision 1.19  1994/11/14  17:19:23  rob
18290  * Removed gamma, joystick calibration, and sound settings from player file.
18291  * Added default difficulty and multi macros.
18292  *
18293  * Revision 1.18  1994/11/07  14:01:23  john
18294  * Changed the gamma correction sequencing.
18295  *
18296  * Revision 1.17  1994/11/05  17:22:49  john
18297  * Fixed lots of sequencing problems with newdemo stuff.
18298  *
18299  * Revision 1.16  1994/11/01  16:40:11  john
18300  * Added Gamma correction.
18301  *
18302  * Revision 1.15  1994/10/24  19:56:50  john
18303  * Made the new user setup prompt for config options.
18304  *
18305  * Revision 1.14  1994/10/24  17:44:21  john
18306  * Added stereo channel reversing.
18307  *
18308  * Revision 1.13  1994/10/24  16:05:12  matt
18309  * Improved handling of player names that are the names of DOS devices
18310  *
18311  * Revision 1.12  1994/10/22  00:08:51  matt
18312  * Fixed up problems with bonus & game sequencing
18313  * Player doesn't get credit for hostages unless he gets them out alive
18314  *
18315  * Revision 1.11  1994/10/19  19:59:57  john
18316  * Added bonus points at the end of level based on skill level.
18317  *
18318  * Revision 1.10  1994/10/19  15:14:34  john
18319  * Took % hits out of player structure, made %kills work properly.
18320  *
18321  * Revision 1.9  1994/10/19  12:44:26  john
18322  * Added hours field to player structure.
18323  *
18324  * Revision 1.8  1994/10/17  17:24:34  john
18325  * Added starting_level to player struct.
18326  *
18327  * Revision 1.7  1994/10/17  13:07:15  john
18328  * Moved the descent.cfg info into the player config file.
18329  *
18330  * Revision 1.6  1994/10/09  14:54:31  matt
18331  * Made player cockpit state & window size save/restore with saved games & automap
18332  *
18333  * Revision 1.5  1994/10/08  23:08:09  matt
18334  * Added error check & handling for game load/save disk io
18335  *
18336  * Revision 1.4  1994/10/05  17:40:54  rob
18337  * Bumped save_file_version to 5 due to change in player.h
18338  *
18339  * Revision 1.3  1994/10/03  23:00:54  matt
18340  * New file version for shorter callsigns
18341  *
18342  * Revision 1.2  1994/09/28  17:25:05  matt
18343  * Added first draft of game save/load system
18344  *
18345  * Revision 1.1  1994/09/27  14:39:12  matt
18346  * Initial revision
18347
18348 ------------------------------------------------------------------------
18349 main/playsave.h:
18350
18351  * Revision 1.1  1995/05/16  16:01:19  allender
18352  * Initial revision
18353  *
18354  * Revision 2.0  1995/02/27  11:31:24  john
18355  * New version 2.0, which has no anonymous unions, builds with
18356  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18357  *
18358  * Revision 1.10  1995/01/22  18:57:04  matt
18359  * Made player highest level work with missions
18360  *
18361  * Revision 1.9  1994/12/12  11:37:15  matt
18362  * Fixed auto leveling defaults & saving
18363  *
18364  * Revision 1.8  1994/12/08  10:01:37  john
18365  * Changed the way the player callsign stuff works.
18366  *
18367  * Revision 1.7  1994/11/25  22:46:56  matt
18368  * Made saved game descriptions longer
18369  *
18370  * Revision 1.6  1994/10/24  20:00:02  john
18371  * Added prototype for read_player_file.
18372  *
18373  * Revision 1.5  1994/10/17  13:07:12  john
18374  * Moved the descent.cfg info into the player config file.
18375  *
18376  * Revision 1.4  1994/10/09  14:54:32  matt
18377  * Made player cockpit state & window size save/restore with saved games & automap
18378  *
18379  * Revision 1.3  1994/10/08  23:08:09  matt
18380  * Added error check & handling for game load/save disk io
18381  *
18382  * Revision 1.2  1994/09/28  17:25:06  matt
18383  * Added first draft of game save/load system
18384  *
18385  * Revision 1.1  1994/09/27  15:47:23  matt
18386  * Initial revision
18387
18388 ------------------------------------------------------------------------
18389 main/polyobj.c:
18390
18391  * Revision 1.3  1995/10/25  14:07:07  allender
18392  * removed load_poly_model function
18393  *
18394  * Revision 1.2  1995/09/14  14:10:20  allender
18395  * two funtions should be void
18396  *
18397  * Revision 1.1  1995/05/16  15:30:08  allender
18398  * Initial revision
18399  *
18400  * Revision 2.1  1995/05/26  16:10:37  john
18401  * Support for new 4-byte align v8 pof files.
18402  *
18403  * Revision 2.0  1995/02/27  11:32:44  john
18404  * New version 2.0, which has no anonymous unions, builds with
18405  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18406  *
18407  * Revision 1.64  1995/01/14  19:16:43  john
18408  * First version of new bitmap paging code.
18409  *
18410  * Revision 1.63  1994/12/14  18:06:54  matt
18411  * Removed compile warnings
18412  *
18413  * Revision 1.62  1994/12/09  17:54:31  john
18414  * Made the CFILE's close right after reading in data.
18415  *
18416  * Revision 1.61  1994/12/09  16:13:28  mike
18417  * speedup pof file reading, but still horribly slow using hog file...problem somewhere else.
18418  *
18419  * Revision 1.60  1994/12/08  17:41:20  yuan
18420  * Cfiling stuff.
18421  *
18422  * Revision 1.59  1994/11/21  11:02:19  matt
18423  * Added error checking
18424  *
18425  * Revision 1.58  1994/11/14  11:32:49  matt
18426  * Allow switching to simpler models even when alt_textures specified
18427  *
18428  * Revision 1.57  1994/11/13  21:15:24  matt
18429  * Added basic support for more than one level of detail simplification
18430  *
18431  * Revision 1.56  1994/11/11  19:29:25  matt
18432  * Added code to show low detail polygon models
18433  *
18434  * Revision 1.55  1994/11/10  14:02:57  matt
18435  * Hacked in support for player ships with different textures
18436  *
18437  * Revision 1.54  1994/11/03  11:01:59  matt
18438  * Made robot pics lighted
18439  *
18440  * Revision 1.53  1994/11/02  16:18:34  matt
18441  * Moved draw_model_picture() out of editor
18442  *
18443  * Revision 1.52  1994/10/18  14:38:11  matt
18444  * Restored assert now that bug is fixed
18445  *
18446  * Revision 1.51  1994/10/17  21:35:03  matt
18447  * Added support for new Control Center/Main Reactor
18448  *
18449  * Revision 1.50  1994/10/14  17:46:23  yuan
18450  * Made the soft Int3 only work in net mode.
18451  *
18452  * Revision 1.49  1994/10/14  17:43:47  yuan
18453  * Added soft int3's instead of Asserts  for some common network bugs.
18454  *
18455  * Revision 1.48  1994/10/14  17:09:04  yuan
18456  * Made Assert on line 610 be if in an attempt
18457  * to bypass.
18458  *
18459  * Revision 1.47  1994/09/09  14:23:42  matt
18460  * Added glow code to polygon models for engine glow
18461  *
18462  * Revision 1.46  1994/08/26  18:03:30  matt
18463  * Added code to remap polygon model numbers by matching filenames
18464  *
18465  * Revision 1.45  1994/08/26  15:35:58  matt
18466  * Made eclips usable on more than one object at a time
18467  *
18468  * Revision 1.44  1994/08/25  18:11:58  matt
18469  * Made player's weapons and flares fire from the positions on the 3d model.
18470  * Also added support for quad lasers.
18471  *
18472  * Revision 1.43  1994/07/25  00:14:18  matt
18473  * Made a couple of minor changes for the drivethrough
18474  *
18475  * Revision 1.42  1994/07/25  00:02:41  matt
18476  * Various changes to accomodate new 3d, which no longer takes point numbers
18477  * as parms, and now only takes pointers to points.
18478
18479 ------------------------------------------------------------------------
18480 main/polyobj.h:
18481
18482  * Revision 1.2  1995/09/14  14:10:30  allender
18483  * two functions should be void
18484  *
18485  * Revision 1.1  1995/05/16  16:01:27  allender
18486  * Initial revision
18487  *
18488  * Revision 2.1  1995/02/27  18:21:54  john
18489  * Added extern for robot_points.
18490  *
18491  * Revision 2.0  1995/02/27  11:29:58  john
18492  * New version 2.0, which has no anonymous unions, builds with
18493  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18494  *
18495  * Revision 1.28  1995/01/12  12:10:16  adam
18496  * *** empty log message ***
18497  *
18498  * Revision 1.27  1994/11/11  19:28:58  matt
18499  * Added code to show low detail polygon models
18500  *
18501  * Revision 1.26  1994/11/10  14:03:05  matt
18502  * Hacked in support for player ships with different textures
18503  *
18504  * Revision 1.25  1994/11/02  16:18:24  matt
18505  * Moved draw_model_picture() out of editor
18506  *
18507  * Revision 1.24  1994/10/18  10:55:57  adam
18508  * bumped MAX_POLYGON_OBJECTS up
18509  *
18510  * Revision 1.23  1994/10/17  21:35:01  matt
18511  * Added support for new Control Center/Main Reactor
18512  *
18513  * Revision 1.22  1994/09/09  14:23:42  matt
18514  * Added glow code to polygon models for engine glow
18515  *
18516  * Revision 1.21  1994/08/26  18:03:43  matt
18517  * Added code to remap polygon model numbers by matching filenames
18518  *
18519  * Revision 1.20  1994/08/26  15:36:00  matt
18520  * Made eclips usable on more than one object at a time
18521  *
18522  * Revision 1.19  1994/07/22  20:44:23  matt
18523  * Killed unused fields in polygon model structure
18524  *
18525  * Revision 1.18  1994/06/16  17:52:11  matt
18526  * Made submodels rotate around their centers, not their pivot points
18527  *
18528  * Revision 1.17  1994/06/14  12:22:05  matt
18529  * Integrated with drive code, using #defines to switch versions
18530  *
18531  * Revision 1.16  1994/06/09  16:25:01  matt
18532  * Fixed confusion with two constants, MAX_SUBOBJS & MAX_SUBMODELS, which
18533  * were used for the same things, but had different values.
18534  *
18535  * Revision 1.15  1994/06/08  10:56:38  matt
18536  * Improved debris: now get submodel size from new POF files; debris now has
18537  * limited life; debris can now be blown up.
18538  *
18539  * Revision 1.14  1994/06/07  16:51:57  matt
18540  * Made object lighting work correctly; changed name of Ambient_light to
18541  * Dynamic_light; cleaned up polygobj object rendering a little.
18542  *
18543  * Revision 1.13  1994/05/26  21:08:59  matt
18544  * Moved robot stuff out of polygon model and into robot_info struct
18545  * Made new file, robot.c, to deal with robots
18546  *
18547  * Revision 1.12  1994/05/18  19:35:05  matt
18548  * Added fields for the rest of the subobj data
18549  *
18550  * Revision 1.11  1994/05/16  16:17:13  john
18551  * Bunch of stuff on my Inferno Task list May16-23
18552  *
18553  * Revision 1.10  1994/05/13  11:08:31  matt
18554  * Added support for multiple gun positions on polygon models
18555  *
18556  * Revision 1.9  1994/04/29  09:18:04  matt
18557  * Added support for multiple-piece explosions
18558  *
18559  * Revision 1.8  1994/04/28  18:44:18  matt
18560  * Took out code for old-style (non-interpreted) objects.
18561  *
18562  * Revision 1.7  1994/03/25  16:54:38  matt
18563  * draw_polygon_object() now takes pointer to animation data
18564  *
18565  * Revision 1.6  1994/03/15  17:44:33  matt
18566  * Changed a bunch of names
18567  *
18568  * Revision 1.5  1994/03/07  20:02:29  matt
18569  * Added pointer to normals in polyobj struct
18570  * Added prototype for draw_polygon_object()
18571  *
18572  * Revision 1.4  1994/03/01  17:16:19  matt
18573  * Lots of changes to support loadable binary ".pof" robot files
18574  *
18575  * Revision 1.3  1994/01/31  15:51:20  matt
18576  * Added ptr for rgb table for robot colors
18577  *
18578  * Revision 1.2  1994/01/28  13:52:01  matt
18579  * Added flesh to this previously skeletal file.
18580  *
18581  * Revision 1.1  1994/01/28  13:47:42  matt
18582  * Initial revision
18583
18584 ------------------------------------------------------------------------
18585 main/powerup.c:
18586
18587  * Revision 1.2  1995/10/31  10:18:55  allender
18588  * shareware stuff
18589  *
18590  * Revision 1.1  1995/05/16  15:30:16  allender
18591  * Initial revision
18592  *
18593  * Revision 2.2  1995/03/24  13:50:36  john
18594  * Added mega-wowie zowie to release.
18595  *
18596  * Revision 2.1  1995/03/21  14:38:39  john
18597  * Ifdef'd out the NETWORK code.
18598  *
18599  * Revision 2.0  1995/02/27  11:27:15  john
18600  * New version 2.0, which has no anonymous unions, builds with
18601  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18602  *
18603  * Revision 1.94  1995/02/22  13:46:03  allender
18604  * remove anonymous unions from object structure
18605  *
18606  * Revision 1.93  1995/02/06  15:52:51  mike
18607  * add mini megawow powerup for giving reasonable weapons.
18608  *
18609  * Revision 1.92  1995/01/23  22:49:59  mike
18610  * drop energy instead of primary weapon if you have primary weapon
18611  * (drop nothing if want to drop vulcan ammo and you are maxed out)
18612  * if you have primary weapon and primary weapon there, get energy instead.
18613  *
18614  * Revision 1.91  1995/01/19  09:42:22  allender
18615  * record laser levels for demos
18616  *
18617  * Revision 1.90  1994/12/31  12:28:01  rob
18618  * Added sound for coop key grabs.
18619  *
18620  * Revision 1.89  1994/12/19  19:55:17  rob
18621  * Fixing key semantics for coop game.
18622  *
18623  * Revision 1.88  1994/12/07  12:55:21  mike
18624  * tweak vulcan amounts.
18625  *
18626  * Revision 1.87  1994/12/06  13:55:36  matt
18627  * Made shield & energy powerup messages round to match HUD message
18628  *
18629  * Revision 1.86  1994/12/03  19:03:57  matt
18630  * Fixed vulcan ammo HUD message
18631  *
18632  * Revision 1.85  1994/11/29  11:35:41  rob
18633  * Added sound casting for grabbing powerups.
18634  *
18635  * Revision 1.84  1994/11/28  11:26:38  matt
18636  * Cleaned up hud message printing for picking up weapons
18637  *
18638  * Revision 1.83  1994/11/27  23:14:01  matt
18639  * Made changes for new mprintf calling convention
18640  *
18641  * Revision 1.82  1994/11/21  16:02:51  mike
18642  * comment out unused powerups.
18643  *
18644  * Revision 1.81  1994/11/20  18:25:47  john
18645  * Fixed some #ifndef RELEASE inconsistancies.
18646  *
18647  * Revision 1.80  1994/11/19  23:54:13  mike
18648  * limit megawowiezowie to shareware powerups if in shareware version.
18649  *
18650  * Revision 1.79  1994/11/14  16:06:16  yuan
18651  * Made cloak and invulnerability only picked up once.
18652  *
18653  * Revision 1.78  1994/11/07  17:41:06  mike
18654  * messages for when you're fully stocked with missiles.
18655  *
18656  * Revision 1.77  1994/10/28  14:42:50  john
18657  * Added sound volumes to all sound calls.
18658  *
18659  * Revision 1.76  1994/10/26  15:55:23  yuan
18660  * Made vulcan cannon give 100 ammo if it has less than that.
18661  *
18662  * Revision 1.75  1994/10/26  15:54:57  yuan
18663  * *** empty log message ***
18664  *
18665  * Revision 1.74  1994/10/25  14:31:25  allender
18666  * Fixed bug where getting cloak powerup while cloaked resulted in
18667  * player being cloaked forever.
18668  *
18669  * Revision 1.73  1994/10/25  10:51:21  matt
18670  * Vulcan cannon powerups now contain ammo count
18671  *
18672  * Revision 1.72  1994/10/21  20:41:32  mike
18673  * Fix silly backwards (- instead of +) bug in invulnerability powerup.
18674  *
18675  * Revision 1.71  1994/10/20  09:49:23  mike
18676  * Fix up powerups in some way.
18677  *
18678  * Revision 1.70  1994/10/19  11:16:25  mike
18679  * Limit amount of each type of ammo player can hold.
18680  *
18681  * Revision 1.69  1994/10/17  14:12:11  matt
18682  * Added sound for powerup disappearance effect
18683  *
18684  * Revision 1.68  1994/10/17  14:07:04  mike
18685  * Make shields and energy max out at 200.
18686  *
18687  * Revision 1.67  1994/10/16  12:43:37  mike
18688  * Don't allow you to pick up a primary weapon, or invulnerability, you already have.
18689  * Make cloak time additive.
18690  *
18691  * Revision 1.66  1994/10/15  19:05:30  mike
18692  * Define constants for vulcan ammo amounts.
18693  *
18694  * Revision 1.65  1994/10/14  15:57:28  mike
18695  * When you pick up a laser boost or quad_laser powerup, update weapon display.
18696  *
18697  * Revision 1.64  1994/10/13  10:57:51  adam
18698  * fiddled with powerup disappearance
18699  *
18700  * Revision 1.63  1994/10/12  13:07:33  mike
18701  * Make powerup play vclip when it goes away.
18702  *
18703  * Revision 1.62  1994/10/12  08:04:42  mike
18704  * Make proximity powerup worth 4 bombs.
18705  *
18706  * Revision 1.61  1994/10/08  23:37:33  matt
18707  * Don't pick up weapons you already have; also fixed auto_select bug
18708  * for seconary weapons
18709  *
18710  * Revision 1.60  1994/10/08  15:41:00  mike
18711  * Diminish palette effect due to powerups.
18712  *
18713  * Revision 1.59  1994/10/07  23:37:45  matt
18714  * Made weapons select when pick up better one
18715  *
18716  * Revision 1.58  1994/10/07  22:09:20  rob
18717  * Added network hook for grabbing the cloaking device.
18718
18719 ------------------------------------------------------------------------
18720 main/powerup.h:
18721
18722  * Revision 1.1  1995/05/16  16:01:35  allender
18723  * Initial revision
18724  *
18725  * Revision 2.0  1995/02/27  11:27:35  john
18726  * New version 2.0, which has no anonymous unions, builds with
18727  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18728  *
18729  * Revision 1.34  1995/02/06  15:52:37  mike
18730  * add mini megawow powerup for giving reasonable weapons.
18731  *
18732  * Revision 1.33  1995/01/30  17:14:11  mike
18733  * halve rate of vulcan ammo consumption.
18734  *
18735  * Revision 1.32  1995/01/15  20:47:56  mike
18736  * add lighting field to powerups.
18737  *
18738  * Revision 1.31  1994/12/12  21:39:58  matt
18739  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
18740  *
18741  * Revision 1.30  1994/12/07  12:55:26  mike
18742  * tweak vulcan amounts.
18743  *
18744  * Revision 1.29  1994/12/02  20:06:46  matt
18745  * Made vulcan ammo print at approx 25 times actual
18746  *
18747  * Revision 1.28  1994/10/26  15:56:27  yuan
18748  * Made vulcan cannon give 100 ammo if it has less than that.
18749  *
18750  * Revision 1.27  1994/10/15  19:07:10  mike
18751  * Define constants for amount of vulcan ammo per powerup.
18752  *
18753  * Revision 1.26  1994/09/26  13:29:38  matt
18754  * Added extra life each 100,000 points, and show icons on HUD for num lives
18755  *
18756  * Revision 1.25  1994/09/22  19:00:25  mike
18757  * Kill constants ENERGY_BOOST and SHIELD_BOOST: it's now difficulty level dependent.
18758  *
18759  * Revision 1.24  1994/09/20  19:46:11  mike
18760  * Fix powerup number assignments.
18761  *
18762  * Revision 1.23  1994/09/02  11:53:34  mike
18763  * Add the megawow powerup.  If you don't know about it, that's because it's a secret.
18764  *
18765  * Revision 1.22  1994/09/01  10:41:35  matt
18766  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
18767  * correctly if width & height of bitmap are different.
18768  *
18769  * Revision 1.21  1994/08/31  19:26:14  mike
18770  * Start adding new pile of powerups.
18771  *
18772  * Revision 1.20  1994/08/25  17:56:08  matt
18773  * Added quad laser powerup
18774  *
18775  * Revision 1.19  1994/08/18  15:11:50  mike
18776  * missile powerups.
18777  *
18778  * Revision 1.18  1994/08/09  17:54:33  adam
18779  * upped no. of powerup types
18780  *
18781  * Revision 1.17  1994/08/09  17:53:39  adam
18782  * *** empty log message ***
18783  *
18784  * Revision 1.16  1994/07/27  19:44:16  mike
18785  * Objects containing objects.
18786  *
18787  * Revision 1.15  1994/07/26  18:31:32  mike
18788  * Move some constants here from eobject.c.
18789  *
18790  * Revision 1.14  1994/07/20  17:35:03  yuan
18791  * Some minor bug fixes and new key gauges...
18792  *
18793  * Revision 1.13  1994/07/12  15:53:23  john
18794  * *** empty log message ***
18795  *
18796  * Revision 1.12  1994/07/12  15:30:47  mike
18797  * Prototype diminish_towards_max.
18798  *
18799  * Revision 1.11  1994/07/07  14:59:04  john
18800  * Made radar powerups.
18801  *
18802  *
18803  * Revision 1.10  1994/07/01  16:35:40  yuan
18804  * Added key system
18805  *
18806  * Revision 1.9  1994/06/29  19:43:33  matt
18807  * Made powerup animation not happen in render routine
18808  *
18809  * Revision 1.8  1994/06/21  18:54:03  matt
18810  * Added support for powerups that don't get picked up if not needed, but this
18811  * feature is commented out at the end of do_powerup(), since the physics gave
18812  * me all sorts of problems, with the player getting stuck on a powerup.
18813  *
18814  * Revision 1.7  1994/06/08  18:16:32  john
18815  * Bunch of new stuff that basically takes constants out of the code
18816  * and puts them into bitmaps.tbl.
18817  *
18818  * Revision 1.6  1994/05/18  13:26:30  yuan
18819  * *** empty log message ***
18820  *
18821  * Revision 1.5  1994/05/17  17:01:48  yuan
18822  * Added constant for boosts.
18823  *
18824  * Revision 1.4  1994/04/06  14:42:50  yuan
18825  * Adding new powerups.
18826  *
18827  * Revision 1.3  1994/04/01  14:36:59  yuan
18828  * John's head is an extra life...
18829  *
18830  * Revision 1.2  1994/04/01  11:15:22  yuan
18831  * Added multiple bitmap functionality to all objects...
18832  * (hostages, powerups, lasers, etc.)
18833  * Hostages and powerups are implemented in the object system,
18834  * just need to finish function call to "affect" player.
18835  *
18836  * Revision 1.1  1994/03/31  17:01:43  yuan
18837  * Initial revision
18838
18839 ------------------------------------------------------------------------
18840 main/render.c:
18841
18842  * Revision 1.9  1995/11/20  17:17:48  allender
18843  * *** empty log message ***
18844  *
18845  * Revision 1.8  1995/10/26  14:08:35  allender
18846  * added assigment for physics optimization
18847  *
18848  * Revision 1.7  1995/09/22  14:28:46  allender
18849  * changed render_zoom to make game match PC aspect
18850  *
18851  * Revision 1.6  1995/08/14  14:35:54  allender
18852  * change transparency to 0
18853  *
18854  * Revision 1.5  1995/08/12  11:32:02  allender
18855  * removed #ifdef NEWDEMO -- always in
18856  *
18857  * Revision 1.4  1995/07/05  16:48:31  allender
18858  * kitchen stuff
18859  *
18860  * Revision 1.3  1995/06/23  10:22:54  allender
18861  * fix outline mode
18862  *
18863  * Revision 1.2  1995/06/16  16:11:18  allender
18864  * changed sort func to accept const parameters
18865  *
18866  * Revision 1.1  1995/05/16  15:30:24  allender
18867  * Initial revision
18868  *
18869  * Revision 2.5  1995/12/19  15:31:36  john
18870  * Made stereo mode only record 1 eye in demo.
18871  *
18872  * Revision 2.4  1995/03/20  18:15:53  john
18873  * Added code to not store the normals in the segment structure.
18874  *
18875  * Revision 2.3  1995/03/13  16:11:05  john
18876  * Maybe fixed bug that lighting didn't work with vr helmets.
18877  *
18878  * Revision 2.2  1995/03/09  15:33:49  john
18879  * Fixed bug with iglasses timeout too long, and objects
18880  * disappearing from left eye.
18881  *
18882  * Revision 2.1  1995/03/06  15:23:59  john
18883  * New screen techniques.
18884  *
18885  * Revision 2.0  1995/02/27  11:31:01  john
18886  * New version 2.0, which has no anonymous unions, builds with
18887  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18888  *
18889  * Revision 1.252  1995/02/22  13:49:38  allender
18890  * remove anonymous unions from object structure
18891  *
18892  * Revision 1.251  1995/02/11  15:07:26  matt
18893  * Took out code which was mostly intended as part of a larger renderer
18894  * change which never happened.  This new code was causing problems with
18895  * the level 4 control center.
18896  *
18897  * Revision 1.250  1995/02/07  16:28:53  matt
18898  * Fixed problem with new code
18899  *
18900  * Revision 1.249  1995/02/06  14:38:58  matt
18901  * Took out some code that didn't compile when editor in
18902  *
18903  * Revision 1.248  1995/02/06  13:45:25  matt
18904  * Structural changes, plus small sorting improvements
18905  *
18906  * Revision 1.247  1995/02/02  15:59:26  matt
18907  * Changed assert to int3.
18908  *
18909  * Revision 1.246  1995/02/01  21:02:27  matt
18910  * Added partial fix for rendering bugs
18911  * Ripped out laser hack system
18912  *
18913  * Revision 1.245  1995/01/20  15:14:30  matt
18914  * Added parens to fix precedence bug
18915  *
18916  * Revision 1.244  1995/01/14  19:16:59  john
18917  * First version of new bitmap paging code.
18918  *
18919  * Revision 1.243  1995/01/03  20:19:25  john
18920  * Pretty good working version of game save.
18921  *
18922  * Revision 1.242  1994/12/29  13:51:05  john
18923  * Made the floating reticle draw in the spot
18924  * regardless of the eye offset.
18925  *
18926  * Revision 1.241  1994/12/23  15:02:55  john
18927  * Tweaked floating reticle.
18928  *
18929  * Revision 1.240  1994/12/23  14:27:45  john
18930  * Changed offset of floating reticle to line up with
18931  * lasers a bit better.
18932  *
18933  * Revision 1.239  1994/12/23  14:22:50  john
18934  * Added floating reticle for VR helments.
18935  *
18936  * Revision 1.238  1994/12/13  14:07:50  matt
18937  * Fixed tmap_num2 bug in search mode
18938  *
18939  * Revision 1.237  1994/12/11  00:45:53  matt
18940  * Fixed problem when object sort buffer got full
18941  *
18942  * Revision 1.236  1994/12/09  18:46:06  matt
18943  * Added a little debugging
18944  *
18945  * Revision 1.235  1994/12/09  14:59:16  matt
18946  * Added system to attach a fireball to another object for rendering purposes,
18947  * so the fireball always renders on top of (after) the object.
18948  *
18949  * Revision 1.234  1994/12/08  15:46:54  matt
18950  * Fixed buffer overflow that caused seg depth screwup
18951  *
18952  * Revision 1.233  1994/12/08  11:51:53  matt
18953  * Took out some unused stuff
18954  *
18955  * Revision 1.232  1994/12/06  16:31:48  mike
18956  * fix detriangulation problems.
18957  *
18958  * Revision 1.231  1994/12/05  15:32:51  matt
18959  * Changed an assert to an int3 & return
18960  *
18961  * Revision 1.230  1994/12/04  17:28:04  matt
18962  * Got rid of unused no_render_flag array, and took out box clear when searching
18963  *
18964  * Revision 1.229  1994/12/04  15:51:14  matt
18965  * Fixed linear tmap transition for objects
18966  *
18967  * Revision 1.228  1994/12/03  20:16:50  matt
18968  * Turn off window clip for objects
18969  *
18970  * Revision 1.227  1994/12/03  14:48:00  matt
18971  * Restored some default settings
18972  *
18973  * Revision 1.226  1994/12/03  14:44:32  matt
18974  * Fixed another difficult bug in the window clip system
18975  *
18976  * Revision 1.225  1994/12/02  13:19:56  matt
18977  * Fixed rect clears at terminus of rendering
18978  * Made a bunch of debug code compile out
18979  *
18980  * Revision 1.224  1994/12/02  11:58:21  matt
18981  * Fixed window clip bug
18982  *
18983  * Revision 1.223  1994/11/28  21:50:42  mike
18984  * optimizations.
18985  *
18986  * Revision 1.222  1994/11/28  01:32:15  mike
18987  * turn off window clearing.
18988  *
18989  * Revision 1.221  1994/11/27  23:11:52  matt
18990  * Made changes for new mprintf calling convention
18991  *
18992  * Revision 1.220  1994/11/20  15:58:55  matt
18993  * Don't migrate the control center, since it doesn't move out of its segment
18994  *
18995  * Revision 1.219  1994/11/19  23:54:36  mike
18996  * change window colors.
18997  *
18998  * Revision 1.218  1994/11/19  15:20:25  mike
18999  * rip out unused code and data
19000  *
19001  * Revision 1.217  1994/11/18  13:21:24  mike
19002  * Clear only view portals into rest of world based on value of Clear_window.
19003  *
19004  * Revision 1.216  1994/11/15  17:02:10  matt
19005  * Re-added accidentally deleted variable
19006  *
19007  * Revision 1.215  1994/11/15  16:51:50  matt
19008  * Made rear view only switch to rear cockpit if cockpit on in front view
19009  *
19010  * Revision 1.214  1994/11/14  20:47:57  john
19011  * Attempted to strip out all the code in the game
19012  * directory that uses any ui code.
19013  *
19014  * Revision 1.213  1994/11/11  15:37:07  mike
19015  * write orange for background to show render bugs.
19016  *
19017  * Revision 1.212  1994/11/09  22:57:18  matt
19018  * Keep tract of depth of segments rendered, for detail level optimization
19019  *
19020  * Revision 1.211  1994/11/01  23:40:14  matt
19021  * Elegantly handler buffer getting full
19022  *
19023  * Revision 1.210  1994/10/31  22:28:13  mike
19024  * Fix detriangulation bug.
19025  *
19026  * Revision 1.209  1994/10/31  11:48:56  mike
19027  * Optimize detriangulation, speedup of about 4% in many cases, 0% in many.
19028  *
19029  * Revision 1.208  1994/10/30  20:08:34  matt
19030  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
19031  * go out; made more explosions on walls.
19032  *
19033  * Revision 1.207  1994/10/27  14:14:35  matt
19034  * Don't do light flash during endlevel sequence
19035  *
19036  * Revision 1.206  1994/10/11  12:05:42  mike
19037  * Improve detriangulation.
19038  *
19039  * Revision 1.205  1994/10/07  15:27:00  john
19040  * Commented out the code that moves your eye
19041  * forward.
19042  *
19043  * Revision 1.204  1994/10/05  16:07:38  mike
19044  * Don't detriangulate sides if in player's segment.  Prevents player going behind a wall,
19045  * though there are cases in which it would be ok to detriangulate these.
19046  *
19047  * Revision 1.203  1994/10/03  12:44:05  matt
19048  * Took out unreferenced code
19049  *
19050  * Revision 1.202  1994/09/28  14:08:45  john
19051  * Added Zoom stuff back in, but ifdef'd it out.
19052  *
19053  * Revision 1.201  1994/09/25  23:41:49  matt
19054  * Changed the object load & save code to read/write the structure fields one
19055  * at a time (rather than the whole structure at once).  This mean that the
19056  * object structure can be changed without breaking the load/save functions.
19057  * As a result of this change, the local_object data can be and has been
19058  * incorporated into the object array.  Also, timeleft is now a property
19059  * of all objects, and the object structure has been otherwise cleaned up.
19060  *
19061  * Revision 1.200  1994/09/25  15:50:10  mike
19062  * Integrate my debug changes which shows how many textures were rendered
19063  * this frame.
19064  *
19065  * Revision 1.199  1994/09/25  15:45:22  matt
19066  * Added OBJ_LIGHT, a type of object that casts light
19067  * Added generalized lifeleft, and moved it to local_object
19068  *
19069  * Revision 1.198  1994/09/15  21:23:32  matt
19070  * Changed system to keep track of whether & what cockpit is up
19071  *
19072  * Revision 1.197  1994/09/15  16:30:12  mike
19073  * Comment out call to object_render_targets, which did nothing.
19074  *
19075  * Revision 1.196  1994/09/07  22:25:51  matt
19076  * Don't migrate through semi-transparent walls
19077  *
19078  * Revision 1.195  1994/09/07  19:16:21  mike
19079  * Homing missile.
19080  *
19081  * Revision 1.194  1994/08/31  20:54:17  matt
19082  * Don't do flash effect while whiting out
19083  *
19084  * Revision 1.193  1994/08/23  17:20:12  john
19085  * Added rear-view cockpit.
19086  *
19087  * Revision 1.192  1994/08/22  14:36:35  john
19088  * Made R key make a "reverse" view render.
19089  *
19090  * Revision 1.191  1994/08/19  20:09:26  matt
19091  * Added end-of-level cut scene with external scene
19092  *
19093  * Revision 1.190  1994/08/10  19:56:17  john
19094  * Changed font stuff; Took out old menu; messed up lots of
19095  * other stuff like game sequencing messages, etc.
19096  *
19097  * Revision 1.189  1994/08/10  14:45:05  john
19098  * *** empty log message ***
19099  *
19100  * Revision 1.188  1994/08/09  16:04:06  john
19101  * Added network players to editor.
19102  *
19103  * Revision 1.187  1994/08/05  17:07:05  john
19104  * Made lasers be two objects, one drawing after the other
19105  * all the time.
19106  *
19107  * Revision 1.186  1994/08/05  10:07:57  matt
19108  * Disable window check checking (i.e., always use window check)
19109  *
19110  * Revision 1.185  1994/08/04  19:11:30  matt
19111  * Changed a bunch of vecmat calls to use multiple-function routines, and to
19112  * allow the use of C macros for some functions
19113  *
19114  * Revision 1.184  1994/08/04  00:21:14  matt
19115  * Cleaned up fvi & physics error handling; put in code to make sure objects
19116  * are in correct segment; simplified segment finding for objects and points
19117  *
19118  * Revision 1.183  1994/08/02  19:04:28  matt
19119  * Cleaned up vertex list functions
19120  *
19121  * Revision 1.182  1994/07/29  15:13:33  matt
19122  * When window check turned off, cut render depth in half
19123  *
19124  * Revision 1.181  1994/07/29  11:03:50  matt
19125  * Use highest_segment_index instead of num_segments so render works from
19126  * the editor
19127  *
19128  * Revision 1.180  1994/07/29  10:04:34  mike
19129  * Update Cursegp when an object is selected.
19130  *
19131  * Revision 1.179  1994/07/25  00:02:50  matt
19132  * Various changes to accomodate new 3d, which no longer takes point numbers
19133  * as parms, and now only takes pointers to points.
19134  *
19135  * Revision 1.178  1994/07/24  14:37:49  matt
19136  * Added angles for player head
19137  *
19138  * Revision 1.177  1994/07/20  19:08:07  matt
19139  * If in editor, don't move eye from center of viewer object
19140
19141 ------------------------------------------------------------------------
19142 main/render.h:
19143
19144  * Revision 1.1  1995/05/16  16:01:51  allender
19145  * Initial revision
19146  *
19147  * Revision 2.0  1995/02/27  11:33:00  john
19148  * New version 2.0, which has no anonymous unions, builds with
19149  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19150  *
19151  * Revision 1.17  1994/11/30  12:33:33  mike
19152  * prototype Clear_window.
19153  *
19154  * Revision 1.16  1994/11/02  16:19:52  matt
19155  * Increased size of extra object buffer
19156  *
19157  * Revision 1.15  1994/07/25  00:02:49  matt
19158  * Various changes to accomodate new 3d, which no longer takes point numbers
19159  * as parms, and now only takes pointers to points.
19160  *
19161  * Revision 1.14  1994/07/24  14:37:42  matt
19162  * Added angles for player head
19163  *
19164  * Revision 1.13  1994/06/24  17:01:34  john
19165  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
19166  * took it out of game.c and into gameseq.c
19167  *
19168  * Revision 1.12  1994/06/16  10:55:57  matt
19169  * Made a bunch of test code dependent on #defines
19170  *
19171  * Revision 1.11  1994/06/01  00:01:36  matt
19172  * Added mine destruction flashing effect
19173  *
19174  * Revision 1.10  1994/05/22  18:47:36  mike
19175  * make Render_list a globally accessible variable.
19176  *
19177  * Revision 1.9  1994/05/22  15:29:32  mike
19178  * Separation of lighting from render.c to lighting.c.
19179  *
19180  * Revision 1.8  1994/05/14  17:59:39  matt
19181  * Added extern.
19182  *
19183  * Revision 1.7  1994/05/14  17:15:17  matt
19184  * Got rid of externs in source (non-header) files
19185  *
19186  * Revision 1.6  1994/02/17  11:32:41  matt
19187  * Changes in object system
19188  *
19189  * Revision 1.5  1994/01/21  17:31:48  matt
19190  * Moved code from render_frame() to caller, making code cleaner
19191  *
19192  * Revision 1.4  1994/01/06  09:46:12  john
19193  * Added removable walls... all code that checked for
19194  * children to see if a wall was a doorway, i changed
19195  * to yuan's wall_is_doorway function that is in wall.c...
19196  * doesn't work yet.
19197  *
19198  * Revision 1.3  1994/01/05  11:25:47  john
19199  * Changed Player_zoom to Render_zoom
19200  *
19201  * Revision 1.2  1994/01/05  10:53:43  john
19202  * New object code by John.
19203  *
19204  * Revision 1.1  1993/11/04  14:01:43  matt
19205  * Initial revision
19206
19207 ------------------------------------------------------------------------
19208 main/robot.c:
19209
19210  * Revision 1.1  1995/05/16  15:30:34  allender
19211  * Initial revision
19212  *
19213  * Revision 2.1  1995/03/07  16:52:02  john
19214  * Fixed robots not moving without edtiro bug.
19215  *
19216  * Revision 2.0  1995/02/27  11:31:11  john
19217  * New version 2.0, which has no anonymous unions, builds with
19218  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19219  *
19220  * Revision 1.19  1995/02/22  13:58:09  allender
19221  * remove anonymous unions from object structure
19222  *
19223  * Revision 1.18  1995/01/27  11:17:06  rob
19224  * Avoid problems with illegal gun num.
19225  *
19226  * Revision 1.17  1994/11/19  15:15:02  mike
19227  * remove unused code and data
19228  *
19229  * Revision 1.16  1994/11/05  16:41:31  adam
19230  * upped MAX_ROBOT_JOINTS
19231  *
19232  * Revision 1.15  1994/09/26  15:29:29  matt
19233  * Allow morphing objects to fire
19234  *
19235  * Revision 1.14  1994/06/20  14:31:02  matt
19236  * Don't include joint zero in animation data
19237  *
19238  * Revision 1.13  1994/06/10  14:39:58  matt
19239  * Increased limit of robot joints
19240  *
19241  * Revision 1.12  1994/06/10  10:59:18  matt
19242  * Do error checking on list of angles
19243  *
19244  * Revision 1.11  1994/06/09  16:21:32  matt
19245  * Took out special-case and test code.
19246  *
19247  * Revision 1.10  1994/06/07  13:21:14  matt
19248  * Added support for new chunk-based POF files, with robot animation data.
19249  *
19250  * Revision 1.9  1994/06/01  17:58:24  mike
19251  * Greater flinch effect.
19252  *
19253  * Revision 1.8  1994/06/01  14:59:25  matt
19254  * Fixed calc_gun_position(), which was rotating the wrong way for the
19255  * object orientation.
19256  *
19257  * Revision 1.7  1994/06/01  12:44:04  matt
19258  * Added flinch state for test robot
19259  *
19260  * Revision 1.6  1994/05/31  19:17:24  matt
19261  * Fixed test robot angles
19262  *
19263  * Revision 1.5  1994/05/30  19:43:50  mike
19264  * Call set_test_robot.
19265  *
19266  *
19267  * Revision 1.4  1994/05/30  00:02:44  matt
19268  * Got rid of robot render type, and generally cleaned up polygon model
19269  * render objects.
19270  *
19271  * Revision 1.3  1994/05/29  18:46:15  matt
19272  * Added stuff for getting robot animation info for different states
19273  *
19274  * Revision 1.2  1994/05/26  21:09:15  matt
19275  * Moved robot stuff out of polygon model and into robot_info struct
19276  * Made new file, robot.c, to deal with robots
19277  *
19278  * Revision 1.1  1994/05/26  18:02:04  matt
19279  * Initial revision
19280
19281 ------------------------------------------------------------------------
19282 main/robot.h:
19283
19284  * Revision 1.1  1995/05/16  16:01:59  allender
19285  * Initial revision
19286  *
19287  * Revision 2.1  1995/03/07  16:52:00  john
19288  * Fixed robots not moving without edtiro bug.
19289  *
19290  * Revision 2.0  1995/02/27  11:30:59  john
19291  * New version 2.0, which has no anonymous unions, builds with
19292  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19293  *
19294  * Revision 1.25  1994/11/30  14:02:44  mike
19295  * fields for see/attack/claw sounds.
19296  *
19297  * Revision 1.24  1994/10/27  15:55:41  adam
19298  * *** empty log message ***
19299  *
19300  * Revision 1.23  1994/10/20  15:17:03  mike
19301  * Add boss flag.
19302  *
19303  * Revision 1.22  1994/10/20  09:51:00  adam
19304  * *** empty log message ***
19305  *
19306  * Revision 1.21  1994/10/18  10:52:54  mike
19307  * Support robots lunging as an attack_type.
19308  *
19309  * Revision 1.20  1994/10/17  21:19:02  mike
19310  * robot cloaking.
19311  *
19312  * Revision 1.19  1994/09/27  00:03:39  mike
19313  * Add score_value to robot_info struct.
19314  *
19315  * Revision 1.18  1994/09/22  19:01:12  mike
19316  * Move NDL from here to game.h
19317  *
19318  * Revision 1.17  1994/09/22  15:46:55  mike
19319  * Add default contained objects for robots.
19320  *
19321  * Revision 1.16  1994/09/22  10:46:57  mike
19322  * Add difficulty levels.
19323  *
19324  * Revision 1.15  1994/09/15  16:34:16  mike
19325  * Change rapidfire_count to a byte, add evade_speed, dum1, dum2.
19326  *
19327  * Revision 1.14  1994/09/09  14:21:58  matt
19328  * Increased maximum number of games
19329  *
19330  * Revision 1.13  1994/08/25  18:12:13  matt
19331  * Made player's weapons and flares fire from the positions on the 3d model.
19332  * Also added support for quad lasers.
19333  *
19334  * Revision 1.12  1994/08/23  16:37:24  mike
19335  * Add rapidfire_count to robot_info.
19336  *
19337  * Revision 1.11  1994/07/27  19:45:01  mike
19338  * Objects containing objects.
19339  *
19340  * Revision 1.10  1994/07/12  12:40:01  matt
19341  * Revamped physics system
19342  *
19343  * Revision 1.9  1994/06/21  12:17:12  mike
19344  * Add circle_distance to robot_info.
19345  *
19346  * Revision 1.8  1994/06/09  16:22:28  matt
19347  * Moved header for calc_gun_point() here, where it belongs
19348  *
19349  * Revision 1.7  1994/06/08  18:16:23  john
19350  * Bunch of new stuff that basically takes constants out of the code
19351  * and puts them into bitmaps.tbl.
19352  *
19353  * Revision 1.6  1994/06/03  11:38:09  john
19354  * Made robots get their strength for RobotInfo->strength, which
19355  * is read in from bitmaps.tbl
19356  *
19357  * Revision 1.5  1994/05/30  19:43:31  mike
19358  * Add voluminous comment for robot_get_anim_state.
19359  *
19360  * Revision 1.4  1994/05/30  00:03:18  matt
19361  * Got rid of robot render type, and generally cleaned up polygon model
19362  * render objects.
19363  *
19364  * Revision 1.3  1994/05/29  18:46:37  matt
19365  * Added stuff for getting robot animation info for different states
19366  *
19367  * Revision 1.2  1994/05/26  21:09:18  matt
19368  * Moved robot stuff out of polygon model and into robot_info struct
19369  * Made new file, robot.c, to deal with robots
19370  *
19371  * Revision 1.1  1994/05/26  18:02:12  matt
19372  * Initial revision
19373
19374 ------------------------------------------------------------------------
19375 main/scores.c:
19376
19377  * Revision 1.1  1995/12/05  16:06:29  allender
19378  * Initial revision
19379  *
19380  * Revision 1.3  1995/08/14  09:25:16  allender
19381  * add byteswap header
19382  *
19383  * Revision 1.2  1995/07/14  13:45:17  allender
19384  * fixed up high score code to work and look pretty good
19385  * needs some work tho'
19386  *
19387  * Revision 1.1  1995/05/16  15:30:42  allender
19388  * Initial revision
19389  *
19390  * Revision 2.2  1995/06/15  12:13:54  john
19391  * Made end game, win game and title sequences all go
19392  * on after 5 minutes automatically.
19393  *
19394  * Revision 2.1  1995/03/06  15:23:57  john
19395  * New screen techniques.
19396  *
19397  * Revision 2.0  1995/02/27  11:30:53  john
19398  * New version 2.0, which has no anonymous unions, builds with
19399  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19400  *
19401  * Revision 1.109  1995/02/09  12:23:19  rob
19402  * Added assert for length of filename.
19403  *
19404  * Revision 1.108  1995/01/03  17:33:24  john
19405  * Made scrolling textbox. Used it for scores cool saying.
19406  *
19407  * Revision 1.107  1994/12/28  10:42:51  john
19408  * More VFX tweaking.
19409  *
19410  * Revision 1.106  1994/12/28  10:26:19  john
19411  * Fixed some VFX problems.
19412  *
19413  * Revision 1.105  1994/12/15  16:42:12  adam
19414  * some fix
19415  *
19416  * Revision 1.104  1994/12/14  11:59:19  john
19417  * Changed the default high scores.
19418  *
19419  * Revision 1.103  1994/12/09  00:41:12  mike
19420  * fix hang in automap print screen
19421  *
19422  * Revision 1.102  1994/12/07  00:36:26  mike
19423  * scores sequencing stuff.
19424  *
19425  * Revision 1.101  1994/12/06  15:14:21  yuan
19426  * Localization
19427  *
19428  * Revision 1.100  1994/12/03  17:07:52  yuan
19429  * Localization 368
19430  *
19431  * Revision 1.99  1994/12/03  14:49:27  mark
19432  * Fixed john's bug with previous.
19433  *
19434  * Revision 1.98  1994/12/03  14:43:54  john
19435  * Added enter, space  to exit scores.
19436  *
19437  * Revision 1.97  1994/12/03  14:32:34  john
19438  * Added integrated-super-deluxe-ctrl-r to reset high scores.
19439  *
19440  * Revision 1.96  1994/12/01  20:15:20  yuan
19441  * Localization
19442  *
19443  * Revision 1.95  1994/11/30  19:36:36  john
19444  * Made Gravis Ultrasound work again.  Made the scores blink
19445  * at a constant rate.  Revamped the newmenu background storage,
19446  * which hopefully fixed some bugs.  Made menus in ame not pause
19447  * sound, except for the pause key.               ^== Game!
19448  *
19449  * Revision 1.94  1994/11/30  12:32:08  john
19450  * Made secret levels print correctly.
19451  *
19452  * Revision 1.93  1994/11/30  12:06:47  mike
19453  * fix bug: looper not initialized.
19454  *
19455  * Revision 1.92  1994/11/29  13:20:04  john
19456  * changed the "Wow! You placed .." to something better.
19457  *
19458  * Revision 1.91  1994/11/29  01:35:38  john
19459  * Made it so that even if you don't get a high score, you still show
19460  * up on the chart..
19461  *
19462  * Revision 1.90  1994/11/23  17:29:29  mike
19463  * fix xx-xx level bug in high scores.
19464  *
19465  * Revision 1.89  1994/11/22  16:55:27  mike
19466  * allow high scores even in pudly trainee level.
19467  *
19468  * Revision 1.88  1994/11/21  17:28:33  john
19469  * Changed default score values.
19470  *
19471  * Revision 1.87  1994/11/18  23:37:53  john
19472  * Changed some shorts to ints.
19473  *
19474  * Revision 1.86  1994/11/13  15:39:24  john
19475  * Added critical error handler to game.  Took out -editor command line
19476  * option because it didn't work anymore and wasn't worth fixing.  Made scores
19477  * not use MINER enviroment variable on release version, and made scores
19478  * not print an error if there is no descent.hi.
19479  *
19480  * Revision 1.85  1994/11/06  10:15:58  john
19481  * Took out kill % and hostage %
19482  *
19483  * Revision 1.84  1994/11/05  15:03:39  john
19484  * Added non-popup menu for the main menu, so that scores and credits don't have to save
19485  * the background.
19486  *
19487  * Revision 1.83  1994/11/05  14:05:57  john
19488  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
19489  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
19490  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
19491  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
19492  *
19493  * Revision 1.82  1994/11/04  20:11:41  john
19494  * Neatening up palette stuff with demos.
19495  *
19496  * Revision 1.81  1994/11/04  12:02:34  john
19497  * Fixed fading transitions a bit more.
19498  *
19499  * Revision 1.80  1994/10/27  12:10:39  john
19500  * Moved kill % a little to the right.
19501  *
19502  * Revision 1.79  1994/10/24  20:25:03  john
19503  * Fixed bug with space at end of 1 line message.
19504  * Made Enter go between the two input lines.
19505  *
19506  * Revision 1.78  1994/10/24  18:20:18  john
19507  * Made the current high score flash.
19508  *
19509  * Revision 1.77  1994/10/24  13:37:22  mike
19510  * Fix grammar error.  --anal Mike.
19511  *
19512  * Revision 1.76  1994/10/22  13:19:19  john
19513  * Made joy/mouse buttons leave score screen.
19514  *
19515  * Revision 1.75  1994/10/21  15:26:57  john
19516  * Used PrtScr instead of F2.
19517  *
19518  * Revision 1.74  1994/10/21  13:54:21  matt
19519  * Replace '1' with special wide '1' to make numbers line up
19520  *
19521  * Revision 1.73  1994/10/19  20:48:01  john
19522  * Made so that people playing on wimp level
19523  * can't get high scores.
19524  *
19525  * Revision 1.72  1994/10/19  15:14:05  john
19526  * Took % hits out of player structure, made %kills work properly.
19527  *
19528  * Revision 1.71  1994/10/19  14:39:27  john
19529  * Finished up; added keys to prtscr, int3.
19530  *
19531  * Revision 1.70  1994/10/19  12:44:09  john
19532  * Added hours field to player structure.
19533  *
19534  * Revision 1.69  1994/10/19  11:25:21  john
19535  * Looking good.
19536  *
19537  * Revision 1.68  1994/10/19  10:54:12  john
19538  * Test version.
19539  *
19540  * Revision 1.67  1994/10/19  10:00:27  john
19541  * *** empty log message ***
19542  *
19543  * Revision 1.66  1994/10/19  09:59:03  john
19544  * Made cool saying have the potential to be up to 50 chars
19545  *
19546  * Revision 1.65  1994/10/19  09:53:30  john
19547  * Working version of scores.
19548  *
19549  * Revision 1.64  1994/10/18  21:07:46  john
19550  * Fixed bug that didn't print name correctly.
19551  *
19552  * Revision 1.63  1994/10/18  18:21:46  john
19553  * NEw score system.
19554  *
19555  * Revision 1.62  1994/10/17  20:31:42  john
19556  * Made the text for the difficulty labels global so that
19557  * the high score screen can print "rookie" or whatever.
19558  *
19559  * Revision 1.61  1994/10/17  17:27:44  john
19560  * Added starting_level to high score system.
19561  *
19562  * Revision 1.60  1994/10/17  16:56:35  john
19563  * Added starting level to stats menu.
19564  *
19565  * Revision 1.59  1994/10/17  16:55:25  john
19566  * Added starting level, but didn't hook it to anything.
19567  *
19568  * Revision 1.58  1994/10/17  16:47:17  john
19569  * Added diff. level.
19570  *
19571  * Revision 1.57  1994/10/17  15:49:53  john
19572  * Added stats screen.
19573  *
19574  * Revision 1.56  1994/10/03  23:02:29  matt
19575  * After player added or not to scores, scores are now displayed
19576  *
19577  * Revision 1.55  1994/09/01  18:09:38  john
19578  * Made commas in scores work correctly .
19579  *
19580  *
19581  * Revision 1.54  1994/09/01  18:03:57  john
19582  * Neatened up scores a bit.
19583  *
19584  * Revision 1.53  1994/08/26  14:27:37  john
19585  * Made it prompt for name
19586  *
19587  * Revision 1.52  1994/08/26  13:03:17  john
19588  * *** empty log message ***
19589  *
19590  * Revision 1.51  1994/08/26  13:01:52  john
19591  * Put high score system in.
19592  *
19593  * Revision 1.50  1994/08/10  19:57:01  john
19594  * Changed font stuff; Took out old menu; messed up lots of
19595  * other stuff like game sequencing messages, etc.
19596  *
19597  * Revision 1.49  1994/07/25  15:40:27  matt
19598  * Took out debugging code accidentally left in.
19599
19600 ------------------------------------------------------------------------
19601 main/scores.h:
19602
19603  * Revision 1.1  1995/05/16  16:02:07  allender
19604  * Initial revision
19605  *
19606  * Revision 2.0  1995/02/27  11:31:53  john
19607  * New version 2.0, which has no anonymous unions, builds with
19608  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19609  *
19610  * Revision 1.13  1994/12/07  00:36:36  mike
19611  * scores sequencing stuff.
19612  *
19613  * Revision 1.12  1994/11/28  11:26:09  matt
19614  * Took out scores for weapons, which are no longer used
19615  *
19616  * Revision 1.11  1994/10/24  18:20:03  john
19617  * Made the current high score flash.
19618  *
19619  * Revision 1.10  1994/10/18  18:21:36  john
19620  * NEw score system.
19621  *
19622  * Revision 1.9  1994/10/03  23:01:58  matt
19623  * New parms for scores_view()
19624  *
19625  *
19626  * Revision 1.8  1994/09/27  16:10:37  adam
19627  * changed scores of course
19628  *
19629  * Revision 1.7  1994/08/31  19:25:46  mike
19630  * Add score values for new powerups.
19631  *
19632  * Revision 1.6  1994/08/26  16:00:18  mike
19633  * enhanced (?) scoring.
19634  *
19635  * Revision 1.5  1994/08/26  13:01:45  john
19636  * Put high score system in.
19637  *
19638  * Revision 1.4  1994/05/30  16:33:21  yuan
19639  * Revamping high scores.
19640  *
19641  * Revision 1.3  1994/05/14  17:15:07  matt
19642  * Got rid of externs in source (non-header) files
19643  *
19644  * Revision 1.2  1994/05/13  13:13:57  yuan
19645  * Added player death...
19646  *
19647  * When you die, if just pops up a a message.
19648  * When game is over, a message is popped up, and if you have a high score,
19649  * you get to enter it.
19650  *
19651  * Revision 1.1  1994/05/13  10:22:16  yuan
19652  * Initial revision
19653
19654 ------------------------------------------------------------------------
19655 main/screens.h:
19656
19657  * Revision 1.1  1995/05/16  16:02:15  allender
19658  * Initial revision
19659  *
19660  * Revision 2.2  1995/03/14  12:14:00  john
19661  * Made VR helmets have 4 resolutions to choose from.
19662  *
19663  * Revision 2.1  1995/03/06  15:24:09  john
19664  * New screen techniques.
19665  *
19666  * Revision 2.0  1995/02/27  11:31:40  john
19667  * New version 2.0, which has no anonymous unions, builds with
19668  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19669  *
19670  * Revision 1.15  1994/08/10  19:56:45  john
19671  * Changed font stuff; Took out old menu; messed up lots of
19672  * other stuff like game sequencing messages, etc.
19673  *
19674  * Revision 1.14  1994/07/20  21:04:26  john
19675  * Add VictorMax VR helment support.
19676  *
19677  * Revision 1.13  1994/06/24  17:01:28  john
19678  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
19679  * took it out of game.c and into gameseq.c
19680  *
19681  * Revision 1.12  1994/04/20  20:30:03  john
19682  * *** empty log message ***
19683  *
19684  * Revision 1.11  1994/03/30  21:12:05  yuan
19685  * Use only 119 lines (saves 3 scanlines)
19686  *
19687  * Revision 1.10  1994/03/17  16:49:37  john
19688  * *** empty log message ***
19689  *
19690  * Revision 1.9  1994/02/11  15:07:44  matt
19691  * Added extern of Canv_game_offscrn
19692  *
19693  * Revision 1.8  1994/01/31  16:52:43  john
19694  * redid cockpit bounds.
19695  *
19696  * Revision 1.7  1994/01/26  18:13:53  john
19697  * Changed 3d constants..
19698  *
19699  * Revision 1.6  1994/01/25  17:11:46  john
19700  * *** empty log message ***
19701  *
19702  * Revision 1.5  1994/01/25  11:43:25  john
19703  * Changed game window size.
19704  *
19705  * Revision 1.4  1993/12/13  16:32:39  yuan
19706  * Fixed menu system memory errors, and other bugs.
19707  *
19708  * Revision 1.3  1993/12/10  16:07:23  yuan
19709  * Working on menu system.  Updated the title screen.
19710  *
19711  * Revision 1.2  1993/12/09  21:27:46  matt
19712  * Added 3d window sizing constants
19713  *
19714  * Revision 1.1  1993/12/06  09:50:33  matt
19715  * Initial revision
19716
19717 ------------------------------------------------------------------------
19718 main/segment.h:
19719
19720  * Revision 1.4  1995/11/03  12:53:11  allender
19721  * shareware changes
19722  *
19723  * Revision 1.3  1995/07/26  16:53:45  allender
19724  * put sides and segment structure back the PC way for checksumming reasons
19725  *
19726  * Revision 1.2  1995/06/19  07:55:22  allender
19727  * rearranged structure members for possible better alignment
19728  *
19729  * Revision 1.1  1995/05/16  16:02:22  allender
19730  * Initial revision
19731  *
19732  * Revision 2.1  1995/03/20  18:15:22  john
19733  * Added code to not store the normals in the segment structure.
19734  *
19735  * Revision 2.0  1995/02/27  11:26:49  john
19736  * New version 2.0, which has no anonymous unions, builds with
19737  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19738  *
19739  * Revision 1.89  1995/01/24  15:07:55  yuan
19740  * *** empty log message ***
19741  *
19742  * Revision 1.88  1994/12/12  01:04:06  yuan
19743  * Boosted MAX_GAME_VERTS.
19744  *
19745  * Revision 1.87  1994/12/11  16:18:14  mike
19746  * add constants so we can detect too-large mines for game while in editor.
19747  *
19748  * Revision 1.86  1994/12/08  15:07:29  yuan
19749  * *** empty log message ***
19750  *
19751  * Revision 1.85  1994/12/01  21:06:39  matt
19752  * Moved plane tolerance constant to gameseg.c, the only file that used it.
19753  *
19754  * Revision 1.84  1994/11/27  14:01:41  matt
19755  * Fixed segment structure so LVLs work
19756  *
19757  * Revision 1.83  1994/11/26  22:50:20  matt
19758  * Removed editor-only fields from segment structure when editor is compiled
19759  * out, and padded segment structure to even multiple of 4 bytes.
19760  *
19761  * Revision 1.82  1994/11/21  11:43:36  mike
19762  * smaller segment and vertex buffers.
19763  *
19764  * Revision 1.81  1994/11/17  11:39:35  matt
19765  * Ripped out code to load old mines
19766  *
19767  * Revision 1.80  1994/10/30  14:12:05  mike
19768  * rip out local segments stuff.
19769  *
19770  * Revision 1.79  1994/10/27  11:33:58  mike
19771  * lower number of segments by 100, saving 116K.
19772  *
19773  * Revision 1.78  1994/08/25  21:54:50  mike
19774  * Add macro IS_CHILD to make checking for the presence of a child centralized.
19775  *
19776  * Revision 1.77  1994/08/11  18:58:16  mike
19777  * Add prototype for Side_to_verts_int.
19778  *
19779  * Revision 1.76  1994/08/01  11:04:13  yuan
19780  * New materialization centers.
19781  *
19782  * Revision 1.75  1994/07/25  00:04:19  matt
19783  * Various changes to accomodate new 3d, which no longer takes point numbers
19784  * as parms, and now only takes pointers to points.
19785  *
19786  * Revision 1.74  1994/07/21  19:01:30  mike
19787  * new lsegment structure.
19788  *
19789  * Revision 1.73  1994/06/08  14:30:48  matt
19790  * Added static_light field to segment structure, and padded side struct
19791  * to be longword aligned.
19792  *
19793  * Revision 1.72  1994/05/19  23:25:17  mike
19794  * Change MINE_VERSION to 15, DEFAULT_LIGHTING to 0
19795  *
19796  * Revision 1.71  1994/05/12  14:45:54  mike
19797  * New segment data structure (!!), group, special, object, value = short.
19798  *
19799  * Revision 1.70  1994/05/03  11:06:46  mike
19800  * Remove constants VMAG and UMAG which are editor specific..
19801  *
19802  * Revision 1.69  1994/04/18  10:40:28  yuan
19803  * Increased segment limit to 1000
19804  * (From 500)
19805
19806 ------------------------------------------------------------------------
19807 main/segpoint.h:
19808
19809  * Revision 1.1  1995/05/16  16:02:38  allender
19810  * Initial revision
19811  *
19812  * Revision 2.0  1995/02/27  11:26:54  john
19813  * New version 2.0, which has no anonymous unions, builds with
19814  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19815  *
19816  * Revision 1.2  1994/02/16  17:14:40  matt
19817  * Added include of 3d.h
19818  *
19819  * Revision 1.1  1993/12/06  09:51:37  matt
19820  * Initial revision
19821
19822 ------------------------------------------------------------------------
19823 main/slew.c:
19824
19825  * Revision 1.1  1995/05/16  15:30:57  allender
19826  * Initial revision
19827  *
19828  * Revision 2.0  1995/02/27  11:29:32  john
19829  * New version 2.0, which has no anonymous unions, builds with
19830  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19831  *
19832  * Revision 1.34  1995/02/22  14:23:28  allender
19833  * remove anonymous unions from object structure
19834  *
19835  * Revision 1.33  1995/02/22  13:24:26  john
19836  * Removed the vecmat anonymous unions.
19837  *
19838  * Revision 1.32  1994/09/10  15:46:42  john
19839  * First version of new keyboard configuration.
19840  *
19841  * Revision 1.31  1994/08/31  18:29:58  matt
19842  * Made slew work with new key system
19843  *
19844  * Revision 1.30  1994/08/31  14:10:48  john
19845  * Made slew go faster.
19846  *
19847  * Revision 1.29  1994/08/29  19:16:38  matt
19848  * Made slew object not have physics movement type, so slew objects don't
19849  * get bumped.
19850  *
19851  * Revision 1.28  1994/08/24  18:59:59  john
19852  * Changed key_down_time to return fixed seconds instead of
19853  * milliseconds.
19854  *
19855  * Revision 1.27  1994/07/01  11:33:05  john
19856  * Fixed bug with looking for stick even if one not present.
19857  *
19858  * Revision 1.26  1994/05/20  11:56:33  matt
19859  * Cleaned up find_vector_intersection() interface
19860  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
19861  *
19862  * Revision 1.25  1994/05/19  12:08:41  matt
19863  * Use new vecmat macros and globals
19864  *
19865  * Revision 1.24  1994/05/14  17:16:18  matt
19866  * Got rid of externs in source (non-header) files
19867  *
19868  * Revision 1.23  1994/05/03  12:26:38  matt
19869  * Removed use of physics_info var rotvel, which wasn't used for rotational
19870  * velocity at all.
19871  *
19872  * Revision 1.22  1994/02/17  11:32:34  matt
19873  * Changes in object system
19874  *
19875  * Revision 1.21  1994/01/18  14:03:53  john
19876  * made joy_get_pos use the new ints instead of
19877  * shorts.
19878  *
19879  * Revision 1.20  1994/01/10  17:11:35  mike
19880  * Add prototype for check_object_seg
19881  *
19882  * Revision 1.19  1994/01/05  10:53:38  john
19883  * New object code by John.
19884  *
19885  * Revision 1.18  1993/12/22  15:32:50  john
19886  * took out previos code that attempted to make
19887  * modifiers cancel keydowntime.
19888  *
19889  * Revision 1.17  1993/12/22  11:41:56  john
19890  * Made so that keydowntime recognizes editor special case!
19891  *
19892  * Revision 1.16  1993/12/14  18:13:52  matt
19893  * Made slew work in editor even when game isn't in slew mode
19894  *
19895  * Revision 1.15  1993/12/07  23:53:39  matt
19896  * Made slew work in editor even when game isn't in slew mode
19897  *
19898  * Revision 1.14  1993/12/05  22:47:49  matt
19899  * Reworked include files in an attempt to cut down on build times
19900  *
19901  * Revision 1.13  1993/12/01  11:44:14  matt
19902  * Chagned Frfract to FrameTime
19903  *
19904  * Revision 1.12  1993/11/08  16:21:42  john
19905  * made stop_slew or whatever return an int
19906  *
19907  * Revision 1.11  1993/11/01  13:59:49  john
19908  * more slew experiments.
19909
19910 ------------------------------------------------------------------------
19911 main/slew.h:
19912
19913  * Revision 1.1  1995/05/16  16:03:09  allender
19914  * Initial revision
19915  *
19916  * Revision 2.0  1995/02/27  11:33:05  john
19917  * New version 2.0, which has no anonymous unions, builds with
19918  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19919  *
19920  * Revision 1.5  1994/12/15  16:43:58  matt
19921  * Made slew functions compile out for release versions
19922  *
19923  * Revision 1.4  1994/02/17  11:32:41  matt
19924  * Changes in object system
19925  *
19926  * Revision 1.3  1994/01/05  10:53:42  john
19927  * New object code by John.
19928  *
19929  * Revision 1.2  1993/12/05  22:48:57  matt
19930  * Reworked include files in an attempt to cut down on build times
19931  *
19932  * Revision 1.1  1993/12/05  20:20:16  matt
19933  * Initial revision
19934
19935 ------------------------------------------------------------------------
19936 main/songs.c:
19937
19938  * Revision 1.5  1995/11/03  12:52:59  allender
19939  * shareware changes
19940  *
19941  * Revision 1.4  1995/10/18  01:51:33  allender
19942  * fixed up stuff for redbook
19943  *
19944  * Revision 1.3  1995/10/17  13:13:44  allender
19945  * dont' add resource value to songs to play -- now done in digi
19946  * code
19947  *
19948  * Revision 1.2  1995/07/17  08:50:35  allender
19949  * make work with new music system
19950  *
19951  * Revision 1.1  1995/05/16  15:31:05  allender
19952  * Initial revision
19953  *
19954  * Revision 2.1  1995/05/02  16:15:21  john
19955  * Took out printf.
19956  *
19957  * Revision 2.0  1995/02/27  11:27:13  john
19958  * New version 2.0, which has no anonymous unions, builds with
19959  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19960  *
19961  * Revision 1.2  1995/02/11  12:42:12  john
19962  * Added new song method, with FM bank switching..
19963  *
19964  * Revision 1.1  1995/02/11  10:20:33  john
19965  * Initial revision
19966
19967 ------------------------------------------------------------------------
19968 main/songs.h:
19969
19970  * Revision 2.0  1995/02/27  11:30:52  john
19971  * New version 2.0, which has no anonymous unions, builds with
19972  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19973  *
19974  * Revision 1.6  1995/02/11  22:21:44  adam
19975  * *** empty log message ***
19976  *
19977  * Revision 1.5  1995/02/11  19:10:49  adam
19978  * *** empty log message ***
19979  *
19980  * Revision 1.4  1995/02/11  18:34:40  adam
19981  * *** empty log message ***
19982  *
19983  * Revision 1.3  1995/02/11  18:04:51  adam
19984  * upped songs
19985  *
19986  * Revision 1.2  1995/02/11  12:42:12  john
19987  * Added new song method, with FM bank switching..
19988  *
19989  * Revision 1.1  1995/02/11  10:20:18  john
19990  * Initial revision
19991
19992 ------------------------------------------------------------------------
19993 main/sounds.h:
19994
19995  * Revision 1.1  1995/05/16  16:03:32  allender
19996  * Initial revision
19997  *
19998  * Revision 2.0  1995/02/27  11:27:32  john
19999  * New version 2.0, which has no anonymous unions, builds with
20000  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20001  *
20002  * Revision 1.41  1995/02/03  17:08:28  john
20003  * Changed sound stuff to allow low memory usage.
20004  * Also, changed so that Sounds isn't an array of digi_sounds, it
20005  * is a ubyte pointing into GameSounds, this way the digi.c code that
20006  * locks sounds won't accidentally unlock a sound that is already playing, but
20007  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
20008  *
20009  * Revision 1.40  1995/01/30  21:45:17  adam
20010  * added weapon change sounds
20011  *
20012  * Revision 1.39  1995/01/30  21:11:57  mike
20013  * Use new weapon selection sounds, different for primary and secondary.
20014  *
20015  * Revision 1.38  1995/01/26  17:02:58  mike
20016  * make fusion cannon have more chrome, make fusion, mega rock you!
20017  *
20018  * Revision 1.37  1995/01/18  19:46:15  matt
20019  * Added sound for invulnerability wearing off, and voice message for cheating
20020  *
20021  * Revision 1.36  1995/01/18  19:05:04  john
20022  * Increased MAX_SOUNDS.
20023  *
20024  * Revision 1.35  1994/12/14  16:57:08  adam
20025  * *** empty log message ***
20026  *
20027  * Revision 1.34  1994/12/08  21:31:40  adam
20028  * *** empty log message ***
20029  *
20030  * Revision 1.33  1994/12/08  12:33:01  mike
20031  * make boss dying more interesting.
20032  *
20033  * Revision 1.32  1994/12/04  21:39:40  matt
20034  * Added sound constants for endlevel explosions
20035  *
20036  * Revision 1.31  1994/11/30  14:02:58  mike
20037  * see/claw/attack sounds.
20038  *
20039  * Revision 1.30  1994/11/29  20:43:54  matt
20040  * Deleted a bunch of unused constants
20041  *
20042  * Revision 1.29  1994/11/29  15:48:11  matt
20043  * Cleaned up, & added new sounds
20044  *
20045  * Revision 1.28  1994/11/29  14:35:36  adam
20046  * moved lava noise index
20047  *
20048  * Revision 1.27  1994/11/29  13:23:30  matt
20049  * Cleaned up sound constants
20050  *
20051  * Revision 1.26  1994/11/29  13:01:04  rob
20052  * ADded badass explosion define.
20053  *
20054  * Revision 1.25  1994/11/29  11:34:23  rob
20055  * Added new HUD sounds.
20056  *
20057  * Revision 1.24  1994/11/15  16:52:01  mike
20058  * hiss sound placeholder.
20059  *
20060  * Revision 1.23  1994/10/25  16:21:45  adam
20061  * changed homing sound
20062  *
20063  * Revision 1.22  1994/10/23  00:27:34  matt
20064  * Made exploding wall do one long sound, instead of lots of small ones
20065  *
20066  * Revision 1.21  1994/10/22  14:12:35  mike
20067  * Add sound for missile tracking player.
20068  *
20069  * Revision 1.20  1994/10/11  12:25:21  matt
20070  * Added "hot rocks" that create badass explosion when hit by weapons
20071  *
20072  * Revision 1.19  1994/10/10  20:57:50  matt
20073  * Added sound for exploding wall (hostage door)
20074  *
20075  * Revision 1.18  1994/10/04  15:33:31  john
20076  * Took out the old PLAY_SOUND??? code and replaced it
20077  * with direct calls into digi_link_??? so that all sounds
20078  * can be made 3d.
20079  *
20080  * Revision 1.17  1994/09/29  21:13:41  john
20081  * Added Master volumes for digi and midi. Also took out panning,
20082  * because it doesn't work with MasterVolume stuff.
20083  *
20084  * Revision 1.16  1994/09/29  00:42:29  matt
20085  * Made hitting a locked door play a sound
20086  *
20087  * Revision 1.15  1994/09/20  19:14:34  john
20088  * Massaged the sound system; used a better formula for determining
20089  * which l/r balance, also, put in Mike's stuff that searches for a connection
20090  * between the 2 sounds' segments, stopping for closed doors, etc.
20091  *
20092  * Revision 1.14  1994/07/06  15:23:59  john
20093  * Revamped hostage sound.
20094  *
20095  * Revision 1.13  1994/06/21  19:13:27  john
20096  * *** empty log message ***
20097  *
20098  * Revision 1.12  1994/06/21  12:09:54  adam
20099  * *** empty log message ***
20100  *
20101  * Revision 1.11  1994/06/21  12:03:15  john
20102  * Added more sounds.
20103  *
20104  * Revision 1.10  1994/06/20  22:01:54  matt
20105  * Added prototype for Play3D()
20106  *
20107  * Revision 1.9  1994/06/20  21:06:06  yuan
20108  * Fixed up menus.
20109  *
20110  * Revision 1.8  1994/06/17  12:21:54  mike
20111  * Hook for robot hits player.
20112  *
20113  * Revision 1.7  1994/06/15  19:01:35  john
20114  * Added the capability to make 3d sounds play just once for the
20115  * laser hit wall effects.
20116  *
20117  * Revision 1.6  1994/06/08  11:43:03  john
20118  * Enable 3D sound.
20119  *
20120  * Revision 1.5  1994/06/07  18:21:20  john
20121  * Start changing sound to the new 3D system.
20122  *
20123  * Revision 1.4  1994/05/16  16:17:41  john
20124  * Bunch of stuff on my Inferno Task list May16-23
20125  *
20126  * Revision 1.3  1994/05/09  21:11:38  john
20127  * Sound changes; pass index instead of pointer to digi routines.
20128  * Made laser sound cut off the last laser sound.
20129  *
20130  * Revision 1.2  1994/04/27  11:47:46  john
20131  * First version.
20132  *
20133  * Revision 1.1  1994/04/26  10:44:36  john
20134  * Initial revision
20135
20136 ------------------------------------------------------------------------
20137 main/state.c:
20138
20139  * Revision 1.7  1995/10/31  10:18:25  allender
20140  * shareware stuff
20141  *
20142  * Revision 1.6  1995/10/21  22:25:45  allender
20143  * put in creator code and file type for saved games.
20144  * put save games in players folder
20145  *
20146  * Revision 1.5  1995/10/20  00:51:21  allender
20147  * close boxes and proper mouse support on save game stuff
20148  *
20149  * Revision 1.4  1995/10/17  13:19:02  allender
20150  * close boxes for load and save game
20151  *
20152  * Revision 1.3  1995/09/18  08:09:15  allender
20153  * made larger thumbnail and handled NULL gr_bitmap pointers
20154  * better
20155  *
20156  * Revision 1.2  1995/08/14  14:36:12  allender
20157  * change transparency to 0
20158  *
20159  * Revision 1.1  1995/05/16  15:31:12  allender
20160  * Initial revision
20161  *
20162  * Revision 2.14  1995/05/26  16:16:10  john
20163  * Split SATURN into define's for requiring cd, using cd, etc.
20164  * Also started adding all the Rockwell stuff.
20165  *
20166  * Revision 2.13  1995/04/06  15:12:20  john
20167  * Fixed bug with lunacy not working.
20168  *
20169  * Revision 2.12  1995/04/04  13:33:05  john
20170  * Removed multiplayer save.
20171  *
20172  * Revision 2.11  1995/03/31  13:42:10  john
20173  * Made saved games from the bogus saturn version read in
20174  * correctly.
20175  *
20176  * Revision 2.10  1995/03/31  12:45:28  john
20177  * Fixed bug with previous.
20178  *
20179  * Revision 2.9  1995/03/31  12:24:40  john
20180  * I had changed alt_textures from a pointer to a byte. This hosed old
20181  * saved games, so I restored it to an int.
20182  *
20183  * Revision 2.8  1995/03/28  11:22:47  john
20184  * Added cheats to save file. Changed lunacy text.
20185  *
20186  * Revision 2.7  1995/03/27  21:41:03  john
20187  * Added code to verify that the proper multi save file
20188  * is used when restoring a network game.
20189  *
20190  * Revision 2.6  1995/03/27  18:04:18  john
20191  * Made multi save/restore require the -multisave command line arg.
20192  *
20193  * Revision 2.5  1995/03/27  17:01:52  john
20194  * Made deafult choice work better.
20195  *
20196  * Revision 2.4  1995/03/27  15:49:44  john
20197  * Added slots to save games.
20198  *
20199  * Revision 2.3  1995/03/27  12:59:19  john
20200  * Initial version of multiplayer save games.
20201  *
20202  * Revision 2.2  1995/03/24  13:11:35  john
20203  * Added save game during briefing screens.
20204  *
20205  * Revision 2.1  1995/03/21  14:38:36  john
20206  * Ifdef'd out the NETWORK code.
20207  *
20208  * Revision 2.0  1995/02/27  11:27:00  john
20209  * New version 2.0, which has no anonymous unions, builds with
20210  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20211  *
20212  * Revision 1.43  1995/02/22  14:32:41  allender
20213  * remove anonymous unions from object structure
20214  *
20215  * Revision 1.42  1995/02/13  20:34:33  john
20216  * Lintized
20217  *
20218  * Revision 1.41  1995/02/13  10:37:30  john
20219  * Saved Buggin' cheat mode to save file.
20220  *
20221  * Revision 1.40  1995/02/09  10:24:25  john
20222  * *** empty log message ***
20223  *
20224  * Revision 1.39  1995/02/09  10:22:20  john
20225  * Fixed bug with callsign getting trashed if you copy somebody else
20226  * 's save game file into your directory.
20227  *
20228  * Revision 1.38  1995/02/08  21:01:27  john
20229  * Closed state file around the code that shows briefing screens so that the
20230  * code works on machines with clean boot with only 5 file handles.
20231  *
20232  * Revision 1.37  1995/02/07  14:02:33  john
20233  * Added code to verify game restore.
20234  *
20235  * Revision 1.36  1995/02/07  11:07:43  john
20236  * Added hooks for confirm on game state restore.
20237  *
20238  * Revision 1.35  1995/02/03  11:27:36  john
20239  * Made inbetween level save's thumbnail's have correct aspect.
20240  *
20241  * Revision 1.34  1995/02/03  10:58:43  john
20242  * Added code to save shareware style saved games into new format...
20243  * Also, made new player file format not have the saved game array in it.
20244  *
20245  * Revision 1.33  1995/02/02  19:40:52  john
20246  * Added 10 save game slots.
20247  *
20248  * Revision 1.32  1995/02/02  12:23:20  john
20249  * Made between level saves have picture.
20250  *
20251  * Revision 1.31  1995/01/31  11:21:43  john
20252  * Added code for fixed with menus.
20253  *
20254  * Revision 1.30  1995/01/29  21:37:29  mike
20255  * initialize variables on game load so you don't drain your energy when you fire.
20256  *
20257  * Revision 1.29  1995/01/29  13:47:58  mike
20258  * Restore some variables on game load (in game).
20259  *
20260  * Revision 1.28  1995/01/26  10:46:57  john
20261  * Fixed bug with state names getting hosed.
20262  *
20263  * Revision 1.27  1995/01/26  09:51:23  john
20264  * Fixed bug with game descriptions getting hosed.
20265  *
20266  * Revision 1.26  1995/01/25  16:35:49  john
20267  * Made so that when you hit enter during
20268  * game save, -empty- goes away.
20269  *
20270  * Revision 1.25  1995/01/25  15:01:39  john
20271  * Upped the save file version.
20272  *
20273  * Revision 1.24  1995/01/24  20:35:35  john
20274  * *** empty log message ***
20275  *
20276  * Revision 1.23  1995/01/24  20:34:24  john
20277  * Fixed bug with player stats not being set right for in
20278  * between level saves.
20279  *
20280  * Revision 1.22  1995/01/23  10:39:03  john
20281  * Added mission stuff to game saves.
20282  *
20283  * Revision 1.21  1995/01/22  16:07:12  mike
20284  * localization.
20285  *
20286  * Revision 1.20  1995/01/22  15:58:32  mike
20287  * localization
20288  *
20289  * Revision 1.19  1995/01/20  11:04:40  john
20290  * Upped state save version.
20291  *
20292  * Revision 1.18  1995/01/19  17:00:44  john
20293  * Made save game work between levels.
20294  *
20295  * Revision 1.17  1995/01/17  14:27:33  john
20296  * *** empty log message ***
20297  *
20298  * Revision 1.16  1995/01/17  13:36:37  john
20299  * Moved pig loading into StartNewLevelSub.
20300  *
20301  * Revision 1.15  1995/01/16  16:53:38  john
20302  * Added code to save cheat state during save game.
20303  *
20304  * Revision 1.14  1995/01/15  16:55:22  john
20305  * Improved mine texture parsing.
20306  *
20307  * Revision 1.13  1995/01/12  10:45:15  john
20308  * Added difficulty level to save/restore game.
20309  *
20310  * Revision 1.12  1995/01/05  15:46:55  john
20311  * Made weapons not rearm when starting a saved game.
20312  *
20313  * Revision 1.11  1995/01/05  11:51:45  john
20314  * Added better Abort game menu.
20315  * Made save state return success or nopt.
20316  *
20317  * Revision 1.10  1995/01/05  11:34:51  john
20318  * Took out endlevel save stuff for registered.
20319  *
20320  * Revision 1.9  1995/01/04  18:19:52  john
20321  * Added automap visited list saving.
20322  *
20323  * Revision 1.8  1995/01/04  17:29:56  john
20324  * Made save/restore ALT+F?. Also made them not work
20325  * in network mode, and if recording a demo, will
20326  * quit recording.
20327  *
20328  * Revision 1.7  1995/01/04  13:18:31  john
20329  * Added cool 6 game save.
20330  *
20331  * Revision 1.6  1995/01/03  20:38:46  john
20332  * Saved morph objects.
20333  *
20334  * Revision 1.5  1995/01/03  20:19:29  john
20335  * Pretty good working version of game save.
20336  *
20337  * Revision 1.4  1995/01/03  14:18:18  matt
20338  * ifdefs added to compile code add.  Added by Mike, I think.
20339  *
20340  * Revision 1.3  1994/12/29  18:40:19  john
20341  * Initial version.
20342  *
20343  * Revision 1.2  1994/12/29  15:26:40  john
20344  * Put in hooks for saving/restoring game state.
20345  *
20346  * Revision 1.1  1994/12/29  15:16:02  john
20347  * Initial revision
20348
20349 ------------------------------------------------------------------------
20350 main/state.h:
20351
20352  * Revision 1.1  1995/05/16  16:03:40  allender
20353  * Initial revision
20354  *
20355  * Revision 2.1  1995/03/27  21:40:35  john
20356  * Added code to verify that the proper multi save file
20357  * is used when restoring a network game.
20358  *
20359  * Revision 2.0  1995/02/27  11:28:44  john
20360  * New version 2.0, which has no anonymous unions, builds with
20361  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20362  *
20363  * Revision 1.6  1995/02/07  10:54:05  john
20364  * *** empty log message ***
20365  *
20366  * Revision 1.5  1995/02/03  10:58:12  john
20367  * Added code to save shareware style saved games into new format...
20368  * Also, made new player file format not have the saved game array in it.
20369  *
20370  * Revision 1.4  1995/01/19  17:00:51  john
20371  * Made save game work between levels.
20372  *
20373  * Revision 1.3  1995/01/05  11:51:44  john
20374  * Added better Abort game menu.
20375  * Made save state return success or nopt.
20376  *
20377  * Revision 1.2  1994/12/29  15:26:39  john
20378  * Put in hooks for saving/restoring game state.
20379  *
20380  * Revision 1.1  1994/12/29  15:15:47  john
20381  * Initial revision
20382
20383 ------------------------------------------------------------------------
20384 main/switch.c:
20385
20386  * Revision 1.2  1995/10/31  10:18:10  allender
20387  * shareware stuff
20388  *
20389  * Revision 1.1  1995/05/16  15:31:21  allender
20390  * Initial revision
20391  *
20392  * Revision 2.1  1995/03/21  14:39:08  john
20393  * Ifdef'd out the NETWORK code.
20394  *
20395  * Revision 2.0  1995/02/27  11:28:41  john
20396  * New version 2.0, which has no anonymous unions, builds with
20397  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20398  *
20399  * Revision 1.51  1995/01/31  15:26:23  rob
20400  * Don't trigger matcens in anarchy games.
20401  *
20402  * Revision 1.50  1995/01/26  12:18:26  rob
20403  * Changed network_do_frame call.
20404  *
20405  * Revision 1.49  1995/01/18  18:50:35  allender
20406  * don't process triggers if in demo playback mode.  Fix for Rob to only do
20407  * multi_send_endlevel_start if in multi player game
20408  *
20409  * Revision 1.48  1995/01/13  11:59:40  rob
20410  * Added palette fade after secret level exit.
20411  *
20412  * Revision 1.47  1995/01/12  17:00:41  rob
20413  * Fixed a problem with switches and secret levels.
20414  *
20415  * Revision 1.46  1995/01/12  13:35:11  rob
20416  * Added data flush after secret level exit.
20417  *
20418  * Revision 1.45  1995/01/03  15:25:11  rob
20419  * Fixed a compile error.
20420  *
20421  * Revision 1.44  1995/01/03  15:12:02  rob
20422  * Adding multiplayer switching.
20423  *
20424  * Revision 1.43  1994/11/29  16:52:12  yuan
20425  * Removed some obsolete commented out code.
20426  *
20427  * Revision 1.42  1994/11/27  23:15:07  matt
20428  * Made changes for new mprintf calling convention
20429  *
20430  * Revision 1.41  1994/11/22  18:36:45  rob
20431  * Added new hook for endlevel for secret doors.
20432  *
20433  * Revision 1.40  1994/11/21  17:29:43  matt
20434  * Cleaned up sequencing & game saving for secret levels
20435  *
20436  * Revision 1.39  1994/11/19  15:20:32  mike
20437  * rip out unused code and data
20438  *
20439  * Revision 1.38  1994/10/25  16:09:52  yuan
20440  * Fixed byte bug.
20441  *
20442  * Revision 1.37  1994/10/24  16:05:28  matt
20443  * Removed clear of fuelcen_control_center_destroyed
20444  *
20445  * Revision 1.36  1994/10/08  14:21:13  matt
20446  * Added include
20447  *
20448  * Revision 1.35  1994/10/07  12:34:09  matt
20449  * Added code fot going to/from secret levels
20450  *
20451  * Revision 1.34  1994/10/05  15:16:10  rob
20452  * Used to be that only player #0 could trigger switches, now only the
20453  * LOCAL player can do it (and he's expected to tell the other guy with
20454  * a com message if its important!)
20455  *
20456  * Revision 1.33  1994/09/24  17:42:03  mike
20457  * Kill temporary version of function written by Yuan, replaced by MK.
20458  *
20459  * Revision 1.32  1994/09/24  17:10:00  yuan
20460  * Added Matcen triggers.
20461  *
20462  * Revision 1.31  1994/09/23  18:02:21  yuan
20463  * Completed wall checking.
20464  *
20465  * Revision 1.30  1994/08/19  20:09:41  matt
20466  * Added end-of-level cut scene with external scene
20467  *
20468  * Revision 1.29  1994/08/18  10:47:36  john
20469  * Cleaned up game sequencing and player death stuff
20470  * in preparation for making the player explode into
20471  * pieces when dead.
20472  *
20473  * Revision 1.28  1994/08/12  22:42:11  john
20474  * Took away Player_stats; added Players array.
20475  *
20476  * Revision 1.27  1994/07/02  13:50:44  matt
20477  * Cleaned up includes
20478  *
20479  * Revision 1.26  1994/06/27  16:32:25  yuan
20480  * Commented out incomplete code...
20481  *
20482  * Revision 1.25  1994/06/27  15:53:27  john
20483  * #define'd out the newdemo stuff
20484  *
20485  *
20486  * Revision 1.24  1994/06/27  15:10:04  yuan
20487  * Might mess up triggers.
20488  *
20489  * Revision 1.23  1994/06/24  17:01:43  john
20490  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
20491  * took it out of game.c and into gameseq.c
20492  *
20493  * Revision 1.22  1994/06/16  16:20:15  john
20494  * Made player start out in physics mode; Neatend up game loop a bit.
20495  *
20496  * Revision 1.21  1994/06/15  14:57:22  john
20497  * Added triggers to demo recording.
20498  *
20499  * Revision 1.20  1994/06/10  17:44:25  mike
20500  * Assert on result of find_connect_side == -1
20501  *
20502  * Revision 1.19  1994/06/08  10:20:15  yuan
20503  * Removed unused testing.
20504  *
20505  *
20506  * Revision 1.18  1994/06/07  13:10:48  yuan
20507  * Fixed bug in check trigger... Still working on other bugs.
20508  *
20509  * Revision 1.17  1994/05/30  20:22:04  yuan
20510  * New triggers.
20511  *
20512  * Revision 1.16  1994/05/27  10:32:46  yuan
20513  * New dialog boxes (Walls and Triggers) added.
20514  *
20515  *
20516  * Revision 1.15  1994/05/25  18:06:46  yuan
20517  * Making new dialog box controls for walls and triggers.
20518  *
20519  * Revision 1.14  1994/05/10  19:05:32  yuan
20520  * Made end of level flag rather than menu popping up
20521  *
20522  * Revision 1.13  1994/04/29  15:05:25  yuan
20523  * Added menu pop-up at exit trigger.
20524
20525 ------------------------------------------------------------------------
20526 main/switch.h:
20527
20528  * Revision 1.1  1995/05/16  16:03:48  allender
20529  * Initial revision
20530  *
20531  * Revision 2.0  1995/02/27  11:26:52  john
20532  * New version 2.0, which has no anonymous unions, builds with
20533  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20534  *
20535  * Revision 1.19  1995/01/12  17:00:36  rob
20536  * Fixed a problem with switches and secret levels.
20537  *
20538  * Revision 1.18  1994/10/06  21:24:40  matt
20539  * Added switch for exit to secret level
20540  *
20541  * Revision 1.17  1994/09/29  17:05:52  matt
20542  * Removed unused constant
20543  *
20544  * Revision 1.16  1994/09/24  17:10:07  yuan
20545  * Added Matcen triggers.
20546  *
20547  * Revision 1.15  1994/08/15  18:06:39  yuan
20548  * Added external trigger.
20549  *
20550  * Revision 1.14  1994/06/16  16:20:52  john
20551  * Made player start out in physics mode; Neatend up game loop a bit.
20552  *
20553  * Revision 1.13  1994/05/30  20:22:08  yuan
20554  * New triggers.
20555  *
20556  * Revision 1.12  1994/05/27  10:32:44  yuan
20557  * New dialog boxes (Walls and Triggers) added.
20558  *
20559  *
20560  * Revision 1.11  1994/05/25  18:06:32  yuan
20561  * Making new dialog box controls for walls and triggers.
20562  *
20563  * Revision 1.10  1994/04/28  18:04:40  yuan
20564  * Gamesave added.
20565  * Trigger problem fixed (seg pointer is replaced by index now.)
20566  *
20567  * Revision 1.9  1994/04/26  11:19:01  yuan
20568  * Make it so a trigger can only be triggered every 5 seconds.
20569
20570 ------------------------------------------------------------------------
20571 main/terrain.c:
20572
20573  * Revision 1.1  1995/05/16  15:31:29  allender
20574  * Initial revision
20575  *
20576  * Revision 2.0  1995/02/27  11:31:27  john
20577  * New version 2.0, which has no anonymous unions, builds with
20578  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20579  *
20580  * Revision 1.12  1994/12/03  00:18:00  matt
20581  * Made endlevel sequence cut off early
20582  * Made exit model and bit explosion always plot last (after all terrain)
20583  *
20584  * Revision 1.11  1994/11/27  23:13:46  matt
20585  * Made changes for new mprintf calling convention
20586  *
20587  * Revision 1.10  1994/11/21  18:04:36  matt
20588  * Fixed alloc/free problem with height array
20589  *
20590  * Revision 1.9  1994/11/21  17:30:42  matt
20591  * Properly free light array
20592  *
20593  * Revision 1.8  1994/11/19  12:40:55  matt
20594  * Added system to read endlevel data from file, and to make it work
20595  * with any exit tunnel.
20596  *
20597  * Revision 1.7  1994/11/16  11:49:44  matt
20598  * Added code to rotate terrain to match mine
20599  *
20600  * Revision 1.6  1994/11/02  16:22:59  matt
20601  * Killed mprintf
20602  *
20603  * Revision 1.5  1994/10/30  20:09:19  matt
20604  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
20605  * go out; made more explosions on walls.
20606  *
20607  * Revision 1.4  1994/10/27  21:15:07  matt
20608  * Added better error handling
20609  *
20610  * Revision 1.3  1994/10/27  01:03:17  matt
20611  * Made terrain renderer use aribtary point in height array as origin
20612  *
20613  * Revision 1.2  1994/08/19  20:09:44  matt
20614  * Added end-of-level cut scene with external scene
20615  *
20616  * Revision 1.1  1994/08/17  20:20:49  matt
20617  * Initial revision
20618
20619 ------------------------------------------------------------------------
20620 main/terrain.h:
20621
20622  * Revision 1.1  1995/05/16  16:03:56  allender
20623  * Initial revision
20624  *
20625  * Revision 2.0  1995/02/27  11:32:53  john
20626  * New version 2.0, which has no anonymous unions, builds with
20627  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20628  *
20629  * Revision 1.3  1994/10/27  01:03:51  matt
20630  * Made terrain renderer use aribtary point in height array as origin
20631  *
20632  * Revision 1.2  1994/08/19  20:09:45  matt
20633  * Added end-of-level cut scene with external scene
20634  *
20635  * Revision 1.1  1994/08/17  20:33:36  matt
20636  * Initial revision
20637
20638 ------------------------------------------------------------------------
20639 main/texmerge.c:
20640
20641  * Revision 1.1  1995/05/16  15:31:36  allender
20642  * Initial revision
20643  *
20644  * Revision 2.0  1995/02/27  11:31:08  john
20645  * New version 2.0, which has no anonymous unions, builds with
20646  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20647  *
20648  * Revision 1.28  1995/01/14  19:16:56  john
20649  * First version of new bitmap paging code.
20650  *
20651  * Revision 1.27  1994/12/14  18:21:58  yuan
20652  * *** empty log message ***
20653  *
20654  * Revision 1.26  1994/12/13  09:50:08  john
20655  * Added Asserts to stop if wall looks like door.
20656  *
20657  * Revision 1.25  1994/12/07  00:35:24  mike
20658  * change how flat shading average color is computed for paste-ons.
20659  *
20660  * Revision 1.24  1994/11/19  15:20:29  mike
20661  * rip out unused code and data
20662  *
20663  * Revision 1.23  1994/11/12  16:38:51  mike
20664  * deal with avg_color in texture merging.
20665  *
20666  * Revision 1.22  1994/11/09  19:55:39  john
20667  * Added full rle support with texture rle caching.
20668  *
20669  * Revision 1.21  1994/10/20  15:21:16  john
20670  * Took out the texmerge caching.
20671  *
20672  * Revision 1.20  1994/10/10  19:00:57  john
20673  * Made caching info print every 1000 frames.
20674  *
20675  * Revision 1.19  1994/10/10  18:41:21  john
20676  * Printed out texture caching info.
20677  *
20678  * Revision 1.18  1994/08/11  18:59:02  mike
20679  * Use new assembler version of merge functions.
20680  *
20681  * Revision 1.17  1994/06/09  12:13:14  john
20682  * Changed selectors so that all bitmaps have a selector of
20683  * 0, but inside the texture mapper they get a selector set.
20684  *
20685  * Revision 1.16  1994/05/14  17:15:15  matt
20686  * Got rid of externs in source (non-header) files
20687  *
20688  * Revision 1.15  1994/05/09  17:21:09  john
20689  * Took out mprintf with cache hits/misses.
20690  *
20691  * Revision 1.14  1994/05/05  12:55:07  john
20692  * Made SuperTransparency work.
20693  *
20694  * Revision 1.13  1994/05/04  11:15:37  john
20695  * Added Super Transparency
20696  *
20697  * Revision 1.12  1994/04/28  23:36:04  john
20698  * Took out a debugging mprintf.
20699  *
20700  * Revision 1.11  1994/04/22  17:44:48  john
20701  * Made top 2 bits of paste-ons pick the
20702  * orientation of the bitmap.
20703  *
20704  * Revision 1.10  1994/03/31  12:05:51  matt
20705  * Cleaned up includes
20706  *
20707  * Revision 1.9  1994/03/15  16:31:52  yuan
20708  * Cleaned up bm-loading code.
20709  * (And structures)
20710  *
20711  * Revision 1.8  1994/01/24  13:15:19  john
20712  * Made caching work with pointers, not texture numbers,
20713  * that way, the animated textures cache.
20714  *
20715  * Revision 1.7  1994/01/21  16:38:10  john
20716  * Took out debug info.
20717  *
20718  * Revision 1.6  1994/01/21  16:28:43  john
20719  * added warning to print cache hit/miss.
20720  *
20721  * Revision 1.5  1994/01/21  16:22:30  john
20722  * Put in caching/
20723  *
20724  * Revision 1.4  1994/01/21  15:34:49  john
20725  * *** empty log message ***
20726  *
20727  * Revision 1.3  1994/01/21  15:33:08  john
20728  * *** empty log message ***
20729  *
20730  * Revision 1.2  1994/01/21  15:15:35  john
20731  * Created new module texmerge, that merges textures together and
20732  * caches the results.
20733  *
20734  * Revision 1.1  1994/01/21  14:55:29  john
20735  * Initial revision
20736
20737 ------------------------------------------------------------------------
20738 main/texmerge.h:
20739
20740  * Revision 1.1  1995/05/16  16:04:03  allender
20741  * Initial revision
20742  *
20743  * Revision 2.0  1995/02/27  11:28:05  john
20744  * New version 2.0, which has no anonymous unions, builds with
20745  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20746  *
20747  * Revision 1.4  1995/01/14  19:16:26  john
20748  * First version of new bitmap paging code.
20749  *
20750  * Revision 1.3  1994/01/21  15:23:26  john
20751  * made texmerge_close return void.
20752  *
20753  *
20754  * Revision 1.2  1994/01/21  15:16:01  john
20755  * Created new module texmerge, that merges textures together and
20756  * caches the results.
20757  *
20758  * Revision 1.1  1994/01/21  15:03:36  john
20759  * Initial revision
20760
20761 ------------------------------------------------------------------------
20762 main/text.c:
20763
20764  * Revision 1.1  1995/05/16  15:31:44  allender
20765  * Initial revision
20766  *
20767  * Revision 2.0  1995/02/27  11:33:09  john
20768  * New version 2.0, which has no anonymous unions, builds with
20769  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20770  *
20771  * Revision 1.11  1994/12/14  12:53:23  matt
20772  * Improved error handling
20773  *
20774  * Revision 1.10  1994/12/09  18:36:44  john
20775  * Added code to make text read from hogfile.
20776  *
20777  * Revision 1.9  1994/12/08  20:56:34  john
20778  * More cfile stuff.
20779  *
20780  * Revision 1.8  1994/12/08  17:20:06  yuan
20781  * Cfiling stuff.
20782  *
20783  * Revision 1.7  1994/12/05  15:10:36  allender
20784  * support encoded descent.tex file (descent.txb)
20785  *
20786  * Revision 1.6  1994/12/01  14:18:34  matt
20787  * Now support backslash chars in descent.tex file
20788  *
20789  * Revision 1.5  1994/10/27  00:13:10  john
20790  * Took out cfile.
20791  *
20792  * Revision 1.4  1994/07/11  15:33:49  matt
20793  * Put in command-line switch to load different text files
20794  *
20795  * Revision 1.3  1994/07/10  09:56:25  yuan
20796  * #include <stdio.h> added for FILE type.
20797  *
20798  * Revision 1.2  1994/07/09  22:48:14  matt
20799  * Added localizable text
20800  *
20801  * Revision 1.1  1994/07/09  21:30:46  matt
20802  * Initial revision
20803
20804 ------------------------------------------------------------------------
20805 main/text.h:
20806
20807  * Revision 1.3  1995/10/18  23:30:29  allender
20808  * fixed horrendous misspelling
20809  *
20810  * Revision 1.2  1995/10/18  23:27:33  allender
20811  * added new printscreen line to end of text string
20812  *
20813  * Revision 1.1  1995/05/16  16:04:11  allender
20814  * Initial revision
20815  *
20816  * Revision 2.2  1995/03/30  16:36:22  mike
20817  * text localization.
20818  *
20819  * Revision 2.1  1995/03/08  15:33:24  allender
20820  * *** empty log message ***
20821  *
20822  * Revision 2.0  1995/02/27  11:30:21  john
20823  * New version 2.0, which has no anonymous unions, builds with
20824  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20825  *
20826  * Revision 1.63  1995/02/11  14:59:42  rob
20827  * Added string for controlcen invul.
20828  *
20829  * Revision 1.62  1995/02/10  15:19:38  allender
20830  * added text for bad write on demo write
20831  *
20832  * Revision 1.61  1995/02/08  10:59:11  rob
20833  * Added string used in kill list view.
20834  *
20835  * Revision 1.60  1995/02/07  20:38:40  rob
20836  * Added new localized strings for new multi options.
20837  *
20838  * Revision 1.59  1995/02/02  15:29:17  matt
20839  * Changed & localized secret level text
20840  *
20841  * Revision 1.58  1995/02/02  12:24:14  adam
20842  * added automap string
20843  *
20844  * Revision 1.57  1995/02/01  18:06:50  rob
20845  * Localize default macros, other stuff frm network.c
20846  *
20847  * Revision 1.56  1995/01/30  15:29:53  rob
20848  * Localizing.
20849  *
20850  * Revision 1.55  1995/01/30  13:54:25  allender
20851  * added mission/demo text
20852  *
20853  * Revision 1.54  1995/01/24  22:03:22  mike
20854  * text localization.
20855  *
20856  * Revision 1.53  1995/01/23  13:05:59  adam
20857  * added save/load game text
20858  *
20859  * Revision 1.52  1995/01/22  15:58:42  mike
20860  * localization
20861  *
20862  * Revision 1.51  1994/12/29  12:08:47  rob
20863  * removed new text strings.
20864  *
20865  * Revision 1.50  1994/12/28  16:47:14  rob
20866  * Added new com setup strings.
20867  *
20868  * Revision 1.49  1994/12/15  23:24:22  rob
20869  * Added string for rejoin failure.
20870  *
20871  * Revision 1.48  1994/12/15  10:16:06  adam
20872  * added lame trademark notice
20873  *
20874  * Revision 1.47  1994/12/14  18:21:23  yuan
20875  * *** empty log message ***
20876  *
20877  * Revision 1.46  1994/12/14  16:57:01  matt
20878  * Added text for hat2
20879  *
20880  * Revision 1.45  1994/12/14  08:50:12  allender
20881  * *** empty log message ***
20882  *
20883  * Revision 1.44  1994/12/13  19:43:29  rob
20884  * Added string.
20885  *
20886  * Revision 1.43  1994/12/13  12:54:45  mike
20887  * add strings for hostages on board when you die.
20888  *
20889  * Revision 1.42  1994/12/13  10:04:09  allender
20890  * *** empty log message ***
20891  *
20892  * Revision 1.41  1994/12/12  22:20:23  rob
20893  * Added two new localized strings for modem.c
20894  *
20895  * Revision 1.40  1994/12/09  19:46:26  yuan
20896  * Localized the sucker.
20897  *
20898  * Revision 1.39  1994/12/09  14:35:30  yuan
20899  * Added localization string for Rob.
20900  *
20901  * Revision 1.38  1994/12/09  14:08:16  mike
20902  * text message for remaining ships at end bonus.
20903  *
20904  * Revision 1.37  1994/12/09  00:28:26  rob
20905  * Added "died in mine" string.
20906  *
20907  * Revision 1.36  1994/12/08  14:30:31  yuan
20908  * Fixed off by one problem.
20909  *
20910  * Revision 1.35  1994/12/08  11:18:56  allender
20911  * demo text string
20912  *
20913  * Revision 1.33  1994/12/07  19:14:33  matt
20914  * Cleaned up command-line options and command-line help message
20915  *
20916  * Revision 1.32  1994/12/07  17:20:34  yuan
20917  * Localization
20918  *
20919  * Revision 1.31  1994/12/07  16:49:15  yuan
20920  * More localization
20921  *
20922  * Revision 1.30  1994/12/07  14:52:11  yuan
20923  * Localization 492
20924  *
20925  * Revision 1.29  1994/12/07  11:28:12  matt
20926  * Did a little localization support
20927  *
20928  * Revision 1.28  1994/12/06  18:29:31  mike
20929  * Add text for cheat: Start at any level.
20930  *
20931  * Revision 1.27  1994/12/06  16:30:39  yuan
20932  * Localization
20933  *
20934  * Revision 1.26  1994/12/06  15:14:55  yuan
20935  * Fixed number of textstrings.
20936  *
20937  * Revision 1.25  1994/12/06  15:13:52  yuan
20938  * Localization
20939  *
20940  * Revision 1.24  1994/12/06  13:46:24  adam
20941  * *** empty log message ***
20942  *
20943  * Revision 1.23  1994/12/05  23:17:28  yuan
20944  * Localization bugs fixed.
20945  *
20946  * Revision 1.22  1994/12/05  23:05:41  yuan
20947  * Localization 425
20948  *
20949  * Revision 1.21  1994/12/05  22:42:27  rob
20950  * Added new connect status strings
20951  *
20952  * Revision 1.20  1994/12/05  16:47:30  rob
20953  * Added a new string.
20954  *
20955  *
20956  * Revision 1.19  1994/12/03  22:35:17  yuan
20957  * Localization 412
20958  *
20959  * Revision 1.18  1994/12/03  17:53:42  yuan
20960  * 382.
20961
20962 ------------------------------------------------------------------------
20963 main/textures.h:
20964
20965  * Revision 1.1  1995/05/16  16:04:20  allender
20966  * Initial revision
20967  *
20968  * Revision 2.0  1995/02/27  11:31:54  john
20969  * New version 2.0, which has no anonymous unions, builds with
20970  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20971  *
20972  * Revision 1.3  1994/03/15  16:32:56  yuan
20973  * Cleaned up bm-loading code.
20974  * (Fixed structures too)
20975  *
20976  * Revision 1.2  1993/12/05  22:49:53  matt
20977  * Reworked include files in an attempt to cut down on build times
20978  *
20979  * Revision 1.1  1993/12/05  20:16:26  matt
20980  * Initial revision
20981
20982 ------------------------------------------------------------------------
20983 main/titles.c:
20984
20985  * Revision 1.13  1995/11/03  12:52:23  allender
20986  * shareware changes
20987  *
20988  * Revision 1.12  1995/10/31  10:17:56  allender
20989  * shareware stuff
20990  *
20991  * Revision 1.11  1995/10/24  18:12:02  allender
20992  * don't do special processing on do_appl_quit anymore
20993  *
20994  * Revision 1.10  1995/10/21  22:25:02  allender
20995  * added bald guy cheat
20996  *
20997  * Revision 1.9  1995/10/17  13:14:30  allender
20998  * mouse will now move through title stuff
20999  *
21000  * Revision 1.8  1995/10/15  23:00:34  allender
21001  * made mouse move through screens and do event processing
21002  * at title screens
21003  *
21004  * Revision 1.7  1995/10/10  11:52:10  allender
21005  * use appropriate end01 file for registered
21006  *
21007  * Revision 1.6  1995/09/24  10:53:09  allender
21008  * added cmd-q to quit during titles screens and briefing screens
21009  *
21010  * Revision 1.5  1995/08/25  15:39:37  allender
21011  * save and resotre interpolation method during briefing screens
21012  *
21013  * Revision 1.4  1995/08/24  16:10:57  allender
21014  * endgame screen changes, and fixups to other stuff
21015  *
21016  * Revision 1.3  1995/08/14  14:40:37  allender
21017  * fixed up briefing screens to look correct.
21018  * made robot canvas smaller for now for speec
21019  *
21020  * Revision 1.2  1995/06/13  13:07:05  allender
21021  * do a bitblt during tight loops to get spinning robots and cursor flashing
21022  *
21023  * Revision 1.1  1995/05/16  15:31:52  allender
21024  * Initial revision
21025  *
21026  * Revision 2.10  1995/06/15  12:14:16  john
21027  * Made end game, win game and title sequences all go
21028  * on after 5 minutes automatically.
21029  *
21030  * Revision 2.9  1995/06/14  17:25:48  john
21031  * Fixed bug with VFX palette not getting loaded for credits, titles.
21032  *
21033  * Revision 2.8  1995/05/26  16:16:30  john
21034  * Split SATURN into define's for requiring cd, using cd, etc.
21035  * Also started adding all the Rockwell stuff.
21036  *
21037  * Revision 2.7  1995/03/24  13:11:36  john
21038  * Added save game during briefing screens.
21039  *
21040  * Revision 2.6  1995/03/21  14:41:17  john
21041  * Ifdef'd out the NETWORK code.
21042  *
21043  * Revision 2.5  1995/03/15  14:33:45  john
21044  * Added code to force the Descent CD-rom in the drive.
21045  *
21046  * Revision 2.4  1995/03/14  18:24:50  john
21047  * Force Destination Saturn to use CD-ROM drive.
21048  *
21049  * Revision 2.3  1995/03/10  13:05:52  john
21050  * Added code so that palette is correct for VFX1 helmets.
21051  *
21052  * Revision 2.2  1995/03/07  14:19:28  mike
21053  * More destination saturn stuff.
21054  *
21055  * Revision 2.1  1995/03/06  15:24:16  john
21056  * New screen techniques.
21057  *
21058  * Revision 2.0  1995/02/27  11:32:50  john
21059  * New version 2.0, which has no anonymous unions, builds with
21060  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21061  *
21062  * Revision 1.95  1995/02/12  04:07:19  matt
21063  * After freeing Robot_canv, set ptr to NULL
21064  *
21065  * Revision 1.94  1995/02/11  12:41:57  john
21066  * Added new song method, with FM bank switching..
21067  *
21068  * Revision 1.93  1995/02/11  09:51:59  john
21069  * Stripped out all SVGA references.
21070  *
21071  * Revision 1.92  1995/02/07  09:56:10  john
21072  * Fixed bug with wrong title screen drawing during save btwn lvls.
21073  *
21074  * Revision 1.91  1995/02/04  13:53:16  john
21075  * Added code to display the correct titles between levels
21076  * that have robot maps..
21077  *
21078  * Revision 1.90  1995/02/02  16:36:33  adam
21079  * *** empty log message ***
21080  *
21081  * Revision 1.89  1995/02/02  12:23:30  john
21082  * Made between level saves have picture.
21083  *
21084  * Revision 1.88  1995/02/02  01:50:16  adam
21085  * rearranged robot briefings.
21086  *
21087  * Revision 1.87  1995/02/01  22:28:54  mike
21088  * *** empty log message ***
21089  *
21090  * Revision 1.86  1995/02/01  17:12:21  mike
21091  * Make score come after endgame screens.
21092  *
21093  * Revision 1.85  1995/02/01  14:04:17  adam
21094  * mucked with screens
21095  *
21096  * Revision 1.84  1995/01/28  16:59:30  adam
21097  * added hook for special first briefing music
21098  *
21099  * Revision 1.83  1995/01/21  17:04:35  mike
21100  * fix endgame text bogosity.
21101  *
21102  * Revision 1.82  1995/01/21  16:26:29  matt
21103  * Made endlevel briefing work with missions
21104  *
21105  * Revision 1.81  1995/01/21  13:15:20  adam
21106  * added new robot briefings.
21107  *
21108  * Revision 1.80  1995/01/20  22:47:33  matt
21109  * Mission system implemented, though imcompletely
21110  *
21111  * Revision 1.79  1995/01/20  14:57:52  mike
21112  * support arbitrary number of screens/level.
21113  *
21114  * Revision 1.78  1995/01/15  14:29:12  john
21115  * Made the exit door page in.
21116  *
21117  * Revision 1.77  1995/01/15  14:27:09  adam
21118  * messed with endgame stuff
21119  *
21120  * Revision 1.76  1995/01/14  15:42:49  mike
21121  * Make endgame for registered support 3 screens.
21122  *
21123  * Revision 1.75  1995/01/14  14:00:59  adam
21124  * *** empty log message ***
21125  *
21126  * Revision 1.74  1995/01/09  11:28:53  mike
21127  * Support new $O thingy for bitmaps which cycle and are not the exit door.
21128  *
21129  * Revision 1.73  1995/01/02  12:39:13  mike
21130  * fix secret level sequencing.
21131  *
21132  * Revision 1.72  1994/12/12  19:44:14  rob
21133  * Added kill matrix to end of game sequence.
21134  *
21135  * Revision 1.71  1994/12/09  22:32:57  adam
21136  * messed with text positioning
21137  *
21138  * Revision 1.70  1994/12/09  14:08:37  mike
21139  * make briefing text work with hog files.
21140  *
21141  * Revision 1.69  1994/12/09  00:41:47  mike
21142  * fix hang in automap print screen.
21143  *
21144  * Revision 1.68  1994/12/08  20:56:36  john
21145  * More cfile stuff.
21146  *
21147  * Revision 1.67  1994/12/08  17:19:11  yuan
21148  * Cfiling stuff.
21149  *
21150  * Revision 1.66  1994/12/07  11:28:00  matt
21151  * Did a localization suppport
21152  *
21153  * Revision 1.65  1994/12/06  17:10:23  yuan
21154  * Fixed missing )
21155  *
21156  * Revision 1.64  1994/12/06  17:00:45  rob
21157  * Fixed problem with finishing the game in modem/serial mode.
21158  *
21159  * Revision 1.63  1994/12/06  16:58:37  matt
21160  * Killed warnings
21161  *
21162  * Revision 1.62  1994/12/06  15:54:28  mike
21163  * fix guy at end...
21164
21165 ------------------------------------------------------------------------
21166 main/titles.h:
21167
21168  * Revision 2.0  1995/02/27  11:27:40  john
21169  * New version 2.0, which has no anonymous unions, builds with
21170  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21171  *
21172  * Revision 1.12  1995/02/02  12:23:29  john
21173  * Made between level saves have picture.
21174  *
21175  * Revision 1.11  1995/01/21  16:27:11  matt
21176  * Made endlevel briefing work with missions
21177  *
21178  * Revision 1.10  1995/01/20  22:48:02  matt
21179  * Mission system implemented, though imcompletely
21180  *
21181  * Revision 1.9  1994/12/07  19:14:07  matt
21182  * Kill briefing screen disable switch for release version
21183  *
21184  * Revision 1.8  1994/11/21  16:40:24  matt
21185  * Added prototype
21186  *
21187  * Revision 1.7  1994/11/05  14:05:54  john
21188  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
21189  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
21190  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
21191  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
21192  *
21193  * Revision 1.6  1994/11/01  17:57:48  mike
21194  * Briefing screens.
21195  *
21196  * Revision 1.5  1994/10/31  22:28:04  mike
21197  * briefing screens
21198  *
21199  * Revision 1.4  1994/09/16  16:14:31  john
21200  * Added acrade sequencing.
21201  *
21202  * Revision 1.3  1994/06/22  00:26:53  matt
21203  * Added support for Interplay's animating title sequence
21204  *
21205  * Revision 1.2  1994/06/17  12:13:36  john
21206  * More newdemo stuff; made editor->game transition start in slew mode.
21207  *
21208  * Revision 1.1  1994/06/17  10:50:12  john
21209  * Initial revision
21210
21211 ------------------------------------------------------------------------
21212 main/vclip.c:
21213
21214  * Revision 1.2  1995/09/14  14:14:31  allender
21215  * return void in draw_vclip_object
21216  *
21217  * Revision 1.1  1995/05/16  15:32:00  allender
21218  * Initial revision
21219  *
21220  * Revision 2.0  1995/02/27  11:32:41  john
21221  * New version 2.0, which has no anonymous unions, builds with
21222  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21223  *
21224  * Revision 1.8  1994/09/25  23:40:52  matt
21225  * Changed the object load & save code to read/write the structure fields one
21226  * at a time (rather than the whole structure at once).  This mean that the
21227  * object structure can be changed without breaking the load/save functions.
21228  * As a result of this change, the local_object data can be and has been
21229  * incorporated into the object array.  Also, timeleft is now a property
21230  * of all objects, and the object structure has been otherwise cleaned up.
21231  *
21232  * Revision 1.7  1994/09/25  15:45:26  matt
21233  * Added OBJ_LIGHT, a type of object that casts light
21234  * Added generalized lifeleft, and moved it to local_object
21235  *
21236  * Revision 1.6  1994/09/09  20:05:57  mike
21237  * Add vclips for weapons.
21238  *
21239  * Revision 1.5  1994/06/14  21:14:35  matt
21240  * Made rod objects draw lighted or not depending on a parameter, so the
21241  * materialization effect no longer darkens.
21242  *
21243  * Revision 1.4  1994/06/08  18:16:24  john
21244  * Bunch of new stuff that basically takes constants out of the code
21245  * and puts them into bitmaps.tbl.
21246  *
21247  * Revision 1.3  1994/06/03  10:47:17  matt
21248  * Made vclips (used by explosions) which can be either rods or blobs, as
21249  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
21250  *
21251  * Revision 1.2  1994/05/11  09:25:25  john
21252  * Abandoned new vclip system for now because each wallclip, vclip,
21253  * etc, is different and it would be a huge pain to change all of them.
21254  *
21255  * Revision 1.1  1994/05/10  15:21:12  john
21256  * Initial revision
21257
21258 ------------------------------------------------------------------------
21259 main/vclip.h:
21260
21261  * Revision 1.2  1995/09/14  14:14:45  allender
21262  * return void in draw_vclip_object
21263  *
21264  * Revision 1.1  1995/05/16  16:04:35  allender
21265  * Initial revision
21266  *
21267  * Revision 2.0  1995/02/27  11:32:42  john
21268  * New version 2.0, which has no anonymous unions, builds with
21269  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21270  *
21271  * Revision 1.33  1994/11/21  11:17:57  adam
21272  * *** empty log message ***
21273  *
21274  * Revision 1.32  1994/10/12  13:07:07  mike
21275  * Add VCLIP_POWERUP_DISAPPEARANCE.
21276  *
21277  * Revision 1.31  1994/10/12  10:23:54  adam
21278  * *** empty log message ***
21279  *
21280  * Revision 1.30  1994/10/11  12:25:21  matt
21281  * Added "hot rocks" that create badass explosion when hit by weapons
21282  *
21283  * Revision 1.29  1994/10/06  14:10:07  matt
21284  * Added constant for player appearence effect
21285  *
21286  * Revision 1.28  1994/09/26  08:40:30  adam
21287  * *** empty log message ***
21288  *
21289  * Revision 1.27  1994/09/10  17:30:57  mike
21290  * move a prototype here, had been defined in object.c
21291  *
21292  * Revision 1.26  1994/09/09  20:04:25  mike
21293  * Add weapon_vclip.
21294  *
21295  * Revision 1.25  1994/08/31  19:27:09  mike
21296  * Increase max number of Vclips for new pile of weapon powerups.
21297  *
21298  * Revision 1.24  1994/08/14  23:14:43  matt
21299  * Added animating bitmap hostages, and cleaned up vclips a bit
21300  *
21301  * Revision 1.23  1994/07/23  19:56:39  matt
21302  * Took out unused constant
21303  *
21304  * Revision 1.22  1994/07/22  10:42:10  adam
21305  * upped max no. of vclips
21306  *
21307  * Revision 1.21  1994/06/14  21:15:14  matt
21308  * Made rod objects draw lighted or not depending on a parameter, so the
21309  * materialization effect no longer darkens.
21310  *
21311  * Revision 1.20  1994/06/09  19:38:16  john
21312  * Made each Vclip have its own sound... but only used in the
21313  * materialization center.
21314  *
21315  * Revision 1.19  1994/06/09  11:46:26  john
21316  * Took out unused vclip defines.
21317  *
21318  * Revision 1.18  1994/06/08  18:16:33  john
21319  * Bunch of new stuff that basically takes constants out of the code
21320  * and puts them into bitmaps.tbl.
21321  *
21322  * Revision 1.17  1994/06/08  12:49:01  mike
21323  * Add light_value to vclip.
21324  *
21325  * Revision 1.16  1994/06/08  11:43:28  mike
21326  * Allow 20 vclips, I think (anyway, more than it used to be, probably 12).
21327  *
21328  * Revision 1.15  1994/06/03  10:48:22  matt
21329  * Made vclips (used by explosions) which can be either rods or blobs, as
21330  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
21331  *
21332  * Revision 1.14  1994/06/01  17:21:08  john
21333  * Added muzzle flash
21334  *
21335  * Revision 1.13  1994/06/01  10:34:02  john
21336  * Added robot morphing effect.
21337  *
21338  * Revision 1.12  1994/05/16  16:17:38  john
21339  * Bunch of stuff on my Inferno Task list May16-23
21340  *
21341  * Revision 1.11  1994/05/10  18:32:50  john
21342  * *** empty log message ***
21343  *
21344  * Revision 1.10  1994/04/29  14:35:52  matt
21345  * Added second kind of fireball
21346  *
21347  * Revision 1.9  1994/04/11  10:36:31  yuan
21348  * Started adding types for exploding hostages.
21349  *
21350  * Revision 1.8  1994/04/07  16:27:43  yuan
21351  * Added SUPERPIG the robot with 200 hit points.
21352  * Now robots can take multiple hits before blowing up.
21353  *
21354  * Revision 1.7  1994/04/07  13:45:58  yuan
21355  * Defined Pclips... maybe shouldn't be in this file.
21356  *
21357  * Revision 1.6  1994/03/28  20:58:22  yuan
21358  * Added blood vclip constant
21359  *
21360  * Revision 1.5  1994/03/15  16:31:56  yuan
21361  * Cleaned up bm-loading code.
21362  * (And structures)
21363  *
21364  * Revision 1.4  1994/03/04  17:09:43  yuan
21365  * New wall stuff
21366  *
21367  * Revision 1.3  1994/01/11  10:59:01  yuan
21368  * Added effects
21369  *
21370  * Revision 1.2  1994/01/06  17:13:15  john
21371  * Added Video clip functionality
21372  *
21373  * Revision 1.1  1994/01/06  15:10:15  john
21374  * Initial revision
21375
21376 ------------------------------------------------------------------------
21377 main/wall.c:
21378
21379  * Revision 1.1  1995/05/16  15:32:08  allender
21380  * Initial revision
21381  *
21382  * Revision 2.1  1995/03/21  14:39:04  john
21383  * Ifdef'd out the NETWORK code.
21384  *
21385  * Revision 2.0  1995/02/27  11:28:32  john
21386  * New version 2.0, which has no anonymous unions, builds with
21387  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21388  *
21389  * Revision 1.112  1995/02/22  13:53:07  allender
21390  * remove anonymous unions from object structure
21391  *
21392  * Revision 1.111  1995/02/01  17:32:17  adam
21393  * Took out a bogus int3.
21394  *
21395  * Revision 1.110  1995/02/01  17:20:24  john
21396  * Lintized.
21397  *
21398  * Revision 1.109  1995/01/21  17:39:50  matt
21399  * Cleaned up laser/player hit wall confusions
21400  *
21401  * Revision 1.108  1995/01/21  17:14:17  rob
21402  * Fixed bug in multiplayer door-butting.
21403  *
21404  * Revision 1.107  1995/01/18  18:57:11  rob
21405  * Added new hostage door hooks.
21406  *
21407  * Revision 1.106  1995/01/18  18:48:18  allender
21408  * removed #ifdef newdemo's.  Added function call to record a door that
21409  * starts to open. This fixes the rewind problem
21410  *
21411  * Revision 1.105  1995/01/16  11:55:39  mike
21412  * make control center (and robots whose id == your playernum) not able to open doors.
21413  *
21414  * Revision 1.104  1994/12/11  23:07:21  matt
21415  * Fixed stuck objects & blastable walls
21416  *
21417  * Revision 1.103  1994/12/10  16:44:34  matt
21418  * Added debugging code to track down door that turns into rock
21419  *
21420  * Revision 1.102  1994/12/06  16:27:05  matt
21421  * Added debugging
21422  *
21423  * Revision 1.101  1994/12/02  10:50:27  yuan
21424  * Localization
21425  *
21426  * Revision 1.100  1994/11/30  19:41:22  rob
21427  * Put in a fix so that door opening sounds travel through the door.
21428  *
21429  * Revision 1.99  1994/11/28  11:59:50  yuan
21430  * *** empty log message ***
21431  *
21432  * Revision 1.98  1994/11/28  11:25:45  matt
21433  * Cleaned up key hud messages
21434  *
21435  * Revision 1.97  1994/11/27  23:15:11  matt
21436  * Made changes for new mprintf calling convention
21437  *
21438  * Revision 1.96  1994/11/19  15:18:29  mike
21439  * rip out unused code and data.
21440  *
21441  * Revision 1.95  1994/11/17  14:57:12  mike
21442  * moved segment validation functions from editor to main.
21443  *
21444  * Revision 1.94  1994/11/07  08:47:30  john
21445  * Made wall state record.
21446  *
21447  * Revision 1.93  1994/11/04  16:06:37  rob
21448  * Fixed network damage of blastable walls.
21449  *
21450  * Revision 1.92  1994/11/02  21:54:01  matt
21451  * Don't let objects with zero size keep door from shutting
21452  *
21453  * Revision 1.91  1994/10/31  13:48:42  rob
21454  * Fixed bug in opening doors over network/modem.  Added a new message
21455  * type to multi.c that communicates door openings across the net.
21456  * Changed includes in multi.c and wall.c to accomplish this.
21457  *
21458  * Revision 1.90  1994/10/28  14:42:41  john
21459  * Added sound volumes to all sound calls.
21460  *
21461  * Revision 1.89  1994/10/23  19:16:55  matt
21462  * Fixed bug with "no key" messages
21463
21464 ------------------------------------------------------------------------
21465 main/wall.h:
21466
21467  * Revision 1.1  1995/05/16  16:05:14  allender
21468  * Initial revision
21469  *
21470  * Revision 2.0  1995/02/27  11:31:36  john
21471  * New version 2.0, which has no anonymous unions, builds with
21472  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21473  *
21474  * Revision 1.47  1994/11/19  15:20:35  mike
21475  * rip out unused code and data
21476  *
21477  * Revision 1.46  1994/10/25  15:40:12  yuan
21478  * MAX_WALLS pumped up
21479  *
21480  * Revision 1.45  1994/10/23  19:17:07  matt
21481  * Fixed bug with "no key" messages
21482  *
21483  * Revision 1.44  1994/10/18  15:38:03  mike
21484  * Define hidden walls.
21485  *
21486  * Revision 1.43  1994/10/04  13:32:26  adam
21487  * commented out MAX_DOOR_ANIMS
21488  *
21489  * Revision 1.42  1994/10/04  13:31:21  adam
21490  * upped MAX_WALL_ANIMS to 30
21491  *
21492  * Revision 1.41  1994/09/29  00:42:30  matt
21493  * Made hitting a locked door play a sound
21494  *
21495  * Revision 1.40  1994/09/27  15:42:41  mike
21496  * Prototype Wall_names.
21497  *
21498  * Revision 1.39  1994/09/23  22:15:32  matt
21499  * Made doors not close on objects, made doors open again if shot while
21500  * closing, and cleaned up walls/doors a bit.
21501  *
21502  * Revision 1.38  1994/09/22  15:31:33  matt
21503  * Mucked with, and hopefully improved, exploding walls
21504  *
21505  * Revision 1.37  1994/09/21  17:17:05  mike
21506  * Make objects stuck in doors go away when door opens.
21507  *
21508  * Revision 1.36  1994/09/13  21:10:46  matt
21509  * Added wclips that use tmap1 instead of tmap2, saving lots of merging
21510  *
21511  * Revision 1.35  1994/09/13  20:11:08  yuan
21512  * *** empty log message ***
21513  *
21514  * Revision 1.34  1994/09/10  13:31:53  matt
21515  * Made exploding walls a type of blastable walls.
21516  * Cleaned up blastable walls, making them tmap2 bitmaps.
21517  *
21518  * Revision 1.33  1994/08/17  12:55:34  matt
21519  * Added external walls to wall_is_doorway
21520  *
21521  * Revision 1.32  1994/08/15  17:54:35  john
21522  * *** empty log message ***
21523  *
21524  * Revision 1.31  1994/08/15  17:46:56  yuan
21525  * Added external walls, fixed blastable walls.
21526  *
21527  * Revision 1.30  1994/08/05  21:17:21  matt
21528  * Allow two doors to be linked together
21529  *
21530  * Revision 1.29  1994/08/01  10:39:10  matt
21531  * Parenthesized parms to WID() macro
21532  *
21533  * Revision 1.28  1994/07/20  17:35:03  yuan
21534  * Some minor bug fixes and new key gauges...
21535  *
21536  * Revision 1.27  1994/07/19  14:32:03  yuan
21537  * Fixed keys bug... renumbered some constants.
21538  *
21539  * Revision 1.26  1994/07/14  22:38:29  matt
21540  * Added exploding doors
21541  *
21542  * Revision 1.25  1994/07/11  15:08:43  yuan
21543  * Wall anim file names stored in structure.
21544
21545 ------------------------------------------------------------------------
21546 main/weapon.c:
21547
21548  * Revision 1.2  1995/10/31  10:17:39  allender
21549  * new shareware stuff
21550  *
21551  * Revision 1.1  1995/05/16  15:32:16  allender
21552  * Initial revision
21553  *
21554  * Revision 2.1  1995/03/21  14:38:43  john
21555  * Ifdef'd out the NETWORK code.
21556  *
21557  * Revision 2.0  1995/02/27  11:27:25  john
21558  * New version 2.0, which has no anonymous unions, builds with
21559  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21560  *
21561  * Revision 1.54  1995/02/15  15:21:48  mike
21562  * make smart missile select if mega missiles used up.
21563  *
21564  *
21565  * Revision 1.53  1995/02/12  02:12:30  john
21566  * Fixed bug with state restore making weapon beeps.
21567  *
21568  * Revision 1.52  1995/02/09  20:42:15  mike
21569  * change weapon autoselect, always autoselect smart, mega.
21570  *
21571  * Revision 1.51  1995/02/07  20:44:26  mike
21572  * autoselect mega, smart when you pick them up.
21573  *
21574  * Revision 1.50  1995/02/07  13:32:25  rob
21575  * Added include of multi.h
21576  *
21577  * Revision 1.49  1995/02/07  13:21:33  yuan
21578  * Fixed 2nd typo
21579  *
21580  * Revision 1.48  1995/02/07  13:16:39  yuan
21581  * Fixed typo.
21582  *
21583  * Revision 1.47  1995/02/07  12:53:12  rob
21584  * Added network sound prop. to weapon switch.
21585  *
21586  * Revision 1.46  1995/02/06  15:53:17  mike
21587  * don't autoselect smart or mega missile when you pick it up.
21588  *
21589  * Revision 1.45  1995/02/02  21:43:34  mike
21590  * make autoselection better.
21591  *
21592  * Revision 1.44  1995/02/02  16:27:21  mike
21593  * make concussion missiles trade up.
21594  *
21595  * Revision 1.43  1995/02/01  23:34:57  adam
21596  * messed with weapon change sounds
21597  *
21598  * Revision 1.42  1995/02/01  17:12:47  mike
21599  * Make smart missile, mega missile not auto-select.
21600  *
21601  * Revision 1.41  1995/02/01  15:50:54  mike
21602  * fix bogus weapon selection sound code.
21603  *
21604  * Revision 1.40  1995/01/31  16:16:31  mike
21605  * Separate smart blobs for robot and player.
21606  *
21607  * Revision 1.39  1995/01/30  21:12:11  mike
21608  * Use new weapon selection sounds, different for primary and secondary.
21609  *
21610  * Revision 1.38  1995/01/29  13:46:52  mike
21611  * Don't auto-select fusion cannon when you run out of energy.
21612  *
21613  * Revision 1.37  1995/01/20  11:11:13  allender
21614  * record weapon changes again.  (John somehow lost my 1.35 changes).
21615  *
21616  * Revision 1.36  1995/01/19  17:00:46  john
21617  * Made save game work between levels.
21618  *
21619  * Revision 1.34  1995/01/09  17:03:48  mike
21620  * fix autoselection of weapons.
21621  *
21622  * Revision 1.33  1995/01/05  15:46:31  john
21623  * Made weapons not rearm when starting a saved game.
21624  *
21625  * Revision 1.32  1995/01/03  12:34:23  mike
21626  * autoselect next lower weapon if run out of smart or mega missile.
21627  *
21628  * Revision 1.31  1994/12/12  21:39:37  matt
21629  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
21630  *
21631  * Revision 1.30  1994/12/09  19:55:04  matt
21632  * Added weapon name in "not available in shareware" message
21633  *
21634  * Revision 1.29  1994/12/06  13:50:24  adam
21635  * added shareware msg. when choosing 4 top weapons
21636  *
21637  * Revision 1.28  1994/12/02  22:07:13  mike
21638  * if you gots 19 concussion missiles and you runs over 4, say you picks up 1, not 4, we do the math, see?
21639  *
21640  * Revision 1.27  1994/12/02  20:06:24  matt
21641  * Made vulcan ammo print at approx 25 times actual
21642  *
21643  * Revision 1.26  1994/12/02  15:05:03  matt
21644  * Fixed bogus weapon constants and arrays
21645  *
21646  * Revision 1.25  1994/12/02  10:50:34  yuan
21647  * Localization
21648  *
21649  * Revision 1.24  1994/11/29  15:48:28  matt
21650  * selecting weapon now makes sound
21651  *
21652  * Revision 1.23  1994/11/28  11:26:58  matt
21653  * Cleaned up hud message printing for picking up weapons
21654  *
21655  * Revision 1.22  1994/11/27  23:13:39  matt
21656  * Made changes for new mprintf calling convention
21657  *
21658  * Revision 1.21  1994/11/12  16:38:34  mike
21659  * clean up default ammo stuff.
21660  *
21661  * Revision 1.20  1994/11/07  17:41:18  mike
21662  * messages for when you try to fire a weapon you don't have or don't have ammo for.
21663  *
21664  * Revision 1.19  1994/10/21  20:40:05  mike
21665  * fix double vulcan ammo.
21666  *
21667  * Revision 1.18  1994/10/20  09:49:05  mike
21668  * kill messages no one liked...*sniff* *sniff*
21669  *
21670  * Revision 1.17  1994/10/19  11:17:07  mike
21671  * Limit amount of player ammo.
21672  *
21673  * Revision 1.16  1994/10/12  08:04:18  mike
21674  * Fix proximity/homing confusion.
21675  *
21676  * Revision 1.15  1994/10/11  18:27:58  matt
21677  * Changed auto selection of secondary weapons
21678  *
21679  * Revision 1.14  1994/10/08  23:37:54  matt
21680  * Don't pick up weapons you already have; also fixed auto_select bug
21681  * for seconary weapons
21682  *
21683  * Revision 1.13  1994/10/08  14:55:47  matt
21684  * Fixed bug that selected vulcan cannon when picked up ammo, even though
21685  * you didn't have the weapon.
21686  *
21687  * Revision 1.12  1994/10/08  12:50:32  matt
21688  * Fixed bug that let you select weapons you don't have
21689  *
21690  * Revision 1.11  1994/10/07  23:37:56  matt
21691  * Made weapons select when pick up better one
21692  *
21693  * Revision 1.10  1994/10/07  16:02:08  matt
21694  * Fixed problem with weapon auto-select
21695  *
21696  * Revision 1.9  1994/10/05  17:00:20  matt
21697  * Made player_has_weapon() public and moved constants to header file
21698  *
21699  * Revision 1.8  1994/09/26  11:27:13  mike
21700  * Fix auto selection of weapon when you run out of ammo.
21701  *
21702  * Revision 1.7  1994/09/13  16:40:45  mike
21703  * Add rearm delay and missile firing delay.
21704  *
21705  * Revision 1.6  1994/09/13  14:43:12  matt
21706  * Added cockpit weapon displays
21707  *
21708  * Revision 1.5  1994/09/03  15:23:06  mike
21709  * Auto select next weaker weapon when one runs out, clean up code.
21710  *
21711  * Revision 1.4  1994/09/02  16:38:19  mike
21712  * Eliminate a pile of arrays, associate weapon data with Weapon_info.
21713  *
21714  * Revision 1.3  1994/09/02  11:57:10  mike
21715  * Add a bunch of stuff, I forget what.
21716  *
21717  * Revision 1.2  1994/06/03  16:26:32  john
21718  * Initial version.
21719  *
21720  * Revision 1.1  1994/06/03  14:40:43  john
21721  * Initial revision
21722
21723 ------------------------------------------------------------------------
21724 main/weapon.h:
21725
21726  * Revision 1.2  1995/09/14  14:07:10  allender
21727  * fixed prototypes to have return value
21728  *
21729  * Revision 1.1  1995/05/16  16:05:22  allender
21730  * Initial revision
21731  *
21732  * Revision 2.0  1995/02/27  11:31:10  john
21733  * New version 2.0, which has no anonymous unions, builds with
21734  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21735  *
21736  * Revision 1.44  1995/01/30  17:14:18  mike
21737  * halve rate of vulcan ammo consumption.
21738  *
21739  * Revision 1.43  1995/01/19  17:45:04  mike
21740  * damage_force removed, that information coming from strength field.
21741  *
21742  * Revision 1.42  1995/01/05  15:46:11  john
21743  * Made weapons not rearm when starting a saved game.
21744  *
21745  * Revision 1.41  1995/01/04  12:20:27  john
21746  * Declearations to work better with game state save.
21747  *
21748  *
21749  * Revision 1.40  1994/12/13  12:54:16  mike
21750  * fix proximity, homing flags, backwards!
21751  *
21752  * Revision 1.39  1994/12/11  16:17:57  mike
21753  * change default weapon life so shots from ctrlcen on level 6 won't evaporate before they hit you.
21754  *
21755  * Revision 1.38  1994/12/09  19:55:26  matt
21756  * Added weapon name in "not available in shareware" message
21757  *
21758  * Revision 1.37  1994/12/07  12:55:27  mike
21759  * tweak vulcan amounts.
21760  *
21761  * Revision 1.36  1994/12/03  19:03:56  matt
21762  * Fixed vulcan ammo HUD message
21763  *
21764  * Revision 1.35  1994/12/02  15:05:02  matt
21765  * Fixed bogus weapon constants and arrays
21766  *
21767  * Revision 1.34  1994/11/29  14:26:05  john
21768  * Again.
21769  *
21770  * Revision 1.33  1994/11/29  14:13:47  adam
21771  * Changed the byte flash sound to short.
21772  *
21773  * Revision 1.32  1994/11/12  16:36:55  mike
21774  * default ammo stuff.
21775  *
21776  * Revision 1.31  1994/10/21  10:55:24  adam
21777  * upped MAX_WEAPON_TYPES to 30
21778  *
21779  * Revision 1.30  1994/10/19  11:16:37  mike
21780  * Limit ammo amounts.
21781  *
21782  * Revision 1.29  1994/10/12  08:05:04  mike
21783  * Clean up homing/proximity mess.
21784  *
21785  * Revision 1.28  1994/10/08  23:37:53  matt
21786  * Don't pick up weapons you already have; also fixed auto_select bug
21787  * for seconary weapons
21788  *
21789  * Revision 1.27  1994/10/07  23:37:56  matt
21790  * Made weapons select when pick up better one
21791  *
21792  * Revision 1.26  1994/10/07  16:02:17  matt
21793  * Fixed problem with weapon auto-select
21794  *
21795  * Revision 1.25  1994/10/05  17:07:44  matt
21796  * Made player_has_weapon() public and moved constants to header file
21797  *
21798  * Revision 1.24  1994/09/30  21:50:49  mike
21799  * Add homing_flag and 3 dummy bytes to weapon_info.
21800  *
21801  * Revision 1.23  1994/09/30  13:47:41  mike
21802  * Make speed and strength be difficulty level based.
21803  *
21804  * Revision 1.22  1994/09/20  16:10:13  mike
21805  * Prototype Primary_weapon_names and Secondary_weapon_names.
21806  *
21807  * Revision 1.21  1994/09/20  12:17:21  adam
21808  * upped weapon types
21809  *
21810  * Revision 1.20  1994/09/13  16:40:29  mike
21811  * Define REARM_TIME -- time it takes until you can fire a newly armed weapon.
21812  *
21813  * Revision 1.19  1994/09/13  14:43:03  matt
21814  * Added cockpit weapon displays
21815  *
21816  * Revision 1.18  1994/09/11  15:50:34  mike
21817  * Add matter and bounce to weapon_info.
21818  *
21819  * Revision 1.17  1994/09/10  17:32:17  mike
21820  * Add thrust to weapon_info.
21821  *
21822  * Revision 1.16  1994/09/09  20:04:54  mike
21823  * Add vclips for weapons.
21824  *
21825  * Revision 1.15  1994/09/07  15:59:14  mike
21826  * Add default lifetimes to weapons, destroyable, lifetime, damage_radius, damage_force fields to weapons.
21827  *
21828  * Revision 1.14  1994/09/03  15:18:06  mike
21829  * Add prototype for auto_select_weapon.
21830  *
21831  * Revision 1.13  1994/09/02  16:38:33  mike
21832  * Move data from global arrays to Weapon_info.
21833  *
21834  * Revision 1.12  1994/09/02  11:54:59  mike
21835  * Add a whole slew of constants for the whole slew of new weapons.
21836  *
21837  * Revision 1.11  1994/08/23  16:39:15  mike
21838  * Add light to weapon struct
21839
21840 ------------------------------------------------------------------------
21841 maths/fixc.c:
21842
21843  * Revision 1.7  1995/09/22  14:08:16  allender
21844  * fixed fix_atan2 to work correctly with doubles
21845  *
21846  * Revision 1.6  1995/08/31  15:43:49  allender
21847  * *** empty log message ***
21848  *
21849  * Revision 1.5  1995/07/05  16:15:15  allender
21850  * make fixmuldiv use doubles for PPC implementation
21851  *
21852  * Revision 1.4  1995/05/15  13:57:36  allender
21853  * make fixmuldiv compile when compiling under 68k
21854  *
21855  * Revision 1.3  1995/05/11  13:02:59  allender
21856  * some routines are now in assembly
21857  *
21858  * Revision 1.2  1995/05/04  20:04:45  allender
21859  * use MPW fixdiv if compiling with MPW (why did I do this?)
21860  *
21861  * Revision 1.1  1995/04/17  11:37:54  allender
21862  * Initial revision
21863  *
21864  *
21865  * --- PC RCS Info ---
21866  * Revision 1.1  1995/03/08  18:55:09  matt
21867  * Initial revision
21868
21869 ------------------------------------------------------------------------
21870 maths/tables.c:
21871
21872  * Revision 1.2  1995/08/31  15:44:36  allender
21873  * ..
21874  *
21875  * Revision 1.1  1995/04/17  11:38:04  allender
21876  * Initial revision
21877
21878 ------------------------------------------------------------------------
21879 maths/vecmat.c:
21880
21881  * Revision 1.5  1995/10/30  11:08:16  allender
21882  * fix check_vec to return if vector is the NULL vector
21883  *
21884  * Revision 1.4  1995/09/23  09:38:14  allender
21885  * removed calls for PPC that are now handled in asm
21886  *
21887  * Revision 1.3  1995/08/31  15:50:24  allender
21888  * fixing up of functions for PPC
21889  *
21890  * Revision 1.2  1995/07/05  16:40:21  allender
21891  * some vecmat stuff might be using isqrt -- commented out
21892  * for now
21893  *
21894  * Revision 1.1  1995/04/17  16:18:02  allender
21895  * Initial revision
21896  *
21897  *
21898  * --- PC RCS Information ---
21899  * Revision 1.1  1995/03/08  15:56:50  matt
21900  * Initial revision
21901
21902 ------------------------------------------------------------------------
21903 maths/vecmata.asm:
21904
21905 ; Revision 1.54  1995/01/31  00:14:50  matt
21906 ; Took out int3 from dotprod overflow, since it saturates now
21907 ;
21908 ; Revision 1.53  1994/12/14  18:29:33  matt
21909 ; Made dotprod overflow check stay in, and return saturated value
21910 ;
21911 ; Revision 1.52  1994/12/14  12:34:13  matt
21912 ; Disabled now-unused vector_2_matrix_norm()
21913 ;
21914 ; Revision 1.51  1994/12/13  16:55:13  matt
21915 ; Ripped out optimization from last version, which was bogus
21916 ;
21917 ; Revision 1.50  1994/12/13  14:55:18  matt
21918 ; Use quick normalize in a couple of places where it was safe to do so
21919 ;
21920 ; Revision 1.49  1994/12/13  14:44:12  matt
21921 ; Added vm_vector_2_matrix_norm()
21922 ;
21923 ; Revision 1.48  1994/12/13  13:26:49  matt
21924 ; Fixed overflow check
21925 ;
21926 ; Revision 1.47  1994/12/03  15:39:54  matt
21927 ; Gracefully handle some vector_2_matrix problems
21928 ;
21929 ; Revision 1.46  1994/11/19  17:15:05  matt
21930 ; Assemble out some code not used in DESCENT
21931 ;
21932 ; Revision 1.45  1994/11/17  11:41:05  matt
21933 ; Put handling in extract_angles_from_matrix to deal with bad matrices
21934 ;
21935 ; Revision 1.44  1994/11/16  11:48:10  matt
21936 ; Added error checking to vm_extract_angles_matrix()
21937 ;
21938 ; Revision 1.43  1994/09/19  22:00:10  matt
21939 ; Fixed register trash
21940 ;
21941 ; Revision 1.42  1994/09/11  19:23:05  matt
21942 ; Added vm_vec_normalized_dir_quick()
21943 ;
21944 ; Revision 1.41  1994/08/14  13:28:38  matt
21945 ; Put in check for zero-length vector in extract angles
21946 ;
21947 ; Revision 1.40  1994/07/19  18:52:53  matt
21948 ; Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
21949 ;
21950 ; Revision 1.39  1994/06/16  18:24:22  matt
21951 ; Added vm_vec_mag_quick()
21952 ;
21953 ; Revision 1.38  1994/06/10  23:18:38  matt
21954 ; Added new code for vm_vec_ang_2_matrix() which may be better, but may
21955 ; not be.
21956 ;
21957 ; Revision 1.37  1994/05/22  18:17:29  mike
21958 ; Optimize vm_vec_dist_quick, using jns in place of abs_eax.
21959 ;
21960 ; Revision 1.36  1994/05/19  12:07:04  matt
21961 ; Fixed globals and macros and added a constant
21962 ;
21963 ; Revision 1.35  1994/05/19  09:19:00  matt
21964 ; Made vm_vec_normalized_dir() return mag of vector
21965 ;
21966 ; Revision 1.34  1994/05/18  22:28:01  matt
21967 ; Added function vm_vec_normalized_dir()
21968 ; Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
21969 ; Added C global static vars vmd_zero_vector & vmd_identity_matrix
21970 ;
21971 ; Revision 1.33  1994/05/18  21:44:16  matt
21972 ; Added functions:
21973 ;   vm_extract_angles_vector()
21974 ;   vm_extract_angles_vector_normalized()
21975 ;   vm_vec_copy_normalize()
21976 ;
21977 ; Revision 1.32  1994/05/13  12:41:51  matt
21978 ; Added new function, vm_vec_dist_quick(), which does an approximation.
21979 ;
21980 ; Revision 1.31  1994/05/04  17:41:31  mike
21981 ; Comment out debug_brk on null vector.
21982 ;
21983 ; Revision 1.30  1994/04/15  21:41:31  matt
21984 ; Check for foward vector straigt up in extract angles routine
21985 ;
21986 ; Revision 1.29  1994/03/30  15:45:05  matt
21987 ; Added two functions, vm_vec_scale_add() & vm_vec_scale_add2()
21988 ;
21989 ; Revision 1.28  1994/02/26  19:23:35  matt
21990 ; Do an int3 when we get a null vector when computing surface normal
21991 ;
21992 ; Revision 1.27  1994/02/10  18:29:45  matt
21993 ; Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
21994 ;
21995 ; Revision 1.26  1994/02/10  18:28:55  matt
21996 ; Fixed bugs in extract angles function
21997 ;
21998 ; Revision 1.25  1994/01/31  22:46:07  matt
21999 ; Added vm_extract_angles_matrix() function
22000 ;
22001 ; Revision 1.24  1994/01/30  19:29:55  matt
22002 ; Put in debug_brk when vm_vec_2_matrix got zero-length vector
22003 ;
22004 ; Revision 1.23  1994/01/25  15:27:59  matt
22005 ; Added debugging check for dotprod overflow
22006 ;
22007 ; Revision 1.22  1994/01/24  11:52:59  matt
22008 ; Added checking for dest==src for several functions where this is not allowed
22009 ;
22010 ; Revision 1.21  1994/01/19  23:13:02  matt
22011 ; Fixed bug in vm_vec_ang_2_matrix()
22012 ;
22013 ; Revision 1.20  1994/01/04  12:33:43  mike
22014 ; Prevent divide overflow in vm_vec_scale2
22015 ;
22016 ; Revision 1.19  1993/12/21  19:46:26  matt
22017 ; Added function vm_dist_to_plane()
22018 ;
22019 ; Revision 1.18  1993/12/13  17:26:23  matt
22020 ; Added vm_vec_dist()
22021 ;
22022 ; Revision 1.17  1993/12/02  12:43:39  matt
22023 ; New functions: vm_vec_copy_scale(), vm_vec_scale2()
22024 ;
22025 ; Revision 1.16  1993/10/29  22:39:29  matt
22026 ; Changed matrix order, making direction vectors the rows
22027 ;
22028 ; Revision 1.15  1993/10/29  18:06:01  matt
22029 ; Fixed vm_vector_2_matrix() bug when forward vector was straight down
22030 ;
22031 ; Revision 1.14  1993/10/26  18:51:26  matt
22032 ; Fixed some register trashes in vm_vec_ang_2_matrix()
22033 ;
22034 ; Revision 1.13  1993/10/25  11:49:37  matt
22035 ; Made vm_vec_delta_ang() take optional forward vector to return signed delta
22036 ;
22037 ; Revision 1.12  1993/10/20  01:09:42  matt
22038 ; Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
22039 ;
22040 ; Revision 1.11  1993/10/17  17:03:08  matt
22041 ; vm_vector_2_matrix() now takes optional right vector
22042 ;
22043 ; Revision 1.10  1993/10/10  18:11:42  matt
22044 ; Changed angles_2_matrix so that heading & bank rotate in the
22045 ; correct directions.
22046 ;
22047 ; Revision 1.9  1993/09/30  16:17:59  matt
22048 ; Fixed bug in vector_2_matrix() by adding another normalize
22049 ;
22050 ; Revision 1.8  1993/09/29  10:51:58  matt
22051 ; Fixed bad register trashes in crossprod, perp, & normal
22052 ;
22053 ; Revision 1.7  1993/09/28  12:16:46  matt
22054 ; Fixed bugs in cross product
22055 ; Added func vm_vector_2_matrix()
22056 ;
22057 ; Revision 1.6  1993/09/24  21:19:37  matt
22058 ; Added vm_vec_avg() and vm_vec_avg4()
22059 ;
22060 ; Revision 1.5  1993/09/20  18:15:07  matt
22061 ; Trap zero-length vectors in vm_vec_normalize(), vm_vec_perp(), and vm_vec_normal()
22062 ;
22063 ; Revision 1.4  1993/09/20  14:56:43  matt
22064 ; Fixed bug in vm_vec_normal(), made that routine normalize the results,
22065 ; and added new function vm_vec_perp().
22066 ;
22067 ; Revision 1.3  1993/09/20  10:12:06  mike
22068 ; no changes
22069 ;
22070 ; Revision 1.2  1993/09/17  11:10:33  matt
22071 ; Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
22072 ;
22073 ; Revision 1.1  1993/09/16  20:10:24  matt
22074 ; Initial revision
22075
22076 ------------------------------------------------------------------------
22077 misc/args.c:
22078
22079  * Revision 2.0  1995/02/27  11:31:22  john
22080  * New version 2.0, which has no anonymous unions, builds with
22081  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
22082  *
22083  * Revision 1.9  1994/11/29  01:07:57  john
22084  * Took out some unused vars.
22085  *
22086  * Revision 1.8  1994/11/29  01:04:30  john
22087  * Took out descent.ini stuff.
22088  *
22089  * Revision 1.7  1994/09/20  19:29:15  matt
22090  * Made args require exact (not substring), though still case insensitive.
22091  *
22092  * Revision 1.6  1994/07/25  12:33:11  john
22093  * Network "pinging" in.
22094  *
22095  * Revision 1.5  1994/06/17  18:07:50  matt
22096  * Took out printf
22097  *
22098  * Revision 1.4  1994/05/11  19:45:33  john
22099  * *** empty log message ***
22100  *
22101  * Revision 1.3  1994/05/11  18:42:11  john
22102  * Added Descent.ini config file.
22103  *
22104  * Revision 1.2  1994/05/09  17:03:30  john
22105  * Split command line parameters into arg.c and arg.h.
22106  * Also added /dma, /port, /irq to digi.c
22107  *
22108  * Revision 1.1  1994/05/09  16:49:11  john
22109  * Initial revision
22110
22111 ------------------------------------------------------------------------
22112 misc/error.c:
22113
22114  * Revision 1.12  1994/12/07  18:49:39  matt
22115  * error_init() can now take NULL as parm
22116  *
22117  * Revision 1.11  1994/11/29  15:42:07  matt
22118  * Added newline before error message
22119  *
22120  * Revision 1.10  1994/11/27  23:20:39  matt
22121  * Made changes for new mprintf calling convention
22122  *
22123  * Revision 1.9  1994/06/20  21:20:56  matt
22124  * Allow NULL for warn func, to kill warnings
22125  *
22126  * Revision 1.8  1994/05/20  15:11:35  mike
22127  * mprintf Warning message so you can actually see it.
22128  *
22129  * Revision 1.7  1994/02/10  18:02:38  matt
22130  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
22131  *
22132  * Revision 1.6  1993/10/17  18:19:10  matt
22133  * If error_init() not called, Error() now prints the error message before
22134  * calling exit()
22135  *
22136  * Revision 1.5  1993/10/14  15:29:11  matt
22137  * Added new function clear_warn_func()
22138  *
22139  * Revision 1.4  1993/10/08  16:17:19  matt
22140  * Made Assert() call function _Assert(), rather to do 'if...' inline.
22141  *
22142  * Revision 1.3  1993/09/28  12:45:25  matt
22143  * Fixed wrong print call, and made Warning() not append a CR to string
22144  *
22145  * Revision 1.2  1993/09/27  11:46:35  matt
22146  * Added function set_warn_func()
22147  *
22148  * Revision 1.1  1993/09/23  20:17:33  matt
22149  * Initial revision
22150
22151 ------------------------------------------------------------------------
22152 texmap/ntmap.c:
22153
22154  * Revision 1.52  1995/03/14  15:13:06  john
22155  * Increased MAX_Y_Pointers to 480.
22156  *
22157  * Revision 1.51  1995/02/23  14:25:09  john
22158  * Added editor tmap.
22159  *
22160  * Revision 1.50  1995/02/20  18:22:58  john
22161  * Put all the externs in the assembly modules into tmap_inc.asm.
22162  * Also, moved all the C versions of the inner loops into a new module,
22163  * scanline.c.
22164  *
22165  * Revision 1.49  1995/02/20  17:09:11  john
22166  * Added code so that you can build the tmapper with no assembly!
22167  *
22168  * Revision 1.48  1995/01/06  11:11:30  mike
22169  * even when not in editor, have 400 lines in texture map scanline table.
22170  *
22171  * Revision 1.47  1994/12/15  16:43:25  matt
22172  * Took out code only needed by editor
22173  *
22174  * Revision 1.46  1994/12/09  22:35:37  mike
22175  * fix bug in before call to asm_tmap_scanline_per causing write of pixel onto past right border onto left.
22176  *
22177  * Revision 1.45  1994/12/06  16:31:06  mike
22178  * fix bug in asm_tmap_scanline_matt interface.
22179  *
22180  * Revision 1.44  1994/12/04  20:37:18  mike
22181  * *** empty log message ***
22182  *
22183  * Revision 1.43  1994/12/02  23:30:04  mike
22184  * optimizations.
22185  *
22186  * Revision 1.42  1994/11/30  00:57:43  mike
22187  * optimizations.
22188  *
22189  * Revision 1.41  1994/11/28  13:34:27  mike
22190  * optimizations.
22191  *
22192  * Revision 1.40  1994/11/28  01:30:01  mike
22193  * kill warning.
22194  *
22195  * Revision 1.39  1994/11/28  01:28:59  mike
22196  * optimizations.
22197  *
22198  * Revision 1.38  1994/11/21  14:08:07  john
22199  * Took out all multiple instead of divide code.
22200  *
22201  * Revision 1.37  1994/11/19  15:21:52  mike
22202  * rip out unused code.
22203  *
22204  * Revision 1.36  1994/11/14  11:42:51  mike
22205  * optimization.
22206  *
22207  * Revision 1.35  1994/11/12  16:41:36  mike
22208  * *** empty log message ***
22209  *
22210  * Revision 1.34  1994/11/10  21:28:41  mike
22211  * remove call to init_interface_vars_to_assembler.
22212  *
22213  * Revision 1.33  1994/11/10  11:08:59  mike
22214  * detail level stuff.
22215  *
22216  * Revision 1.32  1994/11/09  22:55:52  matt
22217  * Added variable Current_seg_depth for detail level optimization
22218  *
22219  * Revision 1.31  1994/11/09  19:57:31  john
22220  * Added texture rle caching.
22221  *
22222  * Revision 1.30  1994/11/09  19:54:48  mike
22223  * Call flat shader if Tmap_flat_flag set.
22224  *
22225  * Revision 1.29  1994/11/02  21:33:31  john
22226  * Added Burger Bill's optimization, ie.. 2 muls per 8 pixels.
22227  *
22228  * Revision 1.28  1994/11/02  11:32:16  john
22229  * Added code for c callable inner loop and code to
22230  * test dividing out z0.
22231  *
22232  * Revision 1.27  1994/10/28  20:54:32  matt
22233  * Added error checking
22234  *
22235  * Revision 1.26  1994/10/25  11:20:20  mike
22236  * fix bug in lighting overflow checking for one scanline tall linear texture maps.
22237  *
22238  * Revision 1.25  1994/08/03  15:40:33  mike
22239  * Prevent divide overflows, decrease occurrence of precision-caused glitches.
22240  *
22241  * Revision 1.24  1994/07/27  09:31:16  mike
22242  * Fix concave texture map problem, decrease occurrence of unimportant int 3.
22243  *
22244  * Revision 1.23  1994/06/17  12:23:31  mike
22245  * Support non-lighted texture maps.
22246  *
22247  * Revision 1.22  1994/06/11  08:10:24  mike
22248  * Fix mysterious hang bug, lighting value was out of range.
22249  *
22250  * Revision 1.21  1994/06/09  16:10:16  mike
22251  * Change SC2000 from constant to variable.
22252
22253 ------------------------------------------------------------------------
22254 texmap/scanline.c:
22255
22256  * Revision 1.2  1995/02/20  18:23:39  john
22257  * Added new module for C versions of inner loops.
22258  *
22259  * Revision 1.1  1995/02/20  17:42:27  john
22260  * Initial revision
22261
22262 ------------------------------------------------------------------------
22263 texmap/scanline.h:
22264
22265  * Revision 1.2  1995/02/20  18:23:40  john
22266  * Added new module for C versions of inner loops.
22267  *
22268  * Revision 1.1  1995/02/20  17:44:16  john
22269  * Initial revision
22270
22271 ------------------------------------------------------------------------
22272 texmap/texmapl.h:
22273
22274  * Revision 1.14  1995/02/20  18:23:02  john
22275  * Put all the externs in the assembly modules into tmap_inc.asm.
22276  * Also, moved all the C versions of the inner loops into a new module,
22277  * scanline.c.
22278  *
22279  * Revision 1.13  1995/02/20  17:09:16  john
22280  * Added code so that you can build the tmapper with no assembly!
22281  *
22282  * Revision 1.12  1994/11/28  13:34:34  mike
22283  * optimizations.
22284  *
22285  * Revision 1.11  1994/11/12  16:41:27  mike
22286  * function prototype.
22287  *
22288  * Revision 1.10  1994/05/24  17:30:00  mike
22289  * Prototype fix_recip, asm_tmap_scanline_lin_v.
22290  *
22291  * Revision 1.9  1994/04/21  15:04:26  mike
22292  * Add prototype for texmapl.h
22293  *
22294  * Revision 1.8  1994/03/31  08:34:53  mike
22295  * *** empty log message ***
22296  *
22297  * Revision 1.7  1994/03/22  20:37:04  mike
22298  * *** empty log message ***
22299  *
22300  * Revision 1.6  1994/03/14  15:43:03  mike
22301  * streamline code.
22302  *
22303  * Revision 1.5  1994/01/31  15:43:18  mike
22304  * window_height, asm_tmap_scanline_lin_sky_v
22305  *
22306  * Revision 1.4  1994/01/21  21:12:27  mike
22307  * Prototype asm_tmap_scanline_lin_sky
22308  *
22309  * Revision 1.3  1994/01/14  14:01:45  mike
22310  * Add a bunch of variables.
22311  *
22312  * Revision 1.2  1993/11/22  10:25:11  mike
22313  * *** empty log message ***
22314  *
22315  * Revision 1.1  1993/09/08  17:29:13  mike
22316  * Initial revision
22317
22318 ------------------------------------------------------------------------
22319 texmap/tmap_flt.asm:
22320
22321 ; Revision 1.10  1995/02/20  18:22:53  john
22322 ; Put all the externs in the assembly modules into tmap_inc.asm.
22323 ; Also, moved all the C versions of the inner loops into a new module,
22324 ; scanline.c.
22325 ;
22326 ; Revision 1.9  1995/02/20  17:08:51  john
22327 ; Added code so that you can build the tmapper with no assembly!
22328 ;
22329 ; Revision 1.8  1994/12/02  23:29:21  mike
22330 ; change jb/ja to jl/jg.
22331 ;
22332 ; Revision 1.7  1994/11/12  16:39:35  mike
22333 ; jae to ja.
22334 ;
22335 ; Revision 1.6  1994/08/09  11:27:53  john
22336 ; Added cthru mode.
22337 ;
22338 ; Revision 1.5  1994/07/08  17:43:11  john
22339 ; Added flat-shaded-zbuffered polygon.
22340 ;
22341 ; Revision 1.4  1994/04/08  16:25:43  mike
22342 ; optimize inner loop of flat shader.
22343 ;
22344 ; Revision 1.3  1994/03/31  08:34:20  mike
22345 ; Optimized (well, speeded-up) inner loop for tmap-based flat shader.
22346 ;
22347 ; Revision 1.2  1993/11/22  10:24:57  mike
22348 ; *** empty log message ***
22349 ;
22350 ; Revision 1.1  1993/09/08  17:29:46  mike
22351 ; Initial revision
22352
22353 ------------------------------------------------------------------------
22354 texmap/tmap_inc.asm:
22355
22356 ; Revision 1.10  1995/02/20  18:22:52  john
22357 ; Put all the externs in the assembly modules into tmap_inc.asm.
22358 ; Also, moved all the C versions of the inner loops into a new module,
22359 ; scanline.c.
22360 ;
22361 ; Revision 1.9  1994/12/02  23:29:45  mike
22362 ; Add y_pointers.
22363 ;
22364 ; Revision 1.8  1994/11/12  16:39:36  mike
22365 ; jae to ja.
22366 ;
22367 ; Revision 1.7  1994/10/26  23:27:39  john
22368 ; Took out references to gr_inverse_table.
22369 ;
22370 ; Revision 1.6  1994/10/26  23:21:55  mike
22371 ; kill unused stuff.
22372 ;
22373 ; Revision 1.5  1994/07/27  18:39:20  john
22374 ; Took out references to blend table
22375 ;
22376 ; Revision 1.4  1994/01/31  15:40:17  mike
22377 ; Add window_height.
22378 ;
22379 ; Revision 1.3  1993/12/07  12:27:48  john
22380 ; Moved bmd_palette to gr_palette
22381 ;
22382 ; Revision 1.2  1993/11/22  10:24:10  mike
22383 ; *** empty log message ***
22384 ;
22385 ; Revision 1.1  1993/09/08  17:29:47  mike
22386 ; Initial revision
22387
22388 ------------------------------------------------------------------------
22389 texmap/tmap_lin.asm:
22390
22391 ; Revision 1.3  1995/02/20  18:22:57  john
22392 ; Put all the externs in the assembly modules into tmap_inc.asm.
22393 ; Also, moved all the C versions of the inner loops into a new module,
22394 ; scanline.c.
22395 ;
22396 ; Revision 1.2  1995/02/20  17:09:10  john
22397 ; Added code so that you can build the tmapper with no assembly!
22398 ;
22399 ; Revision 1.1  1994/11/30  12:24:04  mike
22400 ; Initial revision
22401 ;
22402 ; Revision 1.6  1994/11/12  16:39:40  mike
22403 ; jae to ja.
22404 ;
22405 ; Revision 1.5  1994/02/10  21:24:43  matt
22406 ; Got rid of debug_on set
22407 ;
22408 ; Revision 1.4  1994/01/31  15:39:53  mike
22409 ; Write additional inner loop for transparency.
22410 ;
22411 ; Revision 1.3  1994/01/26  11:50:04  john
22412 ; Added transparency to linear unlighted texture mapper.
22413 ;
22414 ; Revision 1.2  1993/11/22  10:24:36  mike
22415 ; *** empty log message ***
22416 ;
22417 ; Revision 1.1  1993/09/08  17:29:50  mike
22418 ; Initial revision
22419
22420 ------------------------------------------------------------------------
22421 texmap/tmap_ll.asm:
22422
22423 ; Revision 1.10  1995/02/20  18:22:54  john
22424 ; Put all the externs in the assembly modules into tmap_inc.asm.
22425 ; Also, moved all the C versions of the inner loops into a new module,
22426 ; scanline.c.
22427 ;
22428 ; Revision 1.9  1995/02/20  17:09:06  john
22429 ; Added code so that you can build the tmapper with no assembly!
22430 ;
22431 ; Revision 1.8  1994/11/19  23:52:56  mike
22432 ; rip out big unrolled loop to save 25K....remember when we cared more about speed?
22433 ;
22434 ; Revision 1.7  1994/11/12  16:39:41  mike
22435 ; jae to ja.
22436 ;
22437 ; Revision 1.6  1994/03/14  15:45:08  mike
22438 ; streamline code.
22439 ;
22440 ; Revision 1.5  1994/01/24  13:13:12  mike
22441 ; dithering.
22442 ;
22443 ; Revision 1.4  1994/01/14  14:02:47  mike
22444 ; *** empty log message ***
22445 ;
22446 ; Revision 1.3  1993/12/17  20:00:16  mike
22447 ; Change default setting of dither_intensity_lighting from 1 to 0
22448 ;
22449 ; Revision 1.2  1993/11/22  10:24:50  mike
22450 ; *** empty log message ***
22451 ;
22452 ; Revision 1.1  1993/09/08  17:29:52  mike
22453 ; Initial revision
22454
22455 ------------------------------------------------------------------------
22456 texmap/tmap_per.asm:
22457
22458 ; Revision 1.26  1995/02/20  18:22:55  john
22459 ; Put all the externs in the assembly modules into tmap_inc.asm.
22460 ; Also, moved all the C versions of the inner loops into a new module,
22461 ; scanline.c.
22462 ;
22463 ; Revision 1.25  1995/02/20  17:09:08  john
22464 ; Added code so that you can build the tmapper with no assembly!
22465 ;
22466 ; Revision 1.24  1995/01/10  09:32:07  mike
22467 ; mostly fix garbage at end of scanline, but slow down by 1-4%.
22468 ;
22469 ; Revision 1.23  1994/12/02  23:29:57  mike
22470 ; optimizations.
22471 ;
22472 ; Revision 1.22  1994/11/30  00:57:00  mike
22473 ; optimization.
22474 ;
22475 ; Revision 1.21  1994/11/21  13:57:42  mike
22476 ; fix right side shear bug
22477 ;
22478 ; Revision 1.20  1994/11/12  16:41:09  mike
22479 ; jae -> ja.
22480 ;
22481 ; Revision 1.19  1994/10/27  19:40:00  john
22482 ; Made lighting table lookup be _gr_fade_table[eax] instead
22483 ; of fs:[eax], which gets rig of a segment override that
22484 ; supposedly costs 1 clock on a 486.  Mainly, I wanted to verify
22485 ; that the only reason we need selectors is for the source texture
22486 ; data .
22487 ;
22488 ; Revision 1.18  1994/05/03  11:08:32  mike
22489 ; Trap divide overflows.
22490 ;
22491 ; Revision 1.17  1994/04/21  15:03:41  mike
22492 ; make faster.
22493 ;
22494 ; Revision 1.16  1994/04/08  16:46:57  john
22495 ; Made 32 fade levels. Hacked.
22496 ;
22497 ; Revision 1.15  1994/03/31  08:35:18  mike
22498 ; Fix quantized-by-4 bug in inner loop.
22499 ;
22500 ; Revision 1.14  1994/03/14  17:41:14  mike
22501 ; Fix bug in unlighted version.
22502 ;
22503 ; Revision 1.13  1994/03/14  15:45:14  mike
22504 ; streamline code.
22505 ;
22506 ; Revision 1.12  1994/01/14  14:01:58  mike
22507 ; *** empty log message ***
22508 ;
22509 ; Revision 1.11  1993/12/18  14:43:44  john
22510 ; Messed around with doing 1/z, the u*(1/z) and v*(1/z)
22511 ; (Went from 23 fps to 21 fps... not good! )
22512 ;
22513 ; Revision 1.10  1993/12/17  16:14:17  john
22514 ; Split lighted/nonlighted, so there is no cmp lighting
22515 ; in the inner loop.
22516 ;
22517 ; Revision 1.9  1993/12/17  12:34:29  john
22518 ; Made leftover bytes use linear approx instead of correct...
22519 ; should save about 8 divides per scanline on average.
22520 ; Also, took out anti-aliasing code and rearranged to
22521 ; order of some instructions to help on 486 pipelining.
22522 ; (The anti-aliasing code did *not* look good, so I
22523 ; figure there was no reason to keep it in. )
22524 ;
22525 ; Revision 1.8  1993/12/16  18:37:52  mike
22526 ; Align some stuff on 4 byte boundaries.
22527 ;
22528 ; Revision 1.7  1993/11/30  08:44:18  john
22529 ; Made selector set check for < 64*64 bitmaps.
22530 ;
22531 ; Revision 1.6  1993/11/23  17:25:26  john
22532 ; Added safety "and eax, 0fffh" in lighting lookup.
22533 ;
22534 ; Revision 1.5  1993/11/23  15:08:52  mike
22535 ; Fixed lighting bug.
22536 ;
22537 ; Revision 1.4  1993/11/23  14:38:50  john
22538 ; optimized NORMAL code by switching EBX and ESI, so BH can be used in
22539 ; the lighting process.
22540 ;
22541 ; Revision 1.3  1993/11/23  14:30:53  john
22542 ; Made the perspective tmapper do 1/8 divides; added lighting.
22543 ;
22544 ; Revision 1.2  1993/11/22  10:24:59  mike
22545 ; *** empty log message ***
22546 ;
22547 ; Revision 1.1  1993/09/08  17:29:53  mike
22548 ; Initial revision
22549
22550 ------------------------------------------------------------------------
22551 texmap/tmapfade.asm:
22552
22553 ; Revision 1.6  1995/02/20  18:23:01  john
22554 ; Put all the externs in the assembly modules into tmap_inc.asm.
22555 ; Also, moved all the C versions of the inner loops into a new module,
22556 ; scanline.c.
22557 ;
22558 ; Revision 1.5  1995/02/20  17:09:15  john
22559 ; Added code so that you can build the tmapper with no assembly!
22560 ;
22561 ; Revision 1.4  1994/12/02  23:29:36  mike
22562 ; change jb/ja to jl/jg.
22563 ;
22564 ; Revision 1.3  1994/11/30  00:57:36  mike
22565 ; *** empty log message ***
22566 ;
22567 ; Revision 1.2  1994/10/06  18:38:49  john
22568 ; Added the ability to fade a scanline by calling gr_upoly_tmap
22569 ; with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
22570 ;
22571 ; Revision 1.1  1994/10/06  18:04:42  john
22572 ; Initial revision
22573
22574 ------------------------------------------------------------------------
22575 texmap/tmapflat.c:
22576
22577  * Revision 1.13  1995/02/20  18:23:24  john
22578  * Added new module for C versions of inner loops.
22579  *
22580  * Revision 1.12  1995/02/20  17:09:17  john
22581  * Added code so that you can build the tmapper with no assembly!
22582  *
22583  * Revision 1.11  1994/11/30  00:58:01  mike
22584  * optimizations.
22585  *
22586  * Revision 1.10  1994/11/28  13:34:32  mike
22587  * optimizations.
22588  *
22589  * Revision 1.9  1994/11/19  15:21:46  mike
22590  * rip out unused code.
22591  *
22592  * Revision 1.8  1994/11/12  16:41:41  mike
22593  * *** empty log message ***
22594  *
22595  * Revision 1.7  1994/11/09  23:05:12  mike
22596  * do lighting on texture maps which get flat shaded instead.
22597  *
22598  * Revision 1.6  1994/10/06  19:53:07  matt
22599  * Added function that takes same parms as draw_tmap(), but renders flat
22600  *
22601  * Revision 1.5  1994/10/06  18:38:12  john
22602  * Added the ability to fade a scanline by calling gr_upoly_tmap
22603  * with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
22604  *
22605  * Revision 1.4  1994/05/25  18:46:32  matt
22606  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
22607  *
22608  * Revision 1.3  1994/04/08  16:25:58  mike
22609  * Comment out some includes (of header files)
22610  * call init_interface_vars_to_assembler.
22611  *
22612  * Revision 1.2  1994/03/31  08:33:44  mike
22613  * Fixup flat shading version of texture mapper (get it?)
22614  * (Or maybe not, I admit to not testing my code...hahahah!)
22615  *
22616  * Revision 1.1  1993/09/08  17:29:10  mike
22617  * Initial revision
22618 ------------------------------------------------------------------------