]> icculus.org git repositories - btb/d2x.git/blob - ChangeLog-old
fade ship and weapon gauge when appropriate
[btb/d2x.git] / ChangeLog-old
1 This file contains the per-file change logs written before CVS was used
2
3 ------------------------------------------------------------------------
4 2d/2dsline.c:
5
6  * Revision 1.6  1995/09/14  14:24:03  allender
7  * fixed MW compile error
8  *
9  * Revision 1.5  1995/09/14  13:45:17  allender
10  * quick optimization for scanline
11  *
12  * Revision 1.4  1995/04/27  07:36:05  allender
13  * remove some memsets since all old is here now
14  *
15  * Revision 1.3  1995/04/19  14:35:33  allender
16  * *** empty log message ***
17  *
18  * Revision 1.2  1995/04/18  12:03:40  allender
19  * *** empty log message ***
20  *
21  * Revision 1.1  1995/03/09  09:24:06  allender
22  * Initial revision
23  *
24  *
25  * --- PC RCS information ---
26  * Revision 1.7  1994/11/18  22:50:48  john
27  * Changed a bunch of shorts to ints in calls.
28  *
29  * Revision 1.6  1994/09/02  11:40:32  john
30  * fixed bug with urect scanline drakening still
31  * only using 16 levels of fade.
32  *
33  * Revision 1.5  1994/04/08  16:59:12  john
34  * Add fading poly's; Made palette fade 32 instead of 16.
35  *
36  * Revision 1.4  1994/03/22  18:36:27  john
37  * Added darkening scanlines
38  *
39  * Revision 1.3  1993/10/15  16:22:52  john
40  * y
41  *
42  * Revision 1.2  1993/09/08  11:56:29  john
43  * neatened
44  *
45  * Revision 1.1  1993/09/08  11:44:27  john
46  * Initial revision
47  *
48
49 ------------------------------------------------------------------------
50 2d/bitblt.c:
51
52  * Revision 1.29  1995/03/14  12:14:28  john
53  * Added code to double horz/vert bitblts.
54  *
55  * Revision 1.28  1995/03/13  09:01:48  john
56  * Fixed bug with VFX1 screen not tall enough.
57  *
58  * Revision 1.27  1995/03/01  15:38:10  john
59  * Better ModeX support.
60  *
61  * Revision 1.26  1994/12/15  12:19:00  john
62  * Added gr_bm_bitblt (clipped!) function.
63  *
64  * Revision 1.25  1994/12/09  18:58:42  matt
65  * Took out include of 3d.h
66  *
67  * Revision 1.24  1994/11/28  17:08:32  john
68  * Took out some unused functions in linear.asm, moved
69  * gr_linear_movsd from linear.asm to bitblt.c, made sure that
70  * the code in ibiblt.c sets the direction flags before rep movsing.
71  *
72  * Revision 1.22  1994/11/23  16:04:00  john
73  * Fixed generic rle'ing to use new bit method.
74  *
75  * Revision 1.21  1994/11/18  22:51:03  john
76  * Changed a bunch of shorts to ints in calls.
77  *
78  * Revision 1.20  1994/11/10  15:59:48  john
79  * Fixed bugs with canvas's being created with bogus bm_flags.
80  *
81  * Revision 1.19  1994/11/09  21:03:35  john
82  * Added RLE for svga gr_ubitmap.
83  *
84  * Revision 1.18  1994/11/09  17:41:29  john
85  * Made a slow version of rle bitblt to svga, modex.
86  *
87  * Revision 1.17  1994/11/09  16:35:15  john
88  * First version with working RLE bitmaps.
89  *
90  * Revision 1.16  1994/11/04  10:06:58  john
91  * Added fade table for fading fonts. Made font that partially clips
92  * not print a warning message.
93  *
94  * Revision 1.15  1994/09/22  16:08:38  john
95  * Fixed some palette stuff.
96  *
97  * Revision 1.14  1994/09/19  11:44:27  john
98  * Changed call to allocate selector to the dpmi module.
99  *
100  * Revision 1.13  1994/08/08  13:03:00  john
101  * Fixed bug in gr_bitmap in modex
102  *
103  * Revision 1.12  1994/07/13  19:47:23  john
104  * Fixed bug with modex bitblt to page 2 not working.
105  *
106  * Revision 1.11  1994/05/31  11:10:52  john
107  * *** empty log message ***
108  *
109  * Revision 1.10  1994/03/18  15:24:34  matt
110  * Removed interlace stuff
111  *
112  * Revision 1.9  1994/02/18  15:32:20  john
113  * *** empty log message ***
114  *
115  * Revision 1.8  1994/02/01  13:22:54  john
116  * *** empty log message ***
117  *
118  * Revision 1.7  1994/01/13  08:28:25  mike
119  * Modify rect copy to copy alternate scanlines when in interlaced mode.
120  *
121  * Revision 1.6  1993/12/28  12:09:46  john
122  * added lbitblt.asm
123  *
124  * Revision 1.5  1993/10/26  13:18:09  john
125  * *** empty log message ***
126  *
127  * Revision 1.4  1993/10/15  16:23:30  john
128  * y
129  *
130  * Revision 1.3  1993/09/13  17:52:58  john
131  * Fixed bug in BitBlt linear to SVGA
132  *
133  * Revision 1.2  1993/09/08  14:47:00  john
134  * Made bitmap00 add rowsize instead of bitmap width.
135  * Other routines might have this problem too.
136  *
137  * Revision 1.1  1993/09/08  11:43:01  john
138  * Initial revision
139
140 ------------------------------------------------------------------------
141 2d/bitmap.c:
142
143  * Revision 1.11  1995/08/23  18:46:06  allender
144  * fixed compiler warning
145  *
146  * Revision 1.10  1995/08/14  14:25:45  allender
147  * changed transparency color to 0
148  *
149  * Revision 1.9  1995/07/05  16:04:51  allender
150  * transparency/game kitchen changes
151  *
152  * Revision 1.8  1995/06/15  09:50:48  allender
153  * new malloc to align bitmap on 8 byte bountry
154  *
155  * Revision 1.7  1995/05/12  11:52:19  allender
156  * changed memory stuff again
157  *
158  * Revision 1.6  1995/05/11  12:48:34  allender
159  * nge transparency color
160  *
161  * Revision 1.5  1995/05/04  19:59:21  allender
162  * use NewPtr instead of malloc
163  *
164  * Revision 1.4  1995/04/27  07:33:04  allender
165  * rearrange functions
166  *
167  * Revision 1.3  1995/04/19  14:37:17  allender
168  * removed dead asm code
169  *
170  * Revision 1.2  1995/04/18  12:04:51  allender
171  * *** empty log message ***
172  *
173  * Revision 1.1  1995/03/09  08:48:06  allender
174  * Initial revision
175  *
176  *
177  * -------  PC version RCS information
178  * Revision 1.17  1994/11/18  22:50:25  john
179  * Changed shorts to ints in parameters.
180  *
181  * Revision 1.16  1994/11/10  15:59:46  john
182  * Fixed bugs with canvas's being created with bogus bm_flags.
183  *
184  * Revision 1.15  1994/10/26  23:55:53  john
185  * Took out roller; Took out inverse table.
186  *
187  * Revision 1.14  1994/09/19  14:40:21  john
188  * Changed dpmi stuff.
189  *
190  * Revision 1.13  1994/09/19  11:44:04  john
191  * Changed call to allocate selector to the dpmi module.
192  *
193  * Revision 1.12  1994/06/09  13:14:57  john
194  * Made selectors zero our
195  * out, I meant.
196  *
197  * Revision 1.11  1994/05/06  12:50:07  john
198  * Added supertransparency; neatend things up; took out warnings.
199  *
200  * Revision 1.10  1994/04/08  16:59:39  john
201  * Add fading poly's; Made palette fade 32 instead of 16.
202  *
203  * Revision 1.9  1994/03/16  17:21:09  john
204  * Added slow palette searching options.
205  *
206  * Revision 1.8  1994/03/14  17:59:35  john
207  * Added function to check bitmap's transparency.
208  *
209  * Revision 1.7  1994/03/14  17:16:21  john
210  * fixed bug with counting freq of pixels.
211  *
212  * Revision 1.6  1994/03/14  16:55:47  john
213  * Changed grs_bitmap structure to include bm_flags.
214  *
215  * Revision 1.5  1994/02/18  15:32:22  john
216  * *** empty log message ***
217  *
218  * Revision 1.4  1993/10/15  16:22:49  john
219  * *** empty log message ***
220  *
221  * Revision 1.3  1993/09/08  17:37:11  john
222  * Checking for errors with Yuan...
223  *
224  * Revision 1.2  1993/09/08  14:46:27  john
225  * looking for possible bugs...
226  *
227  * Revision 1.1  1993/09/08  11:43:05  john
228  * Initial revision
229  *
230
231 ------------------------------------------------------------------------
232 2d/clip.h:
233
234  * Revision 1.3  1993/10/15  16:22:28  john
235  * *** empty log message ***
236  *
237  * Revision 1.2  1993/09/29  16:14:31  john
238  * made work with fix point
239  *
240  * Revision 1.1  1993/09/08  11:40:53  john
241  * Initial revision
242  *
243  *
244
245 ------------------------------------------------------------------------
246 2d/ibitblt.c:
247
248  * Revision 1.3  1995/09/13  11:43:22  allender
249  * start on optimizing cockpit copy code
250  *
251  * Revision 1.2  1995/09/07  10:16:57  allender
252  * fixed up cockpit and rearview hole blitting
253  *
254  * Revision 1.1  1995/08/18  15:50:48  allender
255  * Initial revision
256  *
257  * Revision 1.6  1994/11/28  17:07:29  john
258  * Took out some unused functions in linear.asm, moved
259  * gr_linear_movsd from linear.asm to bitblt.c, made sure that
260  * the code in ibiblt.c sets the direction flags before rep movsing.
261  *
262  * Revision 1.5  1994/11/18  22:50:22  john
263  * Changed shorts to ints in parameters.
264  *
265  * Revision 1.4  1994/11/09  16:35:16  john
266  * First version with working RLE bitmaps.
267  *
268  * Revision 1.3  1994/10/03  17:18:05  john
269  * Fixed bug with edi not getting intialized to zero
270  * in create_mask.
271  *
272  * Revision 1.2  1994/05/31  11:10:55  john
273  * *** empty log message ***
274  *
275  * Revision 1.1  1994/05/30  16:08:27  john
276  * Initial revision
277  *
278
279 ------------------------------------------------------------------------
280 2d/palette.c:
281
282 ; Revision 1.20  1994/11/28  17:08:30  john
283 ; Took out some unused functions in linear.asm, moved
284 ; gr_linear_movsd from linear.asm to bitblt.c, made sure that
285 ; the code in ibiblt.c sets the direction flags before rep movsing.
286
287 ; Revision 1.19  1994/11/27  22:57:56  john
288 ; Took out some code that was never called.
289
290 ; Revision 1.18  1994/09/12  14:40:16  john
291 ; Neatend.
292
293 ; Revision 1.17  1994/07/27  18:30:30  john
294 ; Took away the blending table.
295
296 ; Revision 1.16  1994/04/08  16:59:28  john
297 ; Add fading poly's; Made palette fade 32 instead of 16.
298
299 ; Revision 1.15  1993/12/21  20:10:03  john
300 ; *** empty log message ***
301
302 ; Revision 1.14  1993/12/21  19:58:31  john
303 ; added selector stuff
304
305 ; Revision 1.13  1993/12/21  11:40:51  john
306 ; *** empty log message ***
307
308 ; Revision 1.12  1993/12/09  15:01:52  john
309 ; Changed palette stuff majorly
310
311 ; Revision 1.11  1993/12/08  16:41:02  john
312 ; *** empty log message ***
313
314 ; Revision 1.10  1993/12/08  11:50:17  john
315 ; Fixed bug with gr_init
316
317 ; Revision 1.9  1993/12/07  12:32:12  john
318 ; moved bmd_palette to gr_palette
319
320 ; Revision 1.8  1993/12/03  12:11:25  john
321 ; *** empty log message ***
322
323 ; Revision 1.7  1993/11/16  11:29:08  john
324 ; *** empty log message ***
325
326 ; Revision 1.6  1993/10/15  16:22:13  john
327 ; *** empty log message ***
328
329 ; Revision 1.5  1993/09/29  16:15:28  john
330 ; added assembler linear_line
331
332 ; Revision 1.4  1993/09/26  18:59:27  john
333 ; fade stuff
334
335 ; Revision 1.3  1993/09/21  14:00:59  john
336 ; added code to save 43/50 line text modes.
337
338 ; Revision 1.2  1993/09/16  17:28:06  john
339 ; added code to save/restore video mode
340
341 ; Revision 1.1  1993/09/08  11:41:30  john
342 ; Initial revision
343
344 ------------------------------------------------------------------------
345 2d/palette.c:
346
347  * Revision 1.41  1995/02/02  14:26:31  john
348  * Made palette fades work better with gamma thingy..
349  *
350  * Revision 1.40  1994/12/08  19:03:46  john
351  * Made functions use cfile.
352  *
353  * Revision 1.39  1994/12/01  11:23:27  john
354  * Limited Gamma from 0-8.
355  *
356  * Revision 1.38  1994/11/28  01:31:08  mike
357  * optimize color lookup function, caching recently used colors.
358  *
359  * Revision 1.37  1994/11/18  22:50:18  john
360  * Changed shorts to ints in parameters.
361  *
362  * Revision 1.36  1994/11/15  17:54:59  john
363  * Made text palette fade in when game over.
364  *
365  * Revision 1.35  1994/11/10  19:53:14  matt
366  * Fixed error handling is gr_use_palette_table()
367  *
368  * Revision 1.34  1994/11/07  13:53:48  john
369  * Added better gamma stufff.
370  *
371  * Revision 1.33  1994/11/07  13:37:56  john
372  * Added gamma correction stuff.
373  *
374  * Revision 1.32  1994/11/05  13:20:14  john
375  * Fixed bug with find_closest_color_current not working.
376  *
377  * Revision 1.31  1994/11/05  13:08:09  john
378  * MAde it return 0 when palette already faded out.
379  *
380  * Revision 1.30  1994/11/05  13:05:34  john
381  * Added back in code to allow keys during fade.
382  *
383  * Revision 1.29  1994/11/05  12:49:50  john
384  * Fixed bug with previous comment..
385  *
386  * Revision 1.28  1994/11/05  12:48:46  john
387  * Made palette only fade in / out when its supposed to.
388  *
389  * Revision 1.27  1994/11/05  12:46:43  john
390  * Changed palette stuff a bit.
391  *
392  * Revision 1.26  1994/11/01  12:59:35  john
393  * Reduced palette.256 size.
394  *
395  * Revision 1.25  1994/10/26  23:55:35  john
396  * Took out roller; Took out inverse table.
397  *
398  * Revision 1.24  1994/10/04  22:03:05  matt
399  * Fixed bug: palette wasn't fading all the way out or in
400  *
401  * Revision 1.23  1994/09/22  16:08:40  john
402  * Fixed some palette stuff.
403  *
404  * Revision 1.22  1994/09/19  11:44:31  john
405  * Changed call to allocate selector to the dpmi module.
406  *
407  * Revision 1.21  1994/09/12  19:28:09  john
408  * Fixed bug with unclipped fonts clipping.
409  *
410  * Revision 1.20  1994/09/12  18:18:39  john
411  * Set 254 and 255 to fade to themselves in fadetable
412  *
413  * Revision 1.19  1994/09/12  14:40:10  john
414  * Neatend.
415  *
416  * Revision 1.18  1994/09/09  09:31:55  john
417  * Made find_closest_color not look at superx spot of 254
418  *
419  * Revision 1.17  1994/08/09  11:27:08  john
420  * Add cthru stuff.
421  *
422  * Revision 1.16  1994/08/01  11:03:51  john
423  * MAde it read in old/new palette.256
424  *
425  * Revision 1.15  1994/07/27  18:30:27  john
426  * Took away the blending table.
427  *
428  * Revision 1.14  1994/06/09  10:39:52  john
429  * In fade out.in functions, returned 1 if key was pressed...
430  *
431  * Revision 1.13  1994/05/31  19:04:16  john
432  * Added key to stop fade if desired.
433  *
434  * Revision 1.12  1994/05/06  12:50:20  john
435  * Added supertransparency; neatend things up; took out warnings.
436  *
437  * Revision 1.11  1994/05/03  19:39:02  john
438  * *** empty log message ***
439  *
440  * Revision 1.10  1994/04/22  11:16:07  john
441  * *** empty log message ***
442  *
443  * Revision 1.9  1994/04/08  16:59:40  john
444  * Add fading poly's; Made palette fade 32 instead of 16.
445  *
446  * Revision 1.8  1994/03/16  17:21:17  john
447  * Added slow palette searching options.
448  *
449  * Revision 1.7  1994/01/07  11:47:33  john
450  * made use cflib
451  *
452  * Revision 1.6  1993/12/21  11:41:04  john
453  * *** empty log message ***
454  *
455  * Revision 1.5  1993/12/09  15:02:47  john
456  * Changed palette stuff majorly
457  *
458  * Revision 1.4  1993/12/07  12:31:41  john
459  * moved bmd_palette to gr_palette
460  *
461  * Revision 1.3  1993/10/15  16:22:23  john
462  * *** empty log message ***
463  *
464  * Revision 1.2  1993/09/26  18:59:46  john
465  * fade stuff
466  *
467  * Revision 1.1  1993/09/08  11:44:03  john
468  * Initial revision
469  *
470
471 ------------------------------------------------------------------------
472 2d/pcx.c:
473
474  * Revision 1.6  1995/03/01  15:38:12  john
475  * Better ModeX support.
476  *
477  * Revision 1.5  1995/01/21  17:54:17  john
478  * Added pcx reader for modes other than modex.
479  *
480  * Revision 1.4  1994/12/08  19:03:56  john
481  * Made functions use cfile.
482  *
483  * Revision 1.3  1994/11/29  02:53:24  john
484  * Added error messages; made call be more similiar to iff.
485  *
486  * Revision 1.2  1994/11/28  20:03:50  john
487  * Added PCX functions.
488  *
489  * Revision 1.1  1994/11/28  19:57:56  john
490  * Initial revision
491  *
492
493 ------------------------------------------------------------------------
494 2d/rle.c:
495
496  * Changed shorts to ints in parameters.
497  *
498  *
499  * Old Log:
500  * Revision 1.10  1995/08/14  14:26:34  allender
501  * changed transparency color to 0
502  *
503  * Revision 1.9  1995/07/05  16:07:49  allender
504  * transparency/kitchen chagnes
505  *
506  * Revision 1.8  1995/05/12  11:54:03  allender
507  * changed memory stuff again
508  *
509  * Revision 1.7  1995/05/11  12:49:19  allender
510  * change transparency color
511  *
512  * Revision 1.6  1995/05/04  20:00:30  allender
513  * use NewPtr instead of malloc.  Fix gr_rle_scanline (which caused me
514  * *many* hours of frustration!!!!)
515  *
516  * Revision 1.5  1995/05/01  08:40:32  allender
517  * trying to find memory bug....this stuff works -- it's johns code
518  *
519  * Revision 1.4  1995/04/27  07:38:24  allender
520  * new rle code ala John
521  *
522  * Revision 1.3  1995/04/19  14:36:06  allender
523  * *** empty log message ***
524  *
525  * Revision 1.2  1995/04/18  12:08:30  allender
526  * *** empty log message ***
527  *
528  * Revision 1.1  1995/03/09  09:23:04  allender
529  * Initial revision
530  *
531  *
532  * --- PC RCS information ---
533  * Revision 1.19  1995/01/14  19:18:31  john
534  * Added assert to check for paged out bitmap.
535  *
536  * Revision 1.18  1995/01/14  11:32:07  john
537  * Added rle_cache_flush function.
538  *
539  * Revision 1.17  1994/12/13  10:58:27  john
540  * Fixed bug with 2 consecutive calls to get_expanded_Texture
541  * with 2 different bitmaps, returning the same rle texture,
542  * causing doors to disapper.
543  *
544  * Revision 1.16  1994/11/30  00:55:03  mike
545  * optimization
546  *
547  * Revision 1.15  1994/11/24  13:24:44  john
548  * Made sure that some rep movs had the cld set first.
549  * Took some unused functions out.
550  *
551  * Revision 1.14  1994/11/23  16:03:46  john
552  * Fixed generic rle'ing to use new bit method.
553  *
554  * Revision 1.13  1994/11/23  15:45:51  john
555  * Changed to a 3 bit rle scheme.
556  *
557  * Revision 1.12  1994/11/18  22:50:24  john
558  * Changed shorts to ints in parameters.
559  *
560  * Revision 1.11  1994/11/14  17:06:13  john
561  * Took out Key_f12.
562  *
563  * Revision 1.10  1994/11/14  15:54:09  john
564  * Put code in for maybe checking bogus rle data.
565  *
566  * Revision 1.9  1994/11/14  15:51:58  john
567  * Added rle_disable_caching variable to prove the stability of my rle
568  * caching code to any non-believers.
569  *
570  * Revision 1.8  1994/11/10  10:31:20  john
571  * Reduce cache buffers to 16.
572  *
573  * Revision 1.7  1994/11/09  19:53:43  john
574  * Added texture rle caching.
575  *
576  * Revision 1.6  1994/11/09  17:41:44  john
577  * Made a slow version of rle bitblt to svga, modex.
578  *
579  * Revision 1.5  1994/11/09  17:07:50  john
580  * Fixed bug with bitmap that gets bigger with rle.
581  *
582  * Revision 1.4  1994/11/09  16:35:17  john
583  * First version with working RLE bitmaps.
584  *
585  * Revision 1.3  1994/10/26  12:54:47  john
586  * Fixed bug with decode that used rep movsd instead of
587  * rep stosd.
588  *
589  * Revision 1.2  1994/10/06  17:05:25  john
590  * First version of rle stuff.
591  *
592  * Revision 1.1  1994/10/06  16:53:34  john
593  * Initial revision
594
595 ------------------------------------------------------------------------
596 2d/scale.c:
597
598  * Revision 1.12  1995/03/14  15:14:11  john
599  * Increased max scanline length to 640.
600  * ..
601  * 
602  * Revision 1.11  1994/11/27  12:56:39  matt
603  * Took out unneeded include of 3d.h
604  * 
605  * Revision 1.10  1994/11/18  22:50:25  john
606  * Changed shorts to ints in parameters.
607  * 
608  * Revision 1.9  1994/11/09  16:35:02  john
609  * First version with working RLE bitmaps.
610  * 
611  * Revision 1.8  1994/06/09  13:15:17  john
612  * *** empty log message ***
613  * 
614  * Revision 1.7  1994/06/07  11:47:02  john
615  * Added back in the fast code for scaling up bitmaps.
616  * 
617  * Revision 1.6  1994/02/18  15:32:36  john
618  * *** empty log message ***
619  * 
620  * Revision 1.5  1994/01/22  14:35:01  john
621  * Added transparency as color index 255.
622  * 
623  * Revision 1.4  1994/01/17  16:59:12  john
624  * once again...
625  * 
626  * Revision 1.3  1994/01/17  16:51:17  john
627  * Added check so we don't draw outsibe
628  * the source bitmap's v coordinate... kind
629  * of a hack, but works.
630  * 
631  * Revision 1.2  1994/01/12  18:03:26  john
632  * The first iteration of fast scaler..
633  * 
634  * Revision 1.1  1994/01/11  14:48:42  john
635  * Initial revision
636
637 ------------------------------------------------------------------------
638 2d/scalea.asm:
639
640 ; Revision 1.2  1994/01/12  18:02:52  john
641 ; Asm code for the scaler... first iteration here
642 ; has compiled code that works!!
643
644 ; Revision 1.1  1994/01/12  12:20:11  john
645 ; Initial revision
646
647 ------------------------------------------------------------------------
648 3d/clipper.h:
649
650  * Revision 1.1  1995/05/05  08:50:13  allender
651  * Initial revision
652  *
653  * Revision 1.1  1995/04/17  19:56:58  matt
654  * Initial revision
655  * 
656  * 
657
658 ------------------------------------------------------------------------
659 3d/globvars.c:
660
661  * Revision 1.2  1995/09/13  11:30:47  allender
662  * added fCanv_w2 and vCanv_h2 for PPC implementation
663  *
664  * Revision 1.1  1995/05/05  08:50:48  allender
665  * Initial revision
666  *
667  * Revision 1.1  1995/04/17  04:24:57  matt
668  * Initial revision
669
670 ------------------------------------------------------------------------
671 3d/globvars.h:
672
673  * Revision 1.2  1995/09/13  11:31:19  allender
674  * added fCanv_w2 and vCanv_h2 for PPC implementation
675  *
676  * Revision 1.1  1995/05/05  08:51:02  allender
677  * Initial revision
678  *
679  * Revision 1.1  1995/04/17  04:07:58  matt
680  * Initial revision
681
682 ------------------------------------------------------------------------
683 3d/instance.c:
684
685  * Revision 1.2  1995/06/12  12:36:57  allender
686  * fixed bug where g3_start_instance_angles recursively called itself
687  *
688  * Revision 1.1  1995/05/05  08:51:27  allender
689  * Initial revision
690  *
691  * Revision 1.1  1995/04/17  06:43:29  matt
692  * Initial revision
693
694 ------------------------------------------------------------------------
695 3d/interp.c:
696
697  * Revision 1.4  1995/10/10  22:20:09  allender
698  * new morphing code from Matt
699  *
700  * Revision 1.3  1995/08/31  15:40:24  allender
701  * swap color data correctly
702  *
703  * Revision 1.2  1995/05/11  13:06:38  allender
704  * fix int --> short problem
705  *
706  * Revision 1.1  1995/05/05  08:51:41  allender
707  * Initial revision
708  *
709  * Revision 1.1  1995/04/17  06:44:33  matt
710  * Initial revision
711
712 ------------------------------------------------------------------------
713 3d/matrix.c:
714
715  * Revision 1.1  1995/05/05  08:52:11  allender
716  * Initial revision
717  *
718  * Revision 1.1  1995/04/17  04:14:34  matt
719  * Initial revision
720
721 ------------------------------------------------------------------------
722 3d/points.c:
723
724  * Revision 1.3  1995/09/21  17:29:40  allender
725  * changed project_point to overflow if z <= 0
726  *
727  * Revision 1.2  1995/09/13  11:31:28  allender
728  * removed checkmuldiv from g3_project_point
729  *
730  * Revision 1.1  1995/05/05  08:52:35  allender
731  * Initial revision
732  *
733  * Revision 1.1  1995/04/17  04:32:25  matt
734  * Initial revision
735
736 ------------------------------------------------------------------------
737 3d/rod.c:
738
739  * Revision 1.2  1995/09/13  11:31:46  allender
740  * removed checkmuldiv in PPC implemenation
741  *
742  * Revision 1.1  1995/05/05  08:52:45  allender
743  * Initial revision
744  *
745  * Revision 1.1  1995/04/17  06:42:08  matt
746  * Initial revision
747
748 ------------------------------------------------------------------------
749 3d/setup.c:
750
751  * Revision 1.4  1995/10/11  00:27:04  allender
752  * bash free_num_points to 0
753  *
754  * Revision 1.3  1995/09/13  11:31:58  allender
755  * calc for fCanv_w2 and fCanv_h2
756  *
757  * Revision 1.2  1995/06/25  21:57:57  allender
758  * *** empty log message ***
759  *
760  * Revision 1.1  1995/05/05  08:52:54  allender
761  * Initial revision
762  *
763  * Revision 1.1  1995/04/17  03:59:01  matt
764  * Initial revision
765
766 ------------------------------------------------------------------------
767 arch/dos/bak/ipx.c:
768
769  * Revision 2.10  1995/03/29  17:27:55  john
770  * Added code to not duplicate broadcasts.
771  *
772  * Revision 2.9  1995/03/29  15:32:07  john
773  * NEatened.
774  *
775  * Revision 2.8  1995/03/29  15:07:31  john
776  * Added network support.
777  *
778  * Revision 2.7  1995/03/29  11:22:27  john
779  * Added broadcasting over a net.
780  *
781  * Revision 2.6  1995/03/28  20:05:03  john
782  * Took away alternate server stuff.
783  *
784  * Revision 2.5  1995/03/23  19:14:29  john
785  * Added better MAX_USERS message.
786  *
787  * Revision 2.4  1995/03/23  19:00:02  john
788  * Added user list capabitly.
789  *
790  * Revision 2.3  1995/03/23  12:27:05  john
791  * Move IPX into bios lib.
792  *
793  * Revision 2.2  1995/03/22  19:08:15  john
794  * Added code to fix sending packets over router... now
795  * we just need to make broadcasts go over router!!
796  *
797  * Revision 2.1  1995/03/21  08:40:16  john
798  * Ifdef'd out the NETWORK code.
799  *
800  * Revision 2.0  1995/02/27  11:30:45  john
801  * New version 2.0, which has no anonymous unions, builds with
802  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
803  *
804  * Revision 1.31  1995/02/16  17:35:03  john
805  * Added code to allow dynamic socket changing.
806  *
807  * Revision 1.30  1995/02/01  21:03:45  john
808  * Lintified.
809  *
810  * Revision 1.29  1995/01/22  14:31:05  john
811  * Added key.h
812  *
813  * Revision 1.28  1995/01/22  14:29:26  john
814  * Added code to bypass broadcast messages.
815  *
816  * Revision 1.27  1995/01/03  13:46:16  john
817  * Added code that should make ipx work over different servers,
818  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
819  * this, and I hope it doesn't introduce net bugs.
820  *
821  * Revision 1.26  1994/12/14  11:54:37  rob
822  * Reduce # of ipx packets.
823  *
824  * Revision 1.25  1994/12/11  00:43:28  john
825  * Locked down DOS ipx buffers... probably not necessary, tho.
826  *
827  * Revision 1.24  1994/12/08  15:49:58  rob
828  * Bumped up the # of ipx packets.
829  *
830  * Revision 1.23  1994/12/04  15:23:54  rob
831  * Reduced packet # constants.
832  *
833  * Revision 1.22  1994/11/27  23:12:39  matt
834  * Made changes for new mprintf calling convention
835  *
836  * Revision 1.21  1994/11/19  15:15:19  mike
837  * remove unused code and data
838  *
839  * Revision 1.20  1994/11/10  11:06:07  rob
840  * Raised number of ipx packets to 64 and buffers to 128 (for 8-way games)
841  * Removed (commented out) all the spx support stuff.
842  *
843  * Revision 1.19  1994/11/07  17:50:12  rob
844  * Bumped up max_packets and ipx_num_packets to double their previous
845  * values.
846  *
847  * Revision 1.18  1994/11/07  15:39:01  rob
848  * Removed temporary hacked ipx_send_object function.
849  * Replaced with a more general thing.
850  *
851  * Revision 1.17  1994/11/05  16:08:40  rob
852  * Made a change necessary for object syncing on rejoin.
853  *
854  * Revision 1.16  1994/11/01  15:57:12  rob
855  * Added support for SPX sockets for critical messages.
856  *
857  * Revision 1.15  1994/10/31  19:21:01  rob
858  * Added a routine for sending objects via ipx.  Its a hack and shoukld
859  * be replaced by something more general time permitting.
860  *
861  * Revision 1.14  1994/10/20  14:57:42  john
862  * Some test stuff.
863  *
864  * Revision 1.13  1994/10/20  11:22:45  john
865  * Tweaked the number of waiting packets. Added code to print
866  * total packets missed, and to limit the packet send rate to
867  * 10 packets per second unless firing.
868  *
869  * Revision 1.12  1994/10/03  20:50:11  john
870  * Started adding sound pause functions.
871  *
872  * Revision 1.11  1994/09/15  08:54:24  mike
873  * comment out a mprintf.
874  *
875  * Revision 1.10  1994/09/12  19:38:20  john
876  * Made some stuff that prints to the DOS screen go to the
877  * mono instead, since it really is debugging info.
878  *
879  * Revision 1.9  1994/09/07  13:32:03  john
880  * Made ipx_close explicitly close the socket we were using,
881  * because it seems that VLM's don't automatically close them
882  * like the older NETX stuff did (Going from Novell 3.11 driver
883  * to 3.12 anyway).
884  *
885  * Revision 1.8  1994/09/06  19:29:20  john
886  * Added trial version of rejoin function.
887  *
888  * Revision 1.7  1994/08/09  19:31:50  john
889  * Networking changes.
890  *
891  * Revision 1.6  1994/08/05  16:11:41  john
892  * Psuedo working version of networking.
893  *
894  * Revision 1.5  1994/08/04  19:17:21  john
895  * Inbetween version of network stuff.
896  *
897  * Revision 1.4  1994/07/29  16:08:57  john
898  * *** empty log message ***
899  *
900  * Revision 1.3  1994/07/25  12:33:31  john
901  * Network "pinging" in.
902  *
903  * Revision 1.2  1994/07/20  15:58:28  john
904  * First installment of ipx stuff.
905  *
906  * Revision 1.1  1994/07/19  15:42:00  john
907  * Initial revision
908
909 ------------------------------------------------------------------------
910 arch/dos/ipx.c:
911
912  * Revision 2.10  1995/03/29  17:27:55  john
913  * Added code to not duplicate broadcasts.
914  *
915  * Revision 2.9  1995/03/29  15:32:07  john
916  * NEatened.
917  *
918  * Revision 2.8  1995/03/29  15:07:31  john
919  * Added network support.
920  *
921  * Revision 2.7  1995/03/29  11:22:27  john
922  * Added broadcasting over a net.
923  *
924  * Revision 2.6  1995/03/28  20:05:03  john
925  * Took away alternate server stuff.
926  *
927  * Revision 2.5  1995/03/23  19:14:29  john
928  * Added better MAX_USERS message.
929  *
930  * Revision 2.4  1995/03/23  19:00:02  john
931  * Added user list capabitly.
932  *
933  * Revision 2.3  1995/03/23  12:27:05  john
934  * Move IPX into bios lib.
935  *
936  * Revision 2.2  1995/03/22  19:08:15  john
937  * Added code to fix sending packets over router... now
938  * we just need to make broadcasts go over router!!
939  *
940  * Revision 2.1  1995/03/21  08:40:16  john
941  * Ifdef'd out the NETWORK code.
942  *
943  * Revision 2.0  1995/02/27  11:30:45  john
944  * New version 2.0, which has no anonymous unions, builds with
945  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
946  *
947  * Revision 1.31  1995/02/16  17:35:03  john
948  * Added code to allow dynamic socket changing.
949  *
950  * Revision 1.30  1995/02/01  21:03:45  john
951  * Lintified.
952  *
953  * Revision 1.29  1995/01/22  14:31:05  john
954  * Added key.h
955  *
956  * Revision 1.28  1995/01/22  14:29:26  john
957  * Added code to bypass broadcast messages.
958  *
959  * Revision 1.27  1995/01/03  13:46:16  john
960  * Added code that should make ipx work over different servers,
961  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
962  * this, and I hope it doesn't introduce net bugs.
963  *
964  * Revision 1.26  1994/12/14  11:54:37  rob
965  * Reduce # of ipx packets.
966  *
967  * Revision 1.25  1994/12/11  00:43:28  john
968  * Locked down DOS ipx buffers... probably not necessary, tho.
969  *
970  * Revision 1.24  1994/12/08  15:49:58  rob
971  * Bumped up the # of ipx packets.
972  *
973  * Revision 1.23  1994/12/04  15:23:54  rob
974  * Reduced packet # constants.
975  *
976  * Revision 1.22  1994/11/27  23:12:39  matt
977  * Made changes for new mprintf calling convention
978  *
979  * Revision 1.21  1994/11/19  15:15:19  mike
980  * remove unused code and data
981  *
982  * Revision 1.20  1994/11/10  11:06:07  rob
983  * Raised number of ipx packets to 64 and buffers to 128 (for 8-way games)
984  * Removed (commented out) all the spx support stuff.
985  *
986  * Revision 1.19  1994/11/07  17:50:12  rob
987  * Bumped up max_packets and ipx_num_packets to double their previous
988  * values.
989  *
990  * Revision 1.18  1994/11/07  15:39:01  rob
991  * Removed temporary hacked ipx_send_object function.
992  * Replaced with a more general thing.
993  *
994  * Revision 1.17  1994/11/05  16:08:40  rob
995  * Made a change necessary for object syncing on rejoin.
996  *
997  * Revision 1.16  1994/11/01  15:57:12  rob
998  * Added support for SPX sockets for critical messages.
999  *
1000  * Revision 1.15  1994/10/31  19:21:01  rob
1001  * Added a routine for sending objects via ipx.  Its a hack and shoukld
1002  * be replaced by something more general time permitting.
1003  *
1004  * Revision 1.14  1994/10/20  14:57:42  john
1005  * Some test stuff.
1006  *
1007  * Revision 1.13  1994/10/20  11:22:45  john
1008  * Tweaked the number of waiting packets. Added code to print
1009  * total packets missed, and to limit the packet send rate to
1010  * 10 packets per second unless firing.
1011  *
1012  * Revision 1.12  1994/10/03  20:50:11  john
1013  * Started adding sound pause functions.
1014  *
1015  * Revision 1.11  1994/09/15  08:54:24  mike
1016  * comment out a mprintf.
1017  *
1018  * Revision 1.10  1994/09/12  19:38:20  john
1019  * Made some stuff that prints to the DOS screen go to the
1020  * mono instead, since it really is debugging info.
1021  *
1022  * Revision 1.9  1994/09/07  13:32:03  john
1023  * Made ipx_close explicitly close the socket we were using,
1024  * because it seems that VLM's don't automatically close them
1025  * like the older NETX stuff did (Going from Novell 3.11 driver
1026  * to 3.12 anyway).
1027  *
1028  * Revision 1.8  1994/09/06  19:29:20  john
1029  * Added trial version of rejoin function.
1030  *
1031  * Revision 1.7  1994/08/09  19:31:50  john
1032  * Networking changes.
1033  *
1034  * Revision 1.6  1994/08/05  16:11:41  john
1035  * Psuedo working version of networking.
1036  *
1037  * Revision 1.5  1994/08/04  19:17:21  john
1038  * Inbetween version of network stuff.
1039  *
1040  * Revision 1.4  1994/07/29  16:08:57  john
1041  * *** empty log message ***
1042  *
1043  * Revision 1.3  1994/07/25  12:33:31  john
1044  * Network "pinging" in.
1045  *
1046  * Revision 1.2  1994/07/20  15:58:28  john
1047  * First installment of ipx stuff.
1048  *
1049  * Revision 1.1  1994/07/19  15:42:00  john
1050  * Initial revision
1051
1052 ------------------------------------------------------------------------
1053 arch/dos/ipx.h:
1054
1055  * $Log: not supported by cvs2svn $
1056  * Revision 1.3  2004/08/29 14:03:51  schaffner
1057  * move more old change logs into ChangeLog-old
1058  *
1059  * Revision 1.2  2004/08/28 23:37:35  schaffner
1060  * move old per-file change logs into new file ChangeLog-old
1061  *
1062  * Revision 1.1  2004/08/28 23:17:45  schaffner
1063  * move old per-file change logs into new file ChangeLog-old
1064  *
1065  * Revision 1.1.1.1  2001/01/19 03:30:15  bradleyb
1066  * Import of d2x-0.0.8
1067  *
1068  * Revision 1.1.1.1  1999/06/14 21:58:39  donut
1069  * Import of d1x 1.37 source.
1070  *
1071  * Revision 2.6  1995/03/29  11:19:32  john
1072  * Added broadcasting over a net.
1073  * 
1074  * Revision 2.5  1995/03/28  20:04:43  john
1075  * Took away alternate server stuff.
1076  * 
1077  * Revision 2.4  1995/03/23  19:00:10  john
1078  * Added user list capabitly.
1079  * 
1080  * Revision 2.3  1995/03/23  12:26:57  john
1081  * Move IPX into bios lib.
1082  * 
1083  * Revision 2.2  1995/03/22  19:08:14  john
1084  * Added code to fix sending packets over router... now
1085  * we just need to make broadcasts go over router!!
1086  * 
1087  * Revision 2.1  1995/03/21  08:39:56  john
1088  * Ifdef'd out the NETWORK code.
1089  * 
1090  * Revision 2.0  1995/02/27  11:30:16  john
1091  * New version 2.0, which has no anonymous unions, builds with
1092  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1093  * 
1094  * Revision 1.16  1995/02/16  17:34:52  john
1095  * Added code to allow dynamic socket changing.
1096  * 
1097  * Revision 1.15  1995/01/04  21:43:27  rob
1098  * Remove SPX size definition.
1099  * 
1100  * Revision 1.14  1995/01/03  13:46:18  john
1101  * Added code that should make ipx work over different servers,
1102  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
1103  * this, and I hope it doesn't introduce net bugs.
1104  * 
1105  * Revision 1.13  1994/11/02  11:37:16  rob
1106  * Changed default socket number to a higher regions.
1107  * 
1108  * Revision 1.12  1994/11/01  15:56:51  rob
1109  * Added defines for SPX socketsx.
1110  * 
1111  * Revision 1.11  1994/10/31  19:23:31  rob
1112  * Added a prototype for the new object send function.
1113  * 
1114  * Revision 1.10  1994/09/07  13:37:25  john
1115  * Changed default socket to 0x4000, because 
1116  * the ipx/spx book says that we can only use
1117  * sockets 0x4000 - 0x7fff.
1118  * 
1119  * Revision 1.9  1994/08/25  18:14:45  matt
1120  * Changed socket because of packet change
1121  * 
1122  * Revision 1.8  1994/08/12  22:42:24  john
1123  * Took away Player_stats; added Players array.
1124  * 
1125  * Revision 1.7  1994/08/09  19:31:47  john
1126  * Networking changes.
1127  * 
1128  * Revision 1.6  1994/08/05  16:11:46  john
1129  * Psuedo working version of networking.
1130  * 
1131  * Revision 1.5  1994/08/04  19:17:20  john
1132  * Inbetween version of network stuff.
1133  * 
1134  * Revision 1.4  1994/07/29  16:08:59  john
1135  * *** empty log message ***
1136  * 
1137  * Revision 1.3  1994/07/25  12:33:22  john
1138  * Network "pinging" in.
1139  * 
1140  * Revision 1.2  1994/07/20  15:58:29  john
1141  * First installment of ipx stuff.
1142  * 
1143  * Revision 1.1  1994/07/19  15:43:05  john
1144  * Initial revision
1145
1146 ------------------------------------------------------------------------
1147 arch/dos/joy.c:
1148
1149  * $Log: not supported by cvs2svn $
1150  * Revision 1.3  2004/08/29 14:03:51  schaffner
1151  * move more old change logs into ChangeLog-old
1152  *
1153  * Revision 1.2  2004/08/28 23:37:35  schaffner
1154  * move old per-file change logs into new file ChangeLog-old
1155  *
1156  * Revision 1.1  2004/08/28 23:17:45  schaffner
1157  * move old per-file change logs into new file ChangeLog-old
1158  *
1159  * Revision 1.5  2004/05/22 01:40:12  btb
1160  * use JOY_NUM_AXES instead of 4 in joy_(get|set)_cal_vals (d1x r1.3, r1.4)
1161  *
1162  * Revision 1.4  2001/10/24 09:25:05  bradleyb
1163  * Moved input stuff to arch subdirs, as in d1x.
1164  *
1165  * Revision 1.3  2001/01/29 14:03:56  bradleyb
1166  * Fixed build, minor fixes
1167  *
1168  * Revision 1.2  2001/01/24 04:29:45  bradleyb
1169  * changed args_find to FindArg
1170  *
1171  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1172  * Import of d2x-0.0.9-pre1
1173  *
1174  * Revision 1.1.1.1  1999/06/14 21:58:26  donut
1175  * Import of d1x 1.37 source.
1176  *
1177  * Revision 1.37  1995/10/07  13:22:31  john
1178  * Added new method of reading joystick that allows higher-priority
1179  * interrupts to go off.
1180  * 
1181  * Revision 1.36  1995/03/30  11:03:40  john
1182  * Made -JoyBios read buttons using BIOS.
1183  * 
1184  * Revision 1.35  1995/02/14  11:39:25  john
1185  * Added polled/bios joystick readers..
1186  * 
1187  * Revision 1.34  1995/02/10  17:06:12  john
1188  * Fixed bug with plugging in a joystick not getting detected.
1189  * 
1190  * Revision 1.33  1995/01/27  16:39:42  john
1191  * Made so that if no joystick detected, it wont't
1192  * read buttons.
1193  * 
1194  * Revision 1.32  1995/01/12  13:16:40  john
1195  * Made it so that joystick can't lose an axis
1196  * by 1 weird reading. Reading has to occurr during
1197  * calibration for this to happen.
1198  * 
1199  * Revision 1.31  1994/12/28  15:56:03  john
1200  * Fixed bug that refused to read joysticks whose 
1201  * min,cen,max were less than 100 apart.
1202  * 
1203  * Revision 1.30  1994/12/28  15:31:53  john
1204  * Added code to read joystick axis not all at one time.
1205  * 
1206  * Revision 1.29  1994/12/27  15:44:36  john
1207  * Made the joystick timeout be at 1/100th of a second, 
1208  * regardless of CPU speed.
1209  * 
1210  * Revision 1.28  1994/12/04  11:54:54  john
1211  * Made stick read at whatever rate the clock is at, not
1212  * at 18.2 times/second.
1213  * 
1214  * Revision 1.27  1994/11/29  02:25:40  john
1215  * Made it so that the scaled reading returns 0 
1216  * if the calibration factors look funny..
1217  * 
1218  * Revision 1.26  1994/11/22  11:08:07  john
1219  * Commented out the ARCADE joystick.
1220  * 
1221  * Revision 1.25  1994/11/14  19:40:26  john
1222  * Fixed bug with no joystick being detected.
1223  * 
1224  * Revision 1.24  1994/11/14  19:36:40  john
1225  * Took out initial cheapy calibration.
1226  * 
1227  * Revision 1.23  1994/11/14  19:13:27  john
1228  * Took out the calibration in joy_init
1229  * 
1230  * Revision 1.22  1994/10/17  10:09:57  john
1231  * Made the state look at last_State, so that a joy_flush
1232  * doesn't cause a new down state to be added next reading.
1233  * 
1234  * Revision 1.21  1994/10/13  11:36:23  john
1235  * Made joy_down_time be kept track of in fixed seconds,
1236  * not ticks.
1237  * 
1238  * Revision 1.20  1994/10/12  16:58:50  john
1239  * Fixed bug w/ previous comment.
1240  * 
1241  * Revision 1.19  1994/10/12  16:57:44  john
1242  * Added function to set a joystick button's state.
1243  * 
1244  * Revision 1.18  1994/10/11  10:20:13  john
1245  * Fixed Flightstick Pro/
1246  * ..
1247  * 
1248  * Revision 1.17  1994/09/29  18:29:20  john
1249  * *** empty log message ***
1250  * 
1251  * Revision 1.16  1994/09/27  19:17:23  john
1252  * Added code so that is joy_init is never called, joystick is not
1253  * used at all.
1254  * 
1255  * Revision 1.15  1994/09/22  16:09:23  john
1256  * Fixed some virtual memory lockdown problems with timer and
1257  * joystick.
1258  * 
1259  * Revision 1.14  1994/09/16  11:44:42  john
1260  * Fixed bug with slow joystick.
1261  * 
1262  * Revision 1.13  1994/09/16  11:36:15  john
1263  * Fixed bug with reading non-present channels.
1264  * 
1265  * Revision 1.12  1994/09/15  20:52:48  john
1266  * rme john
1267  * Added support for the Arcade style joystick.
1268  * 
1269  * Revision 1.11  1994/09/13  20:04:49  john
1270  * Fixed bug with joystick button down_time.
1271  * 
1272  * Revision 1.10  1994/09/10  13:48:07  john
1273  * Made all 20 buttons read.
1274  * 
1275  * Revision 1.9  1994/08/31  09:55:02  john
1276  * *** empty log message ***
1277  * 
1278  * Revision 1.8  1994/08/29  21:02:14  john
1279  * Added joy_set_cal_values...
1280  * 
1281  * Revision 1.7  1994/08/29  20:52:17  john
1282  * Added better cyberman support; also, joystick calibration
1283  * value return funcctiionn,
1284  * 
1285  * Revision 1.6  1994/08/24  18:53:12  john
1286  * Made Cyberman read like normal mouse; added dpmi module; moved
1287  * mouse from assembly to c. Made mouse buttons return time_down.
1288  * 
1289  * Revision 1.5  1994/07/14  22:12:23  john
1290  * Used intrinsic forms of outp to fix vmm error.
1291  * 
1292  * Revision 1.4  1994/07/07  19:52:59  matt
1293  * Made joy_init() return success/fail flag
1294  * Made joy_init() properly detect a stick if one is plugged in after joy_init()
1295  * was called the first time.
1296  * 
1297  * Revision 1.3  1994/07/01  10:55:55  john
1298  * Fixed some bugs... added support for 4 axis.
1299  * 
1300  * Revision 1.2  1994/06/30  20:36:55  john
1301  * Revamped joystick code.
1302  * 
1303  * Revision 1.1  1994/06/30  15:42:15  john
1304  * Initial revision
1305
1306 ------------------------------------------------------------------------
1307 arch/dos/joydefs.c:
1308
1309  * $Log: not supported by cvs2svn $
1310  * Revision 1.3  2004/08/29 14:03:51  schaffner
1311  * move more old change logs into ChangeLog-old
1312  *
1313  * Revision 1.2  2004/08/28 23:37:35  schaffner
1314  * move old per-file change logs into new file ChangeLog-old
1315  *
1316  * Revision 1.1  2004/08/28 23:17:45  schaffner
1317  * move old per-file change logs into new file ChangeLog-old
1318  *
1319  * Revision 1.3  2001/10/24 09:25:05  bradleyb
1320  * Moved input stuff to arch subdirs, as in d1x.
1321  *
1322  * Revision 1.2  2001/01/29 14:03:57  bradleyb
1323  * Fixed build, minor fixes
1324  *
1325  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1326  * Import of d2x-0.0.9-pre1
1327  *
1328  * Revision 1.1.1.1  1999/06/14 21:58:29  donut
1329  * Import of d1x 1.37 source.
1330  *
1331  * Revision 2.2  1995/06/30  12:30:22  john
1332  * Added -Xname command line.
1333  * 
1334  * Revision 2.1  1995/04/06  12:13:20  john
1335  * Made so you can calibrate Gravis Gamepad.
1336  * 
1337  * Revision 2.0  1995/02/27  11:30:27  john
1338  * New version 2.0, which has no anonymous unions, builds with
1339  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1340  * 
1341  * Revision 1.71  1995/02/12  02:06:10  john
1342  * Fixed bug with joystick incorrectly asking for
1343  * calibration.
1344  * 
1345  * Revision 1.70  1995/01/28  15:58:07  john
1346  * Made joystick calibration be only when wrong detected in
1347  * menu or joystick axis changed.
1348  * 
1349  * Revision 1.69  1995/01/25  14:37:55  john
1350  * Made joystick only prompt for calibration once...
1351  * 
1352  * Revision 1.68  1995/01/24  16:34:29  john
1353  * Made so that if you reconfigure joystick and
1354  * add or subtract an axis, it asks for a recalibration
1355  * upon leaving.
1356  * 
1357  * Revision 1.67  1994/12/29  11:08:51  john
1358  * Fixed Thrustmaster and Logitech Wingman extreme
1359  * Hat by reading the y2 axis during the center stage
1360  * of the calibration, and using 75, 50, 27, and 3 %
1361  * as values for the 4 positions.
1362  * 
1363  * Revision 1.66  1994/12/15  18:17:39  john
1364  * Fixed warning with previous.
1365  * 
1366  * Revision 1.65  1994/12/15  18:15:48  john
1367  * Made the joy cal only write the .cfg file, not
1368  * the player file.
1369  * 
1370  * Revision 1.64  1994/12/13  14:43:35  john
1371  * Took out the code in kconfig to build direction array.
1372  * Called kc_set_controls after selecting a new control type.
1373  * 
1374  * Revision 1.63  1994/12/10  12:08:47  john
1375  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
1376  * 
1377  * Revision 1.62  1994/12/09  11:01:07  mike
1378  * force calibration of joystick on joystick selection from Controls... menu.
1379  * 
1380  * Revision 1.61  1994/12/07  21:50:27  john
1381  * Put stop/start time around joystick delay.
1382  * 
1383  * Revision 1.60  1994/12/07  19:34:39  john
1384  * Added delay.
1385  * 
1386  * Revision 1.59  1994/12/07  18:12:14  john
1387  * NEatened up joy cal.,
1388  * 
1389  * Revision 1.58  1994/12/07  17:07:51  john
1390  * Fixed up joy cal.
1391  * 
1392  * Revision 1.57  1994/12/07  16:48:53  yuan
1393  * localization
1394  * 
1395  * Revision 1.56  1994/12/07  16:05:55  john
1396  * Changed the way joystick calibration works.
1397  * 
1398  * Revision 1.55  1994/12/06  20:15:22  john
1399  * Took out code that unpauses songs that were never paused.
1400  * 
1401  * Revision 1.54  1994/12/06  15:14:09  yuan
1402  * Localization
1403  * 
1404  * Revision 1.53  1994/12/05  16:29:16  john
1405  * Took out music pause around the cheat menu.
1406  * 
1407  * Revision 1.52  1994/12/04  12:39:10  john
1408  * MAde so that FCS calibration doesn't ask for axis #2.
1409  * 
1410  * Revision 1.51  1994/12/03  15:14:59  john
1411  * Took out the delay mentioned previosuly cause it would
1412  * cause bigger problems than it helps, especially with netgames.
1413  * 
1414  * Revision 1.50  1994/12/03  14:16:14  john
1415  * Put a delay between screens in joy cal to keep Yuan from
1416  * double hitting.
1417  * 
1418  * Revision 1.49  1994/12/03  11:04:06  john
1419  * Changed newmenu code a bit to fix bug with bogus
1420  * backgrounds occcasionally.
1421  * 
1422  * Revision 1.48  1994/12/02  11:03:44  yuan
1423  * Localization.
1424  * 
1425  * Revision 1.47  1994/12/02  10:50:33  yuan
1426  * Localization
1427  * 
1428  * Revision 1.46  1994/12/01  12:21:59  john
1429  * Added code to calibrate 2 joysticks separately.
1430  * 
1431  * Revision 1.45  1994/12/01  11:52:31  john
1432  * Added message when you select FCS to say that if
1433  * you have WCS, see manuel.
1434  * 
1435  * Revision 1.44  1994/11/29  02:26:28  john
1436  * Made the prompts for upper-left, lower right for joy
1437  * calibration more obvious.
1438  * 
1439  * Revision 1.43  1994/11/26  13:13:59  matt
1440  * Changed "none" option to "keyboard only"
1441  * 
1442  * Revision 1.42  1994/11/21  19:35:13  john
1443  * Replaced calls to joy_init with if (joy_present)
1444  * 
1445  * Revision 1.41  1994/11/21  19:28:34  john
1446  * Changed warning for no joystick to use nm_messagebox..
1447  * 
1448  * Revision 1.40  1994/11/21  19:06:25  john
1449  * Made it so that it only stops sound when your in game mode. 
1450  * 
1451  * Revision 1.39  1994/11/21  11:47:18  john
1452  * Made sound pause during joystick calibration.
1453  * 
1454  * Revision 1.38  1994/11/10  20:34:18  rob
1455  * Removed menu-specific network mode support in favor in new stuff
1456  * in newmenu.c
1457  * 
1458  * Revision 1.37  1994/11/08  21:21:38  john
1459  * Made Esc exit joystick calibration.
1460  * 
1461  * Revision 1.36  1994/11/08  15:14:42  john
1462  * Added more calls so net doesn't die in net game.
1463  * 
1464  * Revision 1.35  1994/11/08  14:59:12  john
1465  * Added code to respond to network while in menus.
1466  * 
1467  * Revision 1.34  1994/10/24  19:56:32  john
1468  * Made the new user setup prompt for config options.
1469  * 
1470  * Revision 1.33  1994/10/22  14:11:52  mike
1471  * Suppress compiler warning message.
1472  * 
1473  * Revision 1.32  1994/10/19  12:44:24  john
1474  * Added hours field to player structure.
1475  * 
1476  * Revision 1.31  1994/10/17  13:07:13  john
1477  * Moved the descent.cfg info into the player config file.
1478  * 
1479  * Revision 1.30  1994/10/13  21:41:12  john
1480  * MAde Esc exit out of joystick calibration.
1481  * 
1482  * Revision 1.29  1994/10/13  19:22:27  john
1483  * Added separate config saves for different devices.
1484  * Made all the devices work together better, such as mice won't
1485  * get read when you're playing with the joystick.
1486  * 
1487  * Revision 1.28  1994/10/13  11:40:18  john
1488  * Took out warnings.
1489  * 
1490  * Revision 1.27  1994/10/13  11:35:23  john
1491  * Made Thrustmaster FCS Hat work.  Put a background behind the
1492  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
1493  * menu to new menu. Made F6 be calibrate joystick.
1494  * 
1495  * Revision 1.26  1994/10/11  21:29:03  matt
1496  * Made a bunch of menus have good initial selected values
1497  * 
1498  * Revision 1.25  1994/10/11  17:08:39  john
1499  * Added sliders for volume controls.
1500  * 
1501  * Revision 1.24  1994/10/10  17:59:21  john
1502  * Neatend previous.
1503  * 
1504  * Revision 1.23  1994/10/10  17:57:59  john
1505  * Neatend previous.
1506  * 
1507  * Revision 1.22  1994/10/10  17:56:11  john
1508  * Added messagebox that tells that config has been saved.
1509  * 
1510  * Revision 1.21  1994/09/30  12:37:26  john
1511  * Added midi,digi volume to configuration.
1512  * 
1513  * Revision 1.20  1994/09/22  16:14:14  john
1514  * Redid intro sequecing.
1515  * 
1516  * Revision 1.19  1994/09/19  18:50:15  john
1517  * Added switch to disable joystick.
1518  * 
1519  * Revision 1.18  1994/09/12  11:47:36  john
1520  * Made stupid cruise work better.  Make kconfig values get
1521  * read/written to disk.
1522  * 
1523  * Revision 1.17  1994/09/10  15:46:47  john
1524  * First version of new keyboard configuration.
1525  * 
1526  * Revision 1.16  1994/09/06  19:35:44  john
1527  * Fixed bug that didn';t load new size .cal file.
1528  * 
1529  * Revision 1.15  1994/09/06  14:51:58  john
1530  * Added sensitivity adjustment, fixed bug with joystick button not
1531  * staying down.
1532  * 
1533  * Revision 1.14  1994/09/02  16:13:47  john
1534  * Made keys fill in position.
1535  * 
1536  * Revision 1.13  1994/08/31  17:58:50  john
1537  * Made a bit simpler.
1538  * 
1539  * Revision 1.12  1994/08/31  14:17:54  john
1540  * *** empty log message ***
1541  * 
1542  * Revision 1.11  1994/08/31  14:10:56  john
1543  * Made keys not work when KEY_DELETE pressed.
1544  * 
1545  * Revision 1.10  1994/08/31  13:40:47  mike
1546  * Change constant
1547  * 
1548  * Revision 1.9  1994/08/31  12:56:27  john
1549  * *** empty log message ***
1550  * 
1551  * Revision 1.8  1994/08/30  20:38:29  john
1552  * Add more config stuff..
1553  * 
1554  * Revision 1.7  1994/08/30  16:37:25  john
1555  * Added menu options to set controls.
1556  * 
1557  * Revision 1.6  1994/08/30  09:27:18  john
1558  * *** empty log message ***
1559  * 
1560  * Revision 1.5  1994/08/30  09:12:01  john
1561  * *** empty log message ***
1562  * 
1563  * Revision 1.4  1994/08/29  21:18:32  john
1564  * First version of new keyboard/oystick remapping stuff.
1565  * 
1566  * Revision 1.3  1994/08/24  19:00:29  john
1567  * Changed key_down_time to return fixed seconds instead of
1568  * milliseconds.
1569  * 
1570  * Revision 1.2  1994/08/17  16:50:37  john
1571  * Added damaging fireballs, missiles.
1572  * 
1573  * Revision 1.1  1994/08/17  10:07:12  john
1574  * Initial revision
1575
1576 ------------------------------------------------------------------------
1577 arch/dos/key.c:
1578
1579  * $Log: not supported by cvs2svn $
1580  * Revision 1.3  2004/08/29 14:03:51  schaffner
1581  * move more old change logs into ChangeLog-old
1582  *
1583  * Revision 1.2  2004/08/28 23:37:35  schaffner
1584  * move old per-file change logs into new file ChangeLog-old
1585  *
1586  * Revision 1.1  2004/08/28 23:17:45  schaffner
1587  * move old per-file change logs into new file ChangeLog-old
1588  *
1589  * Revision 1.3  2001/10/24 09:25:05  bradleyb
1590  * Moved input stuff to arch subdirs, as in d1x.
1591  *
1592  * Revision 1.3  2001/01/31 14:04:44  bradleyb
1593  * Fix compiler warnings
1594  *
1595  * Revision 1.2  2001/01/29 14:03:57  bradleyb
1596  * Fixed build, minor fixes
1597  *
1598  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1599  * Import of d2x-0.0.9-pre1
1600  *
1601  * Revision 1.1.1.1  1999/06/14 21:58:32  donut
1602  * Import of d1x 1.37 source.
1603  *
1604  * Revision 1.35  1995/01/25  20:13:30  john
1605  * Took out not passing keys to debugger if w10.
1606  * 
1607  * Revision 1.34  1995/01/14  19:19:31  john
1608  * Made so when you press Shift+Baskspace, it release keys autmatically.
1609  * 
1610  * Revision 1.33  1994/12/13  09:21:48  john
1611  * Took out keyd_editor_mode, and KEY_DEBUGGED stuff for NDEBUG versions.
1612  * 
1613  * Revision 1.32  1994/11/12  13:52:01  john
1614  * Fixed bug with code that cleared bios buffer.
1615  * 
1616  * Revision 1.31  1994/10/24  15:16:16  john
1617  * Added code to detect KEY_PAUSE.
1618  * 
1619  * Revision 1.30  1994/10/24  13:57:53  john
1620  * Hacked in support for pause key onto code 0x61.
1621  * 
1622  * Revision 1.29  1994/10/21  15:18:13  john
1623  * *** empty log message ***
1624  * 
1625  * Revision 1.28  1994/10/21  15:17:24  john
1626  * Made LSHIFT+BACKSPACE do what PrtScr used to.
1627  * 
1628  * Revision 1.27  1994/09/22  16:09:18  john
1629  * Fixed some virtual memory lockdown problems with timer and
1630  * joystick.
1631  * 
1632  * Revision 1.26  1994/09/15  21:32:47  john
1633  * Added bounds checking for down_count scancode
1634  * parameter.
1635  * 
1636  * Revision 1.25  1994/08/31  12:22:20  john
1637  * Added KEY_DEBUGGED
1638  * 
1639  * Revision 1.24  1994/08/24  18:53:48  john
1640  * Made Cyberman read like normal mouse; added dpmi module; moved
1641  * mouse from assembly to c. Made mouse buttons return time_down.
1642  * 
1643  * Revision 1.23  1994/08/18  15:17:51  john
1644  * *** empty log message ***
1645  * 
1646  * Revision 1.22  1994/08/18  15:16:38  john
1647  * fixed some bugs with clear_key_times and then
1648  * removed it because i fixed key_flush to do the
1649  * same.
1650  * 
1651  * Revision 1.21  1994/08/17  19:01:25  john
1652  * Attempted to fix a bug with a key being held down
1653  * key_flush called, then the key released having too 
1654  * long of a time.
1655  * 
1656  * Revision 1.20  1994/08/08  10:43:48  john
1657  * Recorded when a key was pressed for key_inkey_time.
1658  * 
1659  * Revision 1.19  1994/06/22  15:00:03  john
1660  * Made keyboard close automatically on exit.
1661  * 
1662  * Revision 1.18  1994/06/21  09:16:29  john
1663  * *** empty log message ***
1664  * 
1665  * Revision 1.17  1994/06/21  09:08:23  john
1666  * *** empty log message ***
1667  * 
1668  * Revision 1.16  1994/06/21  09:05:01  john
1669  * *** empty log message ***
1670  * 
1671  * Revision 1.15  1994/06/21  09:04:24  john
1672  * Made PrtScreen do an int5
1673  * 
1674  * Revision 1.14  1994/06/17  17:17:06  john
1675  * Added keyd_time_last_key_was_pressed or something like that.
1676  * 
1677  * Revision 1.13  1994/05/14  13:55:16  matt
1678  * Added #define to control key passing to bios
1679  * 
1680  * Revision 1.12  1994/05/05  18:09:39  john
1681  * Took out BIOS to prevent stuck keys.
1682  * 
1683  * Revision 1.11  1994/05/03  17:39:12  john
1684  * *** empty log message ***
1685  * 
1686  * Revision 1.10  1994/04/29  12:14:20  john
1687  * Locked all memory used during interrupts so that program
1688  * won't hang when using virtual memory.
1689  * 
1690  * Revision 1.9  1994/04/28  23:49:41  john
1691  * Made key_flush flush more keys and also did something else but i forget what.
1692  * 
1693  * Revision 1.8  1994/04/22  12:52:12  john
1694  * *** empty log message ***
1695  * 
1696  * Revision 1.7  1994/04/01  10:44:59  mike
1697  * Change key_getch() to call getch() if our interrupt hasn't been installed.
1698  * 
1699  * Revision 1.6  1994/03/09  10:45:48  john
1700  * Neatend code a bit.
1701  * 
1702  * Revision 1.5  1994/02/17  17:24:16  john
1703  * Neatened up a bit.
1704  * 
1705  * Revision 1.4  1994/02/17  16:30:29  john
1706  * Put in code to pass keys when in debugger.
1707  * 
1708  * Revision 1.3  1994/02/17  15:57:59  john
1709  * Made handler not chain to BIOS handler.
1710  * 
1711  * Revision 1.2  1994/02/17  15:56:06  john
1712  * Initial version.
1713  * 
1714  * Revision 1.1  1994/02/17  15:54:07  john
1715  * Initial revision
1716
1717 ------------------------------------------------------------------------
1718 arch/dos/mono.c:
1719
1720  * $Log: not supported by cvs2svn $
1721  * Revision 1.3  2004/08/29 14:03:51  schaffner
1722  * move more old change logs into ChangeLog-old
1723  *
1724  * Revision 1.2  2004/08/28 23:37:35  schaffner
1725  * move old per-file change logs into new file ChangeLog-old
1726  *
1727  * Revision 1.1  2004/08/28 23:17:45  schaffner
1728  * move old per-file change logs into new file ChangeLog-old
1729  *
1730  * Revision 1.1.1.1  2001/01/19 03:30:15  bradleyb
1731  * Import of d2x-0.0.8
1732  *
1733  * Revision 1.1.1.1  1999/06/14 21:58:35  donut
1734  * Import of d1x 1.37 source.
1735  *
1736  * Revision 1.12  1995/02/23  11:59:57  john
1737  * Made the windows smaller so they don't overwrite the debug file menus.
1738  * 
1739  * Revision 1.11  1994/11/27  23:07:50  matt
1740  * Made changes needed to be able to compile out monochrome debugging code
1741  * 
1742  * Revision 1.10  1994/10/26  22:23:43  john
1743  * Limited windows to 2.  Took away saving what was under
1744  * a window.
1745  * 
1746  * Revision 1.9  1994/07/14  23:25:44  matt
1747  * Allow window 0 to be opened; don't allow mono to be initialized twice
1748  * 
1749  * Revision 1.8  1994/03/09  10:45:38  john
1750  * Sped up scroll.
1751  * 
1752  * Revision 1.7  1994/01/26  08:56:55  mike
1753  * Comment out int3 in mputc.
1754  * 
1755  * Revision 1.6  1994/01/12  15:56:34  john
1756  * made backspace do an int3 during mono stuff.
1757  * .,
1758  * 
1759  * Revision 1.5  1993/12/07  12:33:23  john
1760  * *** empty log message ***
1761  * 
1762  * Revision 1.4  1993/10/15  10:10:25  john
1763  * *** empty log message ***
1764  * 
1765  * Revision 1.3  1993/09/14  20:55:13  matt
1766  * Made minit() and mopen() check for presence of mono card in machine.
1767  * 
1768  * Revision 1.2  1993/07/22  13:10:21  john
1769  * *** empty log message ***
1770  * 
1771  * Revision 1.1  1993/07/10  13:10:38  matt
1772  * Initial revision
1773
1774 ------------------------------------------------------------------------
1775 arch/dos/mono.h:
1776
1777  * Revision 1.6  1994/12/03  17:07:37  matt
1778  * Made mono code turn off with either NDEBUG or NMONO
1779  * 
1780  * Revision 1.5  1994/11/27  23:07:28  matt
1781  * Made changes needed to be able to compile out monochrome debugging code
1782  * 
1783  * Revision 1.4  1993/12/07  12:33:28  john
1784  * *** empty log message ***
1785  * 
1786  * Revision 1.3  1993/09/14  20:54:50  matt
1787  * Made minit() check for mono card, return -1 if present, 0 if not
1788  * 
1789  * Revision 1.2  1993/07/22  13:05:40  john
1790  * added macros to print variables
1791  * 
1792  * Revision 1.1  1993/07/10  13:10:40  matt
1793  * Initial revision
1794
1795 ------------------------------------------------------------------------
1796 arch/dos/mouse.c:
1797
1798  * Revision 1.11  1995/02/10  18:52:17  john
1799  * Fixed bug with mouse not getting closed.
1800  *
1801  * Revision 1.10  1995/02/02  11:10:33  john
1802  * Changed a bunch of mouse stuff around to maybe get
1803  * around PS/2 mouse hang.
1804  *
1805  * Revision 1.9  1995/01/14  19:19:52  john
1806  * Fixed signed short error cmp with -1 that caused mouse
1807  * to break under Watcom 10.0
1808  *
1809  * Revision 1.8  1994/12/27  12:38:23  john
1810  * Made mouse use temporary dos buffer instead of
1811  *
1812  * allocating its own.
1813  *
1814  *
1815  * Revision 1.7  1994/12/05  23:54:53  john
1816  * Fixed bug with mouse_get_delta only returning positive numbers..
1817  *
1818  * Revision 1.6  1994/11/18  23:18:18  john
1819  * Changed some shorts to ints.
1820  *
1821  * Revision 1.5  1994/09/13  12:34:02  john
1822  * Added functions to get down count and state.
1823  *
1824  * Revision 1.4  1994/08/29  20:52:19  john
1825  * Added better cyberman support; also, joystick calibration
1826  * value return funcctiionn,
1827  *
1828  * Revision 1.3  1994/08/24  18:54:32  john
1829  * *** empty log message ***
1830  *
1831  * Revision 1.2  1994/08/24  18:53:46  john
1832  * Made Cyberman read like normal mouse; added dpmi module; moved
1833  * mouse from assembly to c. Made mouse buttons return time_down.
1834  *
1835  * Revision 1.1  1994/08/24  13:56:37  john
1836  * Initial revision
1837
1838 ------------------------------------------------------------------------
1839 arch/include/joy.h:
1840
1841  * Revision 1.17  1995/10/07  13:22:30  john
1842  * Added new method of reading joystick that allows higher-priority
1843  * interrupts to go off.
1844  *
1845  * Revision 1.16  1995/02/14  11:17:13  john
1846  * Added BIOS readings for stick.
1847  *
1848  * Revision 1.15  1995/02/14  10:09:58  john
1849  * Added OS2 switch.
1850  *
1851  * Revision 1.14  1994/12/28  13:49:20  john
1852  * Added function to set joystick for slow reading
1853  *
1854  * Revision 1.13  1994/10/13  11:36:06  john
1855  * Made joy_down_time be kept track of in fixed seconds,
1856  * not ticks.
1857  *
1858  * Revision 1.12  1994/10/12  17:03:16  john
1859  * Added prototype for joy_get_scaled_reading.
1860  *
1861  * Revision 1.11  1994/10/12  16:57:55  john
1862  * Added function to set a joystick button's state.
1863  *
1864  * Revision 1.10  1994/09/22  16:09:00  john
1865  * Fixed some virtual memory lockdown problems with timer and
1866  * joystick.
1867  *
1868  * Revision 1.9  1994/08/31  09:54:57  john
1869  * *** empty log message ***
1870  *
1871  * Revision 1.8  1994/08/29  21:02:24  john
1872  * Added joy_set_cal_values...
1873  *
1874  * Revision 1.7  1994/08/29  20:51:52  john
1875  * Added better cyberman support; also, joystick calibration
1876  * value return funcctiionn,
1877  *
1878  * Revision 1.6  1994/07/01  10:55:44  john
1879  * Fixed some bugs... added support for 4 axis.
1880  *
1881  * Revision 1.5  1994/06/30  20:36:51  john
1882  * Revamped joystick code.
1883  *
1884  * Revision 1.4  1994/04/22  12:52:10  john
1885  * *** empty log message ***
1886  *
1887  * Revision 1.3  1994/01/18  13:53:39  john
1888  * Made all joystick functions return int's instead of
1889  * shorts.  Also made the stick reading be CPU speed
1890  * independant by using the timer_get_Stamp_64
1891  * function.
1892  *
1893  * Revision 1.2  1994/01/18  10:58:42  john
1894  * *** empty log message ***
1895  *
1896  * Revision 1.1  1993/07/10  13:10:39  matt
1897  * Initial revision
1898
1899 ------------------------------------------------------------------------
1900 arch/win32/include/key.h:
1901
1902  * Revision 1.19  1994/10/24  13:58:12  john
1903  * Hacked in support for pause key onto code 0x61.
1904  * 
1905  * Revision 1.18  1994/10/21  15:17:10  john
1906  * Added KEY_PRINT_SCREEN
1907  * 
1908  * Revision 1.17  1994/08/31  12:22:13  john
1909  * Added KEY_DEBUGGED
1910  * 
1911  * Revision 1.16  1994/08/24  18:53:50  john
1912  * Made Cyberman read like normal mouse; added dpmi module; moved
1913  * mouse from assembly to c. Made mouse buttons return time_down.
1914  * 
1915  * Revision 1.15  1994/08/18  14:56:16  john
1916  * *** empty log message ***
1917  * 
1918  * Revision 1.14  1994/08/08  10:43:24  john
1919  * Recorded when a key was pressed for key_inkey_time.
1920  * 
1921  * Revision 1.13  1994/06/17  17:17:28  john
1922  * Added keyd_time_last_key_was_pressed or something like that.
1923  * 
1924  * Revision 1.12  1994/04/29  12:14:19  john
1925  * Locked all memory used during interrupts so that program
1926  * won't hang when using virtual memory.
1927  * 
1928  * Revision 1.11  1994/02/17  15:57:14  john
1929  * Changed key libary to C.
1930  * 
1931  * Revision 1.10  1994/01/31  08:34:09  john
1932  * Fixed reversed lshift/rshift keys.
1933  * 
1934  * Revision 1.9  1994/01/18  10:58:17  john
1935  * *** empty log message ***
1936  * 
1937  * Revision 1.8  1993/10/16  19:24:43  matt
1938  * Added new function key_clear_times() & key_clear_counts()
1939  * 
1940  * Revision 1.7  1993/10/15  10:17:09  john
1941  * added keyd_last_key_pressed and released for use with recorder.
1942  * 
1943  * Revision 1.6  1993/10/06  16:20:37  john
1944  * fixed down arrow bug
1945  * 
1946  * Revision 1.5  1993/10/04  13:26:42  john
1947  * changed the #defines for scan codes.
1948  * 
1949  * Revision 1.4  1993/09/28  11:35:20  john
1950  * added key_peekkey
1951  * 
1952  * Revision 1.3  1993/09/20  18:36:43  john
1953  * *** empty log message ***
1954  * 
1955  * Revision 1.1  1993/07/10  13:10:39  matt
1956  * Initial revision
1957
1958 ------------------------------------------------------------------------
1959 arch/win32/include/mouse.h:
1960
1961  * Revision 1.10  1995/02/02  10:22:29  john
1962  * Added cyberman init parameter.
1963  * 
1964  * Revision 1.9  1994/11/18  23:18:09  john
1965  * Changed some shorts to ints.
1966  * 
1967  * Revision 1.8  1994/09/13  12:33:49  john
1968  * Added functions to get down count and state.
1969  * 
1970  * Revision 1.7  1994/08/29  20:52:20  john
1971  * Added better cyberman support; also, joystick calibration
1972  * value return funcctiionn,
1973  * 
1974  * Revision 1.6  1994/08/24  17:54:35  john
1975  * *** empty log message ***
1976  * 
1977  * Revision 1.5  1994/08/24  17:51:43  john
1978  * Added transparent cyberman support
1979  * 
1980  * Revision 1.4  1993/07/27  09:32:22  john
1981  * *** empty log message ***
1982  * 
1983  * Revision 1.3  1993/07/26  10:46:44  john
1984  * added definition for mouse_set_pos
1985  * 
1986  * Revision 1.2  1993/07/22  13:07:59  john
1987  * added header for mousesetlimts
1988  * 
1989  * Revision 1.1  1993/07/10  13:10:40  matt
1990  * Initial revision
1991
1992 ------------------------------------------------------------------------
1993 arch/win32/mouse.c:
1994
1995  * Revision 1.8  1996/02/21  13:57:36  allender
1996  * cursor device manager stuff added here so as not to
1997  * rely on InterfaceLib anymore
1998  *
1999  * Revision 1.7  1995/10/17  15:42:21  allender
2000  * new mouse function to determine single button press
2001  *
2002  * Revision 1.6  1995/10/03  11:27:31  allender
2003  * fixed up hotspot problems with the mouse on multiple monitors
2004  *
2005  * Revision 1.5  1995/07/13  11:27:08  allender
2006  * trap button checks at MAX_MOUSE_BUTTONS
2007  *
2008  * Revision 1.4  1995/06/25  21:56:53  allender
2009  * added events include
2010  *
2011  * Revision 1.3  1995/05/11  17:06:38  allender
2012  * fixed up mouse routines
2013  *
2014  * Revision 1.2  1995/05/11  13:05:53  allender
2015  * of mouse handler code
2016  *
2017  * Revision 1.1  1995/05/05  09:54:45  allender
2018  * Initial revision
2019  *
2020  * Revision 1.9  1995/01/14  19:19:52  john
2021  * Fixed signed short error cmp with -1 that caused mouse
2022  * to break under Watcom 10.0
2023  *
2024  * Revision 1.8  1994/12/27  12:38:23  john
2025  * Made mouse use temporary dos buffer instead of
2026  *
2027  * allocating its own.
2028  *
2029  * Revision 1.7  1994/12/05  23:54:53  john
2030  * Fixed bug with mouse_get_delta only returning positive numbers..
2031  *
2032  * Revision 1.6  1994/11/18  23:18:18  john
2033  * Changed some shorts to ints.
2034  *
2035  * Revision 1.5  1994/09/13  12:34:02  john
2036  * Added functions to get down count and state.
2037  *
2038  * Revision 1.4  1994/08/29  20:52:19  john
2039  * Added better cyberman support; also, joystick calibration
2040  * value return funcctiionn,
2041  *
2042  * Revision 1.3  1994/08/24  18:54:32  john
2043  * *** empty log message ***
2044  *
2045  * Revision 1.2  1994/08/24  18:53:46  john
2046  * Made Cyberman read like normal mouse; added dpmi module; moved
2047  * mouse from assembly to c. Made mouse buttons return time_down.
2048  *
2049  * Revision 1.1  1994/08/24  13:56:37  john
2050  * Initial revision
2051
2052 ------------------------------------------------------------------------
2053 cfile/cfile.c:
2054
2055  * Revision 1.7  1995/10/27  15:18:20  allender
2056  * get back to descent directory before trying to read a hog file
2057  *
2058  * Revision 1.6  1995/10/21  23:48:24  allender
2059  * hogfile(s) are now in :Data: folder
2060  *
2061  * Revision 1.5  1995/08/14  09:27:31  allender
2062  * added byteswap header
2063  *
2064  * Revision 1.4  1995/05/12  11:54:33  allender
2065  * changed memory stuff again
2066  *
2067  * Revision 1.3  1995/05/04  20:03:38  allender
2068  * added code that was missing...use NewPtr instead of malloc
2069  *
2070  * Revision 1.2  1995/04/03  09:59:49  allender
2071  * *** empty log message ***
2072  *
2073  * Revision 1.1  1995/03/30  10:25:02  allender
2074  * Initial revision
2075  *
2076  *
2077  * --- PC RCS Information ---
2078  * Revision 1.24  1995/03/15  14:20:27  john
2079  * Added critical error checker.
2080  *
2081  * Revision 1.23  1995/03/13  15:16:53  john
2082  * Added alternate directory stuff.
2083  *
2084  * Revision 1.22  1995/02/09  23:08:47  matt
2085  * Increased the max number of files in hogfile to 250
2086  *
2087  * Revision 1.21  1995/02/01  20:56:47  john
2088  * Added cfexist function
2089  *
2090  * Revision 1.20  1995/01/21  17:53:48  john
2091  * Added alternate pig file thing.
2092  *
2093  * Revision 1.19  1994/12/29  15:10:02  john
2094  * Increased hogfile max files to 200.
2095  *
2096  * Revision 1.18  1994/12/12  13:20:57  john
2097  * Made cfile work with fiellentth.
2098  *
2099  * Revision 1.17  1994/12/12  13:14:25  john
2100  * Made cfiles prefer non-hog files.
2101  *
2102  * Revision 1.16  1994/12/09  18:53:26  john
2103  * *** empty log message ***
2104  *
2105  * Revision 1.15  1994/12/09  18:52:56  john
2106  * Took out mem, error checking.
2107  *
2108  * Revision 1.14  1994/12/09  18:10:31  john
2109  * Speed up cfgets, which was slowing down the reading of
2110  * bitmaps.tbl, which was making POF loading look slow.
2111  *
2112  * Revision 1.13  1994/12/09  17:53:51  john
2113  * Added error checking to number of hogfiles..
2114  *
2115  * Revision 1.12  1994/12/08  19:02:55  john
2116  * Added cfgets.
2117  *
2118  * Revision 1.11  1994/12/07  21:57:48  john
2119  * Took out data dir.
2120  *
2121  * Revision 1.10  1994/12/07  21:38:02  john
2122  * Made cfile not return error..
2123  *
2124  * Revision 1.9  1994/12/07  21:35:34  john
2125  * Made it read from data directory.
2126  *
2127  * Revision 1.8  1994/12/07  21:33:55  john
2128  * Stripped out compression stuff...
2129  *
2130  * Revision 1.7  1994/04/13  23:44:59  matt
2131  * When file cannot be opened, free up the buffer for that file.
2132  *
2133  * Revision 1.6  1994/02/18  12:38:20  john
2134  * Optimized a bit
2135  *
2136  * Revision 1.5  1994/02/15  18:13:20  john
2137  * Fixed more bugs.
2138  *
2139  * Revision 1.4  1994/02/15  13:27:58  john
2140  * Works ok...
2141  *
2142  * Revision 1.3  1994/02/15  12:51:57  john
2143  * Crappy inbetween version
2144  *
2145  * Revision 1.2  1994/02/14  20:12:29  john
2146  * First version working with new cfile stuff.
2147  *
2148  * Revision 1.1  1994/02/14  15:51:33  john
2149  * Initial revision
2150  *
2151  * Revision 1.1  1994/02/10  15:45:12  john
2152  * Initial revision
2153
2154 ------------------------------------------------------------------------
2155 iff/iff.c:
2156
2157  * Revision 1.2  1995/05/12  11:54:43  allender
2158  * changed memory stuff again
2159  *
2160  * Revision 1.1  1995/05/05  08:59:41  allender
2161  * Initial revision
2162  *
2163  * Revision 1.43  1994/12/08  19:03:17  john
2164  * Added code to use cfile.
2165  *
2166  * Revision 1.42  1994/12/08  17:45:32  john
2167  * Put back in cfile stuff.
2168  *
2169  * Revision 1.41  1994/11/19  16:41:06  matt
2170  * Took out unused code
2171  *
2172  * Revision 1.40  1994/11/07  21:26:39  matt
2173  * Added new function iff_read_into_bitmap()
2174  *
2175  * Revision 1.39  1994/10/27  00:12:03  john
2176  * Used nocfile
2177  *
2178  * Revision 1.38  1994/08/10  19:49:58  matt
2179  * Fixed bitmaps in ILBM format with masking (stencil) on.
2180  *
2181  * Revision 1.37  1994/06/02  18:53:17  matt
2182  * Clear flags & selector in new bitmap structure
2183  *
2184  * Revision 1.36  1994/05/17  14:00:33  matt
2185  * Fixed bug with odd-width deltas & odd-length body chunks
2186  *
2187  * Revision 1.35  1994/05/16  20:38:55  matt
2188  * Made anim brushes work when odd width
2189  *
2190  * Revision 1.34  1994/05/06  19:37:26  matt
2191  * Improved error handling and checking
2192  *
2193  * Revision 1.33  1994/04/27  20:57:07  matt
2194  * Fixed problem with RLE decompression and odd-width bitmap
2195  * Added more error checking
2196  *
2197  * Revision 1.32  1994/04/16  21:44:19  matt
2198  * Fixed bug introduced last version
2199  *
2200  * Revision 1.31  1994/04/16  20:12:40  matt
2201  * Made masked (stenciled) bitmaps work
2202  *
2203  * Revision 1.30  1994/04/13  23:46:16  matt
2204  * Added function, iff_errormsg(), which returns ptr to error message.
2205  *
2206  * Revision 1.29  1994/04/13  23:27:25  matt
2207  * Put in support for anim brushes (.abm files)
2208  *
2209  * Revision 1.28  1994/04/13  16:33:31  matt
2210  * Cleaned up file read code, adding fake_file structure (FFILE), which
2211  * cleanly implements reading the entire file into a buffer and then reading
2212  * out of that buffer.
2213  *
2214  * Revision 1.27  1994/04/06  23:07:43  matt
2215  * Cleaned up code; added prototype (but no new code) for anim brush read
2216  *
2217  * Revision 1.26  1994/03/19  02:51:52  matt
2218  * Really did what I said I did last revision.
2219  *
2220  * Revision 1.25  1994/03/19  02:16:07  matt
2221  * Made work ILBMs which didn't have 8 planes
2222  *
2223  * Revision 1.24  1994/03/15  14:45:26  matt
2224  * When error, only free memory if has been allocated
2225  *
2226  * Revision 1.23  1994/02/18  12:39:05  john
2227  * Made code read from buffer.
2228  *
2229  * Revision 1.22  1994/02/15  18:15:26  john
2230  * Took out cfile attempt (too slow)
2231  *
2232  * Revision 1.21  1994/02/15  13:17:48  john
2233  * added assert to cfseek.
2234  *
2235  * Revision 1.20  1994/02/15  13:13:11  john
2236  * Made iff code work normally.
2237  *
2238  * Revision 1.19  1994/02/15  12:51:07  john
2239  * crappy inbetween version.
2240  *
2241  * Revision 1.18  1994/02/10  18:31:32  matt
2242  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2243  *
2244  * Revision 1.17  1994/01/24  11:51:26  john
2245  * Made write routine write transparency info.
2246  *
2247  * Revision 1.16  1994/01/22  14:41:11  john
2248  * Fixed bug with declareations.
2249  *
2250  * Revision 1.15  1994/01/22  14:23:00  john
2251  * Added global vars to check transparency
2252  *
2253  * Revision 1.14  1993/12/08  19:00:42  matt
2254  * Changed while loop to memset
2255  *
2256  * Revision 1.13  1993/12/08  17:23:51  mike
2257  * Speedup by converting while...getc to fread.
2258  *
2259  * Revision 1.12  1993/12/08  12:37:35  mike
2260  * Optimize parse_body.
2261  *
2262  * Revision 1.11  1993/12/05  17:30:14  matt
2263  * Made bitmaps with width <= 64 not compress
2264  *
2265  * Revision 1.10  1993/12/03  12:24:51  matt
2266  * Fixed TINY chunk when bitmap was part of a larger bitmap
2267  *
2268  * Revision 1.9  1993/11/22  17:26:43  matt
2269  * iff write now writes out a tiny chunk
2270  *
2271  * Revision 1.8  1993/11/21  22:04:13  matt
2272  * Fixed error with non-compressed bitmaps
2273  * Added Yuan's code to free raw data if we get an error parsing the body
2274  *
2275  * Revision 1.7  1993/11/11  12:12:12  yuan
2276  * Changed mallocs to MALLOCs.
2277  *
2278  * Revision 1.6  1993/11/01  19:02:23  matt
2279  * Fixed a couple bugs in rle compression
2280  *
2281  * Revision 1.5  1993/10/27  12:47:39  john
2282  * *** empty log message ***
2283  *
2284  * Revision 1.4  1993/10/27  12:37:31  yuan
2285  * Added mem.h
2286  *
2287  * Revision 1.3  1993/09/22  19:16:57  matt
2288  * Added new error type, IFF_CORRUPT, for internally bad IFF files.
2289  *
2290  * Revision 1.2  1993/09/08  19:24:16  matt
2291  * Fixed bug in RLE compression
2292  * Changed a bunch of unimportant values like aspect and page size when writing
2293  * Added new error condition, IFF_BAD_BM_TYPE
2294  * Make sub-bitmaps work correctly
2295  * Added compile flag to turn compression off (COMPRESS)
2296  *
2297  * Revision 1.1  1993/09/08  14:24:15  matt
2298  * Initial revision
2299
2300 ------------------------------------------------------------------------
2301 include/3d.h:
2302
2303  * Revision 1.2  1995/09/14  14:08:58  allender
2304  * return value for g3_draw_sphere
2305  *
2306  * Revision 1.1  1995/05/05  08:48:41  allender
2307  * Initial revision
2308  *
2309  * Revision 1.34  1994/11/11  19:22:14  matt
2310  * Added new function, g3_calc_point_depth()
2311  *
2312  * Revision 1.33  1994/09/09  14:23:58  matt
2313  * Added support for glowing textures, to add engine glow to Descent.
2314  *
2315  * Revision 1.32  1994/09/01  10:42:27  matt
2316  * Blob routine, renamed g3_draw_bitmap(), now takes seperate 3d width & height.
2317  *
2318  * Revision 1.31  1994/07/29  18:16:14  matt
2319  * Added instance by angles, and corrected parms for g3_init()
2320  *
2321  * Revision 1.30  1994/07/25  00:00:00  matt
2322  * Made 3d no longer deal with point numbers, but only with pointers.
2323  *
2324  * Revision 1.29  1994/07/22  17:57:27  matt
2325  * Changed the name of the rod functions, and took out some debugging code
2326  *
2327  * Revision 1.28  1994/06/07  16:49:12  matt
2328  * Made interpreter take lighting value as parm, rather than in global var
2329  *
2330  * Revision 1.27  1994/05/31  18:35:28  matt
2331  * Added light value to g3_draw_facing_bitmap()
2332  *
2333  * Revision 1.26  1994/05/30  22:48:04  matt
2334  * Added support for morph effect
2335  *
2336  * Revision 1.25  1994/05/30  11:34:57  matt
2337  * Added g3_set_special_render() to allow a user to specify functions to
2338  * call for 2d draws.
2339  *
2340  * Revision 1.24  1994/05/19  21:46:31  matt
2341  * Moved texture lighting out of 3d and into the game
2342  *
2343  * Revision 1.23  1994/05/14  15:26:48  matt
2344  * Added extern for polyobj outline flag
2345  *
2346  * Revision 1.22  1994/04/19  18:26:33  matt
2347  * Added g3_draw_sphere() function.
2348  *
2349  * Revision 1.21  1994/03/25  18:22:28  matt
2350  * g3_draw_polygon_model() now takes ptr to list of angles
2351  *
2352  * Revision 1.20  1994/03/15  21:23:23  matt
2353  * Added interpreter functions
2354  *
2355  * Revision 1.19  1994/02/15  17:37:34  matt
2356  * New function, g3_draw_blob()
2357  *
2358  * Revision 1.18  1994/02/09  11:47:47  matt
2359  * Added rod & delta point functions
2360  *
2361  * Revision 1.17  1994/01/26  12:38:11  matt
2362  * Added function g3_compute_lighting_value()
2363  *
2364  * Revision 1.16  1994/01/25  18:00:02  yuan
2365  * Fixed variable beam_brightness...
2366  *
2367  * Revision 1.15  1994/01/24  14:08:34  matt
2368  * Added instancing functions
2369  *
2370  * Revision 1.14  1994/01/22  18:21:48  matt
2371  * New lighting stuff now done in 3d; g3_draw_tmap() takes lighting parm
2372  *
2373  * Revision 1.13  1994/01/20  17:21:24  matt
2374  * New function g3_compute_sky_polygon()
2375  *
2376  * Revision 1.12  1994/01/14  17:20:25  matt
2377  * Added prototype for new function g3_draw_horizon()
2378  *
2379  * Revision 1.10  1993/12/20  20:21:52  matt
2380  * Added g3_point_2_vec()
2381  *
2382  * Revision 1.9  1993/12/07  23:05:47  matt
2383  * Fixed mistyped function name.
2384  *
2385  * Revision 1.8  1993/12/05  23:47:03  matt
2386  * Added function g3_draw_line_ptrs()
2387  *
2388  * Revision 1.7  1993/12/05  23:13:22  matt
2389  * Added prototypes for g3_rotate_point() and g3_project_point()
2390  *
2391  * Revision 1.6  1993/12/05  23:03:28  matt
2392  * Changed uvl structs to g3s_uvl
2393  *
2394  * Revision 1.5  1993/11/22  10:51:09  matt
2395  * Moved uvl structure here from segment.h, made texture map functions use it
2396  *
2397  * Revision 1.4  1993/11/21  20:08:31  matt
2398  * Added function g3_draw_object()
2399  *
2400  * Revision 1.3  1993/11/04  18:49:19  matt
2401  * Added system to only rotate points once per frame
2402  *
2403  * Revision 1.2  1993/11/04  08:16:06  mike
2404  * Add light field (p3_l) to g3s_point.
2405  *
2406  * Revision 1.1  1993/10/29  22:20:56  matt
2407  * Initial revision
2408
2409 ------------------------------------------------------------------------
2410 include/args.h:
2411
2412  * Revision 1.1  1995/05/16  15:54:24  allender
2413  * Initial revision
2414  *
2415  * Revision 2.0  1995/02/27  11:33:09  john
2416  * New version 2.0, which has no anonymous unions, builds with
2417  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2418  *
2419  * Revision 1.4  1994/07/11  16:27:28  matt
2420  * Took out prototypes for netipx funcs
2421  *
2422  * Revision 1.3  1994/05/11  19:45:34  john
2423  * *** empty log message ***
2424  *
2425  * Revision 1.2  1994/05/09  17:02:55  john
2426  * Split command line parameters into arg.c and arg.h.
2427  * Also added /dma, /port, /irq to digi.c
2428  *
2429  * Revision 1.1  1994/05/09  16:47:49  john
2430  * Initial revision
2431
2432 ------------------------------------------------------------------------
2433 include/byteswap.h:
2434
2435  * Revision 1.4  1995/08/23  21:28:15  allender
2436  * fix mcc compiler warning
2437  *
2438  * Revision 1.3  1995/08/18  15:51:42  allender
2439  * put back in old byteswapping code
2440  *
2441  * Revision 1.2  1995/05/04  20:10:18  allender
2442  * proper prototypes
2443  *
2444  * Revision 1.1  1995/03/30  15:02:11  allender
2445  * Initial revision
2446
2447 ------------------------------------------------------------------------
2448 include/cfile.h:
2449
2450  * Revision 1.1  1995/03/30  10:25:08  allender
2451  * Initial revision
2452  *
2453  *
2454  * -- PC RCS Information ---
2455  * Revision 1.10  1995/03/13  15:16:47  john
2456  * Added alternate directory stuff.
2457  *
2458  * Revision 1.9  1995/02/01  20:56:40  john
2459  * Added cfexist function
2460  *
2461  * Revision 1.8  1995/01/21  17:53:41  john
2462  * Added alternate pig file thing.
2463  *
2464  * Revision 1.7  1994/12/12  13:19:47  john
2465  * Made cfile work with fiellentth.
2466  *
2467  * Revision 1.6  1994/12/08  19:02:52  john
2468  * Added cfgets.
2469  *
2470  * Revision 1.5  1994/12/07  21:34:07  john
2471  * Stripped out compression stuff...
2472  *
2473  * Revision 1.4  1994/07/13  00:16:53  matt
2474  * Added include
2475  *
2476  * Revision 1.3  1994/02/17  17:36:19  john
2477  * Added CF_READ_MODE and CF_WRITE_MODE constants.
2478  *
2479  * Revision 1.2  1994/02/15  12:52:08  john
2480  * Crappy inbetween version
2481  *
2482  * Revision 1.1  1994/02/15  10:54:23  john
2483  * Initial revision
2484  *
2485  * Revision 1.1  1994/02/10  15:50:54  john
2486  * Initial revision
2487
2488 ------------------------------------------------------------------------
2489 include/error.h:
2490
2491  * Revision 1.12  1994/06/17  15:22:46  matt
2492  * Added pragma for Error() for when NDEBUG
2493  *
2494  * Revision 1.11  1994/03/07  13:22:14  matt
2495  * Since the Error() function has 'aborts' set in pragma, we do a jmp
2496  * to the function rather than call.
2497  *
2498  * Revision 1.10  1994/02/17  12:37:15  matt
2499  * Combined two pragma's for Error(), since second superseded the first
2500  *
2501  * Revision 1.9  1994/02/10  18:02:53  matt
2502  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2503  *
2504  * Revision 1.8  1994/02/09  15:18:29  matt
2505  * Added pragma saying that Error() never returns
2506  *
2507  * Revision 1.7  1993/10/19  12:57:53  matt
2508  * If DEBUG_ON not defined, define it to be 1
2509  *
2510  * Revision 1.6  1993/10/15  21:40:39  matt
2511  * Made error functions generate int3's if debugging on
2512  *
2513  * Revision 1.5  1993/10/14  15:29:22  matt
2514  * Added new function clear_warn_func()
2515  *
2516  * Revision 1.4  1993/10/08  16:16:47  matt
2517  * Made Assert() call function _Assert(), rather to do 'if...' inline.
2518  *
2519  * Revision 1.3  1993/09/29  11:39:07  matt
2520  * Added Assert() macro, like the system one, but calls Error()
2521  *
2522  * Revision 1.2  1993/09/27  11:47:03  matt
2523  * Added function set_warn_func()
2524  *
2525  * Revision 1.1  1993/09/23  20:17:46  matt
2526  * Initial revision
2527
2528 ------------------------------------------------------------------------
2529 include/gr.h:
2530
2531  * Revision 1.7  1995/09/13  08:39:44  allender
2532  * added prototype for gr_bitblt_cockpit
2533  *
2534  * Revision 1.6  1995/08/23  18:47:01  allender
2535  * fixed compiler warnings on mcc
2536  *
2537  * Revision 1.5  1995/08/14  15:51:01  allender
2538  * added #define for transparency color
2539  *
2540  * Revision 1.4  1995/06/13  13:03:55  allender
2541  * added graphics mode
2542  *
2543  * Revision 1.3  1995/04/18  09:50:16  allender
2544  * *** empty log message ***
2545  *
2546  * Revision 1.2  1995/04/07  07:32:33  allender
2547  * *** empty log message ***
2548  *
2549  * Revision 1.1  1995/03/09  09:04:16  allender
2550  * Initial revision
2551  *
2552  *
2553  * --- PC RCS information ---
2554  * Revision 1.45  1994/11/18  22:50:21  john
2555  * Changed shorts to ints in parameters.
2556  *
2557  * Revision 1.44  1994/11/13  13:04:07  john
2558  * Added paged out bit in bitmap structure.  Commented out the
2559  * poly code that is never used.
2560  *
2561  * Revision 1.43  1994/11/09  23:04:56  mike
2562  * Add avg_color field.
2563  *
2564  * Revision 1.42  1994/10/27  00:53:35  john
2565  * Added RLE Flag to bitmap structere.
2566  *
2567  * Revision 1.41  1994/10/26  23:55:52  john
2568  * Took out roller; Took out inverse table.
2569  *
2570  * Revision 1.40  1994/08/11  17:59:12  mike
2571  * Assembler merge functions written for 3 rotations of bitmaps.
2572  *
2573  * Revision 1.39  1994/08/10  12:24:56  matt
2574  * Added support for colors fonts & kerned fonts
2575  * Made our own font file format
2576  *
2577  * Revision 1.38  1994/07/27  18:30:18  john
2578  * Took away the blending table.
2579  *
2580  * Revision 1.37  1994/06/16  15:25:06  mike
2581  * Add flag BM_FLAG_NO_LIGHTING.
2582  *
2583  * Revision 1.36  1994/05/31  10:01:22  john
2584  * *** empty log message ***
2585  *
2586  * Revision 1.35  1994/05/31  07:53:34  john
2587  * *** empty log message ***
2588  *
2589  * Revision 1.34  1994/05/14  17:19:41  matt
2590  * Added externs
2591  *
2592  * Revision 1.33  1994/05/12  17:33:09  john
2593  * Added circle code.
2594  *
2595  * Revision 1.32  1994/05/06  12:50:16  john
2596  * Added supertransparency; neatend things up; took out warnings.
2597  *
2598  * Revision 1.31  1994/05/04  10:06:06  john
2599  * Added flag for bitmap super-transparency.
2600  *
2601  * Revision 1.30  1994/05/03  19:38:56  john
2602  * *** empty log message ***
2603  *
2604  * Revision 1.29  1994/04/22  11:16:05  john
2605  * *** empty log message ***
2606  *
2607  * Revision 1.28  1994/04/08  16:59:32  john
2608  * Add fading poly's; Made palette fade 32 instead of 16.
2609  *
2610  * Revision 1.27  1994/03/16  17:29:52  john
2611  * *** empty log message ***
2612  *
2613  * Revision 1.26  1994/03/16  17:20:51  john
2614  * Added slow palette searching options.
2615  *
2616  * Revision 1.25  1994/03/14  17:59:20  john
2617  * Added function to check bitmap's transparency.
2618  *
2619  * Revision 1.24  1994/03/14  16:56:26  john
2620  * Changed grs_bitmap structure to include bm_flags.
2621  *
2622  * Revision 1.23  1994/02/18  15:32:30  john
2623  * *** empty log message ***
2624  *
2625  * Revision 1.22  1994/01/25  11:40:48  john
2626  * Added gr_check_mode function.
2627  *
2628  * Revision 1.21  1994/01/12  13:45:24  john
2629  * Added scaler.
2630  *
2631  * Revision 1.20  1993/12/21  19:58:24  john
2632  * added selector stuff
2633  *
2634  * Revision 1.19  1993/12/21  11:40:40  john
2635  * *** empty log message ***
2636  *
2637  * Revision 1.18  1993/12/09  15:02:08  john
2638  * Changed palette stuff majorly
2639  *
2640  * Revision 1.17  1993/12/07  12:32:05  john
2641  * moved bmd_palette to gr_palette
2642  *
2643  * Revision 1.16  1993/11/28  12:08:06  mike
2644  * Change prototype for rotate_bitmap.
2645  *
2646  * Revision 1.15  1993/11/18  14:22:51  mike
2647  * Add prototype for rotate_bitmap.
2648  *
2649  * Revision 1.14  1993/11/17  19:00:59  mike
2650  * Add prototype for test_rotate_bitmap
2651  *
2652  * Revision 1.13  1993/11/16  11:28:58  john
2653  * *** empty log message ***
2654  *
2655  * Revision 1.12  1993/10/26  13:17:43  john
2656  * *** empty log message ***
2657  *
2658  * Revision 1.11  1993/10/15  16:23:37  john
2659  * y
2660  *
2661  * Revision 1.10  1993/09/28  15:32:33  john
2662  * added def for save/restore vidmode
2663  *
2664  * Revision 1.9  1993/09/28  12:51:46  matt
2665  * Added aspect ratio to grs_screen structure
2666  *
2667  * Revision 1.8  1993/09/26  22:45:12  matt
2668  * Changed prototypes for line functions to take fixes, not ints.
2669  *
2670  * Revision 1.7  1993/09/26  18:58:16  john
2671  * fadein/out stuff
2672  *
2673  * Revision 1.6  1993/09/14  16:26:44  matt
2674  * Changed gr_change_mode() to be gr_set_mode()
2675  *
2676  * Revision 1.4  1993/09/14  13:08:45  john
2677  * added gr_change_mode
2678  *
2679  * Revision 1.3  1993/09/08  13:56:03  matt
2680  * Put 'if' block around body of file; added bitmap type BM_RGB15
2681  *
2682  * Revision 1.2  1993/09/08  13:02:14  john
2683  * Changed structure definitions a bit.
2684  *
2685  * Revision 1.1  1993/09/08  11:25:15  john
2686  * Initial revision
2687
2688 ------------------------------------------------------------------------
2689 include/grdef.h:
2690
2691  * Revision 1.5  1995/09/14  15:36:33  allender
2692  * added stuff for 68k version
2693  *
2694  * Revision 1.4  1995/07/05  16:10:57  allender
2695  * gr_linear_movsd prototype changes
2696  *
2697  * Revision 1.3  1995/04/19  14:39:28  allender
2698  * changed function prototype
2699  *
2700  * Revision 1.2  1995/04/18  09:49:53  allender
2701  * *** empty log message ***
2702  *
2703  * Revision 1.1  1995/03/09  09:04:56  allender
2704  * Initial revision
2705  *
2706  *
2707  * --- PC RCS information ---
2708  * Revision 1.8  1994/05/06  12:50:09  john
2709  * Added supertransparency; neatend things up; took out warnings.
2710  *
2711  * Revision 1.7  1994/01/25  11:40:29  john
2712  * Added gr_check_mode function.
2713  *
2714  * Revision 1.6  1993/10/15  16:22:53  john
2715  * y
2716  *
2717  * Revision 1.5  1993/09/29  17:31:00  john
2718  * added gr_vesa_pixel
2719  *
2720  * Revision 1.4  1993/09/29  16:14:43  john
2721  * added global canvas descriptors.
2722  *
2723  * Revision 1.3  1993/09/08  17:38:02  john
2724  * Looking for errors
2725  *
2726  * Revision 1.2  1993/09/08  15:54:29  john
2727  * *** empty log message ***
2728  *
2729  * Revision 1.1  1993/09/08  11:37:57  john
2730  * Initial revision
2731
2732 ------------------------------------------------------------------------
2733 include/ibitblt.h:
2734
2735  * Revision 1.1  1995/08/18  15:50:57  allender
2736  * Initial revision
2737  *
2738  * Revision 1.2  1994/05/31  11:10:56  john
2739  * *** empty log message ***
2740  *
2741  * Revision 1.1  1994/05/30  16:08:46  john
2742  * Initial revision
2743
2744 ------------------------------------------------------------------------
2745 include/iff.h:
2746
2747  * Revision 1.2  1995/05/05  16:33:22  allender
2748  * changed types.h to dtypes.h
2749  *
2750  * Revision 1.1  1995/05/05  08:59:45  allender
2751  * Initial revision
2752  *
2753  * Revision 1.12  1994/11/07  21:26:53  matt
2754  * Added new function iff_read_into_bitmap()
2755  *
2756  * Revision 1.11  1994/05/06  19:37:38  matt
2757  * Improved error handling and checking
2758  *
2759  * Revision 1.10  1994/04/16  20:12:54  matt
2760  * Made masked (stenciled) bitmaps work
2761  *
2762  * Revision 1.9  1994/04/13  23:46:00  matt
2763  * Added function, iff_errormsg(), which returns ptr to error message.
2764  *
2765  * Revision 1.8  1994/04/13  23:27:10  matt
2766  * Put in support for anim brushes (.abm files)
2767  *
2768  * Revision 1.7  1994/04/06  23:08:02  matt
2769  * Cleaned up code; added prototype (but no new code) for anim brush read
2770  *
2771  * Revision 1.6  1994/01/22  14:40:59  john
2772  * Fixed bug with declareations.
2773  *
2774  * Revision 1.5  1994/01/22  14:23:13  john
2775  * Added global vars to check transparency
2776  *
2777  * Revision 1.4  1993/10/27  12:47:42  john
2778  * Extended the comments
2779  *
2780  * Revision 1.3  1993/09/22  19:17:20  matt
2781  * Fixed handling of pad byte in ILBM/PPB body - was writing pad byte to
2782  * destination buffer.
2783  *
2784  * Revision 1.2  1993/09/08  19:23:25  matt
2785  * Added additional return code, IFF_BAD_BM_TYPE
2786  *
2787  * Revision 1.1  1993/09/08  14:24:21  matt
2788  * Initial revision
2789
2790 ------------------------------------------------------------------------
2791 include/ipx.h:
2792
2793  * Revision 2.6  1995/03/29  11:19:32  john
2794  * Added broadcasting over a net.
2795  *
2796  * Revision 2.5  1995/03/28  20:04:43  john
2797  * Took away alternate server stuff.
2798  *
2799  * Revision 2.4  1995/03/23  19:00:10  john
2800  * Added user list capabitly.
2801  *
2802  * Revision 2.3  1995/03/23  12:26:57  john
2803  * Move IPX into bios lib.
2804  *
2805  * Revision 2.2  1995/03/22  19:08:14  john
2806  * Added code to fix sending packets over router... now
2807  * we just need to make broadcasts go over router!!
2808  *
2809  * Revision 2.1  1995/03/21  08:39:56  john
2810  * Ifdef'd out the NETWORK code.
2811  *
2812  * Revision 2.0  1995/02/27  11:30:16  john
2813  * New version 2.0, which has no anonymous unions, builds with
2814  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2815  *
2816  * Revision 1.16  1995/02/16  17:34:52  john
2817  * Added code to allow dynamic socket changing.
2818  *
2819  * Revision 1.15  1995/01/04  21:43:27  rob
2820  * Remove SPX size definition.
2821  *
2822  * Revision 1.14  1995/01/03  13:46:18  john
2823  * Added code that should make ipx work over different servers,
2824  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
2825  * this, and I hope it doesn't introduce net bugs.
2826  *
2827  * Revision 1.13  1994/11/02  11:37:16  rob
2828  * Changed default socket number to a higher regions.
2829  *
2830  * Revision 1.12  1994/11/01  15:56:51  rob
2831  * Added defines for SPX socketsx.
2832  *
2833  * Revision 1.11  1994/10/31  19:23:31  rob
2834  * Added a prototype for the new object send function.
2835  *
2836  * Revision 1.10  1994/09/07  13:37:25  john
2837  * Changed default socket to 0x4000, because
2838  * the ipx/spx book says that we can only use
2839  * sockets 0x4000 - 0x7fff.
2840  *
2841  * Revision 1.9  1994/08/25  18:14:45  matt
2842  * Changed socket because of packet change
2843  *
2844  * Revision 1.8  1994/08/12  22:42:24  john
2845  * Took away Player_stats; added Players array.
2846  *
2847  * Revision 1.7  1994/08/09  19:31:47  john
2848  * Networking changes.
2849  *
2850  * Revision 1.6  1994/08/05  16:11:46  john
2851  * Psuedo working version of networking.
2852  *
2853  * Revision 1.5  1994/08/04  19:17:20  john
2854  * Inbetween version of network stuff.
2855  *
2856  * Revision 1.4  1994/07/29  16:08:59  john
2857  * *** empty log message ***
2858  *
2859  * Revision 1.3  1994/07/25  12:33:22  john
2860  * Network "pinging" in.
2861  *
2862  * Revision 1.2  1994/07/20  15:58:29  john
2863  * First installment of ipx stuff.
2864  *
2865  * Revision 1.1  1994/07/19  15:43:05  john
2866  * Initial revision
2867
2868 ------------------------------------------------------------------------
2869 include/palette.h:
2870
2871  * Revision 1.11  1994/11/15  17:55:10  john
2872  * Made text palette fade in when game over.
2873  *
2874  * Revision 1.10  1994/11/07  13:53:42  john
2875  * Added better gamma stufff.
2876  *
2877  * Revision 1.9  1994/11/07  13:38:03  john
2878  * Added gamma correction stuff.
2879  *
2880  * Revision 1.8  1994/11/05  13:05:59  john
2881  * Added back in code to allow keys during fade.
2882  *
2883  * Revision 1.7  1994/11/05  12:46:37  john
2884  * Changed palette stuff a bit.
2885  *
2886  * Revision 1.6  1994/09/22  16:08:37  john
2887  * Fixed some palette stuff.
2888  *
2889  * Revision 1.5  1994/08/09  11:27:04  john
2890  * Add cthru stuff.
2891  *
2892  * Revision 1.4  1994/06/09  10:39:33  john
2893  * In fade out.in functions, returned 1 if key was pressed...
2894  *
2895  * Revision 1.3  1994/05/31  19:04:24  john
2896  * Added key to stop fade if desired.
2897  *
2898  * Revision 1.2  1994/05/06  12:50:42  john
2899  * Added supertransparency; neatend things up; took out warnings.
2900  *
2901  * Revision 1.1  1994/05/04  14:59:57  john
2902  * Initial revision
2903
2904 ------------------------------------------------------------------------
2905 include/pcx.h:
2906
2907  * Revision 1.4  1995/01/21  17:07:34  john
2908  * Added out of memory error.
2909  *
2910  * Revision 1.3  1994/11/29  02:53:10  john
2911  * Added error messages; made call be more similiar to iff.
2912  *
2913  * Revision 1.2  1994/11/28  20:03:48  john
2914  * Added PCX functions.
2915  *
2916  * Revision 1.1  1994/11/28  19:57:45  john
2917  * Initial revision
2918
2919 ------------------------------------------------------------------------
2920 include/pstypes.h:
2921
2922  * Revision 1.2  1993/09/14  12:12:30  matt
2923  * Added #define for NULL
2924  *
2925  * Revision 1.1  1993/08/24  12:50:40  matt
2926  * Initial revision
2927
2928 ------------------------------------------------------------------------
2929 include/rle.h:
2930
2931  * Revision 1.5  1995/01/14  11:32:20  john
2932  * Added rle_cache_flush function.
2933  *
2934  * Revision 1.4  1994/11/10  13:16:01  matt
2935  * Added includes
2936  *
2937  * Revision 1.3  1994/11/09  19:53:51  john
2938  * Added texture rle caching.
2939  *
2940  * Revision 1.2  1994/11/09  16:35:18  john
2941  * First version with working RLE bitmaps.
2942  *
2943  * Revision 1.1  1994/11/09  12:40:17  john
2944  * Initial revision
2945
2946 ------------------------------------------------------------------------
2947 include/texmap.h:
2948
2949  * $Log: not supported by cvs2svn $
2950  * Revision 1.3  2004/08/29 14:03:51  schaffner
2951  * move more old change logs into ChangeLog-old
2952  *
2953  * Revision 1.2  2004/08/28 23:37:35  schaffner
2954  * move old per-file change logs into new file ChangeLog-old
2955  *
2956  * Revision 1.1  2004/08/28 23:17:45  schaffner
2957  * move old per-file change logs into new file ChangeLog-old
2958  *
2959  * Revision 1.2  2003/03/19 19:21:34  btb
2960  * header/extern declaration housekeeping
2961  *
2962  * Revision 1.1.1.1  2001/01/19 03:30:16  bradleyb
2963  * Import of d2x-0.0.8
2964  *
2965  * Revision 1.2  1999/07/07 21:21:56  donut
2966  * increased recip table size to better accommodate 640 res
2967  *
2968  * Revision 1.1.1.1  1999/06/14 22:02:20  donut
2969  * Import of d1x 1.37 source.
2970  *
2971  * Revision 1.2  1995/09/04  14:22:10  allender
2972  * #defines for fixed point limits on render buffer
2973  *
2974  * Revision 1.1  1995/05/04  20:14:50  allender
2975  * Initial revision
2976  *
2977  * Revision 1.17  1994/11/10  11:09:16  mike
2978  * detail level stuff.
2979  * 
2980  * Revision 1.16  1994/11/09  22:55:32  matt
2981  * Added variable Current_seg_depth for detail level optimization
2982  * 
2983  * Revision 1.15  1994/06/09  16:10:04  mike
2984  * Add prototype for SC2000
2985  * 
2986  * Revision 1.14  1994/05/25  18:46:16  matt
2987  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
2988  * 
2989  * Revision 1.13  1994/05/25  09:47:12  mike
2990  * Added interface support for linear texture mapper (Mike change, Matt commnet)
2991  * 
2992  * Revision 1.12  1994/05/24  17:30:43  mike
2993  * Prototype a bunch of linear, vertical scanning functions.
2994  * 
2995  * Revision 1.11  1994/05/19  23:26:14  mike
2996  * Add constants NUM_LIGHTING_VALUES, MAX_LIGHTING_VALUE, MIN_LIGHTING_VALUE,
2997  * all part of new lighting_values_in_0_to_1 system.
2998  * 
2999  * Revision 1.10  1994/05/14  17:19:21  matt
3000  * Added externs
3001  * 
3002  * Revision 1.9  1994/04/13  23:55:44  matt
3003  * Increased max_tmap_verts from 16 to 25
3004  * 
3005  * Revision 1.8  1994/03/31  08:35:43  mike
3006  * Prototype for gr_upoly_tmap.
3007  * 
3008  * Revision 1.7  1994/02/08  15:17:54  mike
3009  * define label for MAX_TMAP_VERTS
3010  * 
3011  * Revision 1.6  1994/01/31  15:41:51  mike
3012  * Add texture_map_lin_lin_sky_v
3013  * 
3014  * Revision 1.5  1994/01/18  10:49:40  mike
3015  * prototype for texture_map_lin_lin_sky
3016  * 
3017  * Revision 1.4  1993/11/30  17:09:46  mike
3018  * prototype for compute_lighting_value.
3019  * 
3020  * Revision 1.3  1993/11/22  10:50:38  matt
3021  * Add ifndef around body of file
3022  * 
3023  * Revision 1.2  1993/10/06  12:41:25  mike
3024  * Change prototype for draw_tmap.
3025  * 
3026  * Revision 1.1  1993/09/08  17:29:11  mike
3027  * Initial revision
3028
3029 ------------------------------------------------------------------------
3030 include/timer.h:
3031
3032  * Revision 1.8  1994/12/10  12:27:23  john
3033  * Added timer_get_approx_seconds.
3034  *
3035  * Revision 1.7  1994/12/10  12:10:25  john
3036  * Added types.h.
3037  *
3038  * Revision 1.6  1994/12/10  12:07:06  john
3039  * Added tick counter variable.
3040  *
3041  * Revision 1.5  1994/11/15  12:04:15  john
3042  * Cleaned up timer code a bit... took out unused functions
3043  * like timer_get_milliseconds, etc.
3044  *
3045  * Revision 1.4  1994/04/28  23:50:08  john
3046  * Changed calling for init_timer.  Made the function that the
3047  * timer calls be a far function. All of this was done to make
3048  * our timer system compatible with the HMI sound stuff.
3049  *
3050  * Revision 1.3  1994/02/17  15:57:12  john
3051  * Changed key libary to C.
3052  *
3053  * Revision 1.2  1994/01/18  10:58:34  john
3054  * Added timer_get_fixed_seconds
3055  *
3056  * Revision 1.1  1993/07/10  13:10:41  matt
3057  * Initial revision
3058
3059 ------------------------------------------------------------------------
3060 include/u_dpmi.h:
3061
3062  * Revision 1.9  1995/01/14  19:20:14  john
3063  * Added function to set a selector's base address.
3064  *
3065  * Revision 1.8  1994/11/28  20:22:03  john
3066  * Added some variables that return the amount of available
3067  * memory.
3068  *
3069  * Revision 1.7  1994/11/15  18:26:38  john
3070  * Added verbose flag.
3071  *
3072  * Revision 1.6  1994/11/07  11:35:05  john
3073  * Added prototype for real_free
3074  *
3075  * Revision 1.5  1994/10/27  19:54:48  john
3076  * Added unlock region function,.
3077  *
3078  * Revision 1.4  1994/09/27  18:27:56  john
3079  * Added pragma to make inp,outp,enable,disable intrinsic
3080  *
3081  * Revision 1.3  1994/09/27  11:54:45  john
3082  * Added DPMI init function.
3083  *
3084  * Revision 1.2  1994/08/24  18:53:51  john
3085  * Made Cyberman read like normal mouse; added dpmi module; moved
3086  * mouse from assembly to c. Made mouse buttons return time_down.
3087  *
3088  * Revision 1.1  1994/08/24  10:22:48  john
3089  * Initial revision
3090
3091 ------------------------------------------------------------------------
3092 include/vecmat.h:
3093
3094  * Revision 1.1  1995/04/17  16:18:05  allender
3095  * Initial revision
3096  *
3097  *
3098  * --- PC RCS Information ---
3099  * Revision 1.37  1995/02/22  13:23:22  john
3100  * Added the vms_vector_array structure, to access a vms_vector
3101  * with an array.
3102  *
3103  * Revision 1.36  1995/02/22  12:34:33  john
3104  * Took out anonymous unions.
3105  *
3106  * Revision 1.35  1994/12/13  14:44:20  matt
3107  * Added vm_vector_2_matrix_norm()
3108  *
3109  * Revision 1.34  1994/09/11  19:22:55  matt
3110  * Added vm_vec_normalized_dir_quick()
3111  *
3112  * Revision 1.33  1994/08/04  19:45:38  matt
3113  * Added option to make a bunch of functions (add, sub, dotprod) inline
3114  *
3115  * Revision 1.32  1994/07/19  18:52:36  matt
3116  * Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
3117  *
3118  * Revision 1.31  1994/06/16  18:24:30  matt
3119  * Added vm_vec_mag_quick()
3120  *
3121  * Revision 1.30  1994/06/10  23:19:00  matt
3122  * New register usage for vm_vec_ang_2_matrix()
3123  *
3124  * Revision 1.29  1994/06/01  17:32:06  matt
3125  * Fixed modify list for vm_vec_normalized_dir()
3126  *
3127  * Revision 1.28  1994/05/19  12:07:20  matt
3128  * Fixed globals and macros and added a constant
3129  *
3130  * Revision 1.27  1994/05/19  09:19:15  matt
3131  * Made vm_vec_normalized_dir() return mag of vector
3132  *
3133  * Revision 1.26  1994/05/18  22:28:57  matt
3134  * Added function vm_vec_normalized_dir()
3135  * Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
3136  * Added C global static vars vmd_zero_vector & vmd_identity_matrix
3137  *
3138  * Revision 1.25  1994/05/18  21:45:06  matt
3139  * Added functions:
3140  *   vm_extract_angles_vector()
3141  *   vm_extract_angles_vector_normalized()
3142  *   vm_vec_copy_normalize()
3143  *
3144  * Revision 1.24  1994/05/13  12:42:16  matt
3145  * Added new function, vm_vec_dist_quick(), which does an approximation.
3146  *
3147  * Revision 1.23  1994/03/30  13:37:34  matt
3148  * Added prototype for vm_vec_scale_add(), and fixed typos
3149  *
3150  * Revision 1.22  1994/03/30  13:29:42  matt
3151  * Header for vm_vec_scale_add2()
3152  *
3153  * Revision 1.21  1994/01/31  19:45:13  matt
3154  * Added function vm_extract_angles_matrix()
3155  *
3156  * Revision 1.20  1993/12/21  19:46:14  matt
3157  * Added function vm_dist_to_plane()
3158  *
3159  * Revision 1.19  1993/12/13  17:26:41  matt
3160  * Added vm_vec_dist()
3161  *
3162  * Revision 1.18  1993/12/02  12:45:11  matt
3163  * New functions: vm_vec_copy_scale(), vm_vec_scale2()
3164  * Aliases: vm_transpose(), vm_vec_dot(), vm_vec_cross(), vm_copy_transpose()
3165  *
3166  * Revision 1.17  1993/10/29  22:38:36  matt
3167  * Changed matrix order, making direction vectors the rows
3168  *
3169  * Revision 1.16  1993/10/25  11:49:57  matt
3170  * Made vm_vec_delta_ang() take optional forward vector to return signed delta
3171  *
3172  * Revision 1.15  1993/10/20  01:10:05  matt
3173  * Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
3174  *
3175  * Revision 1.14  1993/10/17  17:02:52  matt
3176  * vm_vector_2_matrix() now takes optional right vector
3177  *
3178  * Revision 1.13  1993/10/12  19:31:39  matt
3179  * Added IDENTITY_MATRIX constant
3180  *
3181  * Revision 1.12  1993/10/08  18:10:16  matt
3182  * Changed vm_vec_make() and vm_angvec_make() to be inline assembly
3183  * functions, to get rid of compiler warnings.  Did not change vm_mat_make(),
3184  * which could still get warnings if the return value is unused.
3185  *
3186  * Revision 1.11  1993/09/29  12:10:07  matt
3187  * Changed modified regs in pragmas to include return register
3188  *
3189  * Revision 1.10  1993/09/28  12:15:41  matt
3190  * Added func vm_vector_2_matrix()
3191  *
3192  * Revision 1.9  1993/09/24  21:18:38  matt
3193  * Added vm_vec_avg(), vm_vec_avg4(), and vm_angvec_make().
3194  * Documented which functions could have dest==source
3195  *
3196  * Revision 1.8  1993/09/20  14:56:11  matt
3197  * Added new function, vm_vec_perp()
3198  *
3199  * Revision 1.7  1993/09/20  14:27:42  mike
3200  * unfix last fix which introduced a bug
3201  *
3202  * Revision 1.6  1993/09/20  10:11:53  mike
3203  * no changes
3204  *
3205  * Revision 1.5  1993/09/20  09:58:58  mike
3206  * Re-fix vm_vec_make
3207  *
3208  * Revision 1.4  1993/09/20  09:41:21  mike
3209  * Correct vm_vec_make and vm_mat_make macros to return the destination
3210  * as the value of the macro.
3211  *
3212  * Revision 1.3  1993/09/17  11:23:47  matt
3213  * Added row access (via xrow,yrow,zrow) to vms_matrix
3214  * Added macro vm_mat_make(), like vm_vec_make()
3215  *
3216  * Revision 1.2  1993/09/17  11:10:32  matt
3217  * Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
3218  *
3219  * Revision 1.1  1993/09/16  20:10:01  matt
3220  * Initial revision
3221
3222 ------------------------------------------------------------------------
3223 main/ai.c:
3224
3225  * Revision 1.1  1995/12/05  14:15:37  allender
3226  * Initial revision
3227  *
3228  * Revision 1.10  1995/11/09  09:36:12  allender
3229  * cheats not active during demo playback
3230  *
3231  * Revision 1.9  1995/11/03  12:51:55  allender
3232  * shareware changes
3233  *
3234  * Revision 1.8  1995/10/31  10:25:07  allender
3235  * shareware stuff
3236  *
3237  * Revision 1.7  1995/10/26  14:01:38  allender
3238  * optimization for doing robot stuff only if anim angles done last frame
3239  *
3240  * Revision 1.6  1995/10/25  09:35:43  allender
3241  * prototype some functions causing mcc problems
3242  *
3243  * Revision 1.5  1995/10/17  13:11:40  allender
3244  * fix in ai code that makes bots only look for you every so often
3245  *
3246  * Revision 1.4  1995/10/10  11:48:10  allender
3247  * PC ai code
3248  *
3249  * Revision 2.11  1995/07/09  11:15:48  john
3250  * Put in Mike's code to fix bug where bosses don't gate in bots after
3251  * 32767 seconds of playing.
3252  *
3253  * Revision 2.10  1995/06/15  12:31:08  john
3254  * Fixed bug with cheats getting enabled when you type
3255  * the whole alphabet.
3256  *
3257  * Revision 2.9  1995/05/26  16:16:18  john
3258  * Split SATURN into define's for requiring cd, using cd, etc.
3259  * Also started adding all the Rockwell stuff.
3260  *
3261  * Revision 2.8  1995/04/06  15:12:27  john
3262  * Fixed bug with insane not working.
3263  *
3264  * Revision 2.7  1995/03/30  16:36:44  mike
3265  * text localization.
3266  *
3267  * Revision 2.6  1995/03/28  11:22:24  john
3268  * Added cheats to save file. Changed lunacy text.
3269  *
3270  * Revision 2.5  1995/03/27  16:45:07  john
3271  * Fixed some cheat bugs.  Added astral cheat.
3272  *
3273  * Revision 2.4  1995/03/24  15:29:17  mike
3274  * add new cheats.
3275  *
3276  * Revision 2.3  1995/03/21  14:39:45  john
3277  * Ifdef'd out the NETWORK code.
3278  *
3279  * Revision 2.2  1995/03/14  18:24:39  john
3280  * Force Destination Saturn to use CD-ROM drive.
3281  *
3282  * Revision 2.1  1995/03/06  16:47:14  mike
3283  * destination saturn
3284  *
3285  * Revision 2.0  1995/02/27  11:30:01  john
3286  * New version 2.0, which has no anonymous unions, builds with
3287  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3288  *
3289  * Revision 1.295  1995/02/22  13:23:04  allender
3290  * remove anonymous unions from object structure
3291  *
3292  * Revision 1.294  1995/02/13  11:00:43  rob
3293  * Make brain guys high enough to get an open slot.
3294  *
3295  * Revision 1.293  1995/02/13  10:31:55  mike
3296  * Make brains understand they can't open locked doors.
3297  *
3298  * Revision 1.292  1995/02/13  10:18:01  rob
3299  * Reduced brain guy's level of awareness to keep him from hogging slots.
3300  *
3301  * Revision 1.291  1995/02/11  12:27:12  mike
3302  * fix path-to-exit cheat.
3303  *
3304  * Revision 1.290  1995/02/11  01:56:30  mike
3305  * robots don't fire cheat.
3306  *
3307  * Revision 1.289  1995/02/10  17:15:09  rob
3308  * Fixed some stuff with 64 awareness stuff.
3309  *
3310  * Revision 1.288  1995/02/10  16:31:32  mike
3311  * oops.
3312  *
3313  * Revision 1.287  1995/02/10  16:24:45  mike
3314  * fix the network follow path fix.
3315  *
3316  * Revision 1.286  1995/02/10  16:11:40  mike
3317  * in serial or modem games, follow path guys don't move if far away and
3318  * can't see player.
3319  *
3320  * Revision 1.285  1995/02/09  13:11:35  mike
3321  * comment out a bunch of mprintfs.
3322  * add toaster (drops prox bombs, runs away) to boss gate list.
3323  *
3324  * Revision 1.284  1995/02/08  22:44:53  rob
3325  * Lowerd anger level for follow path of any sort.
3326  *
3327  * Revision 1.283  1995/02/08  22:30:43  mike
3328  * lower awareness on station guys if they are returning home (multiplayer).
3329  *
3330  * Revision 1.282  1995/02/08  17:01:06  rob
3331  * Fixed problem with toasters dropping of proximity bombs.
3332  *
3333  * Revision 1.281  1995/02/08  11:49:35  rob
3334  * Reduce Green-guy attack awareness level so we don't let him attack us too.
3335  *
3336  * Revision 1.280  1995/02/08  11:37:52  mike
3337  * Check for failures in call to obj_create.
3338  *
3339  * Revision 1.279  1995/02/07  20:38:46  mike
3340  * fix toasters in multiplayer
3341  *
3342  *
3343  * Revision 1.278  1995/02/07  16:51:07  mike
3344  * fix sound time play bug.
3345  *
3346  * Revision 1.277  1995/02/06  22:33:04  mike
3347  * make robots follow path better in cooperative/roboarchy.
3348  *
3349  * Revision 1.276  1995/02/06  18:15:42  rob
3350  * Added forced sends for evasion movemnet.
3351  *
3352  * Revision 1.275  1995/02/06  16:41:22  rob
3353  * Change some positioning calls.
3354  *
3355  * Revision 1.274  1995/02/06  11:40:33  mike
3356  * replace some lint-related hacks with clean, proper code.
3357  *
3358  * Revision 1.273  1995/02/04  17:28:19  mike
3359  * make station guys return better.
3360  *
3361  * Revision 1.272  1995/02/03  17:40:55  mike
3362  * fix problem with robots falling asleep if you sit in game overnight, not in pause...bah.
3363  *
3364  * Revision 1.271  1995/02/02  21:11:25  rob
3365  * Tweaking stuff for multiplayer ai.
3366  *
3367  * Revision 1.270  1995/02/02  17:32:06  john
3368  * Added Hack for Assert that Mike put in after using Lint to find
3369  * uninitialized variables.
3370  *
3371  * Revision 1.269  1995/02/02  16:46:31  mike
3372  * fix boss gating.
3373  *
3374  * Revision 1.268  1995/02/02  16:27:29  mike
3375  * make boss not put out infinite robots.
3376  *
3377  * Revision 1.267  1995/02/01  21:10:02  mike
3378  * lint found bug! player_visibility not initialized!
3379  *
3380  * Revision 1.266  1995/02/01  20:51:27  john
3381  * Lintized
3382  *
3383  * Revision 1.265  1995/02/01  17:14:05  mike
3384  * fix robot sounds.
3385  *
3386  * Revision 1.264  1995/01/31  16:16:40  mike
3387  * Comment out "Darn you, John" Int3().
3388  *
3389  * Revision 1.263  1995/01/30  20:55:04  mike
3390  * fix nonsense in robot firing when a player is cloaked.
3391  *
3392  * Revision 1.262  1995/01/30  17:15:10  rob
3393  * Fixed problems with bigboss eclip messages.
3394  * Tweaked robot position sending for modem purposes.
3395  *
3396  * Revision 1.261  1995/01/30  15:30:31  rob
3397  * Prevent non-master players from gating in robots.
3398  *
3399  * Revision 1.260  1995/01/30  13:30:55  mike
3400  * new cases for firing at other players were bogus, could send position
3401  * without permission.
3402  *
3403  * Revision 1.259  1995/01/30  13:01:17  mike
3404  * Make robots fire at player other than one they are controlled by sometimes.
3405  *
3406  * Revision 1.258  1995/01/29  16:09:17  rob
3407  * Trying to get robots to shoot at non-controlling players.
3408  *
3409  * Revision 1.257  1995/01/29  13:47:05  mike
3410  * Make boss have more fireballs on death, have until end (though silent at end).
3411  * Fix bug which was preventing him from teleporting until hit, so he'd always
3412  * be in the same place when the player enters the room.
3413  *
3414  * Revision 1.256  1995/01/28  17:40:18  mike
3415  * make boss teleport & gate before you see him.
3416  *
3417  * Revision 1.255  1995/01/27  17:02:08  mike
3418  * move code around, was sending one frame (or worse!) old robot information.
3419  *
3420  * Revision 1.254  1995/01/26  17:02:43  mike
3421  * make fusion cannon have more chrome, make fusion, mega rock you!
3422  *
3423  * Revision 1.253  1995/01/26  15:11:17  rob
3424  * Shutup!  I fixed it!
3425  *
3426  * Revision 1.252  1995/01/26  15:08:55  rob
3427  * Changed robot gating to accomodate multiplayer.
3428  *
3429  * Revision 1.251  1995/01/26  14:49:04  rob
3430  * Increase awareness level for firing to 94.
3431  *
3432  * Revision 1.250  1995/01/26  12:41:20  mike
3433  * fix bogus multiplayer code, would send permission without getting permission.
3434  *
3435  * Revision 1.249  1995/01/26  12:23:23  rob
3436  * Removed defines that were moved to ai.h
3437  *
3438  * Revision 1.248  1995/01/25  23:38:48  mike
3439  * modify list of robots gated in by super boss.
3440  *
3441  * Revision 1.247  1995/01/25  21:21:13  rob
3442  * Trying to let robots fire at a player even if they're not in control.
3443  *
3444  * Revision 1.246  1995/01/25  13:50:37  mike
3445  * Robots make angry sounds.
3446  *
3447  * Revision 1.245  1995/01/25  10:53:47  mike
3448  * better handling of robots which poke out of mine and try to recover.
3449  *
3450  * Revision 1.244  1995/01/24  22:03:02  mike
3451  * Tricky code to move a robot to a legal position if he is poking out of
3452  * the mine, even if it means moving him to another segment.
3453  *
3454  * Revision 1.243  1995/01/24  20:12:06  rob
3455  * Changed robot fire awareness level from 74 to 94.
3456  *
3457  * Revision 1.242  1995/01/24  13:22:32  mike
3458  * make robots accelerate faster, and Difficulty_level dependent.
3459  *
3460  * Revision 1.241  1995/01/24  12:09:39  mike
3461  * make robots animate in multiplayer.
3462  *
3463  * Revision 1.240  1995/01/21  21:21:10  mike
3464  * Make boss only gate robots into specified segments.
3465  *
3466  * Revision 1.239  1995/01/20  20:21:26  mike
3467  * prevent unnecessary boss cloaking.
3468
3469 ------------------------------------------------------------------------
3470 main/ai.h:
3471
3472  * Revision 1.3  1995/10/15  16:28:07  allender
3473  * added flag to player_is_visible function
3474  *
3475  * Revision 1.2  1995/10/10  11:48:32  allender
3476  * PC ai header
3477  *
3478  * Revision 1.1  1995/05/16  15:54:00  allender
3479  * Initial revision
3480  *
3481  * Revision 2.0  1995/02/27  11:33:07  john
3482  * New version 2.0, which has no anonymous unions, builds with
3483  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3484  *
3485  * Revision 1.57  1995/02/04  17:28:31  mike
3486  * make station guys return better.
3487  *
3488  * Revision 1.56  1995/02/04  10:03:23  mike
3489  * Fly to exit cheat.
3490  *
3491  * Revision 1.55  1995/02/01  19:23:52  rob
3492  * Externed a boss var.
3493  *
3494  * Revision 1.54  1995/01/30  13:00:58  mike
3495  * Make robots fire at player other than one they are controlled by sometimes.
3496  *
3497  * Revision 1.53  1995/01/26  15:09:16  rob
3498  * Changed robot gating to accomodate multiplayer.
3499  *
3500  * Revision 1.52  1995/01/26  12:23:12  rob
3501  * Added new externs needed for multiplayer.
3502  *
3503  * Revision 1.51  1995/01/21  21:22:14  mike
3504  * Kill prototype of init_boss_segments, which didn't need to be public
3505  * and had changed.
3506  *
3507  * Revision 1.50  1995/01/16  19:24:29  mike
3508  * Publicize BOSS_GATE_MATCEN_NUM and Boss_been_hit.
3509  *
3510  * Revision 1.49  1995/01/02  16:17:35  mike
3511  * prototype some super boss function for gameseq.
3512  *
3513  * Revision 1.48  1994/12/19  17:08:06  mike
3514  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3515  *
3516  * Revision 1.47  1994/12/12  17:18:04  mike
3517  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
3518  *
3519  * Revision 1.46  1994/12/08  15:46:16  mike
3520  * better robot behavior.
3521  *
3522  * Revision 1.45  1994/11/27  23:16:08  matt
3523  * Made debug code go away when debugging turned off
3524  *
3525  * Revision 1.44  1994/11/16  23:38:41  mike
3526  * new improved boss teleportation behavior.
3527  *
3528  * Revision 1.43  1994/11/10  17:45:11  mike
3529  * debugging.
3530  *
3531  * Revision 1.42  1994/11/07  10:37:42  mike
3532  * hooks for rob's network code.
3533  *
3534  * Revision 1.41  1994/11/06  15:10:50  mike
3535  * prototype a debug function for dumping ai info.
3536  *
3537  * Revision 1.40  1994/11/02  17:57:30  rob
3538  * Added extern of Believe_player_pos needed to get control centers
3539  * locating people.
3540  *
3541  * Revision 1.39  1994/10/28  19:43:39  mike
3542  * Prototype Boss_cloak_start_time, Boss_cloak_end_time.
3543  *
3544  * Revision 1.38  1994/10/22  14:14:42  mike
3545  * Prototype ai_reset_all_paths.
3546  *
3547  * Revision 1.37  1994/10/21  20:42:01  mike
3548  * Define MAX_PATH_LENGTH: maximum allowed length of a path.
3549  *
3550  * Revision 1.36  1994/10/20  09:49:18  mike
3551  * Prototype something.
3552  *
3553  *
3554  * Revision 1.35  1994/10/18  15:37:52  mike
3555  * Define ROBOT_BOSS1.
3556  *
3557  * Revision 1.34  1994/10/13  11:12:25  mike
3558  * Prototype some door functions.
3559  *
3560  * Revision 1.33  1994/10/12  21:28:51  mike
3561  * Prototype create_n_segment_path_to_door
3562  * Prototype ai_open_doors_in_segment
3563  * Prototype ai_door_is_openable.
3564  *
3565  * Revision 1.32  1994/10/11  15:59:41  mike
3566  * Prototype Robot_firing_enabled.
3567  *
3568  * Revision 1.31  1994/10/09  22:02:48  mike
3569  * Adapt create_path_points and create_n_segment_path prototypes to use avoid_seg for player evasion.
3570  *
3571  * Revision 1.30  1994/09/18  18:07:44  mike
3572  * Update prototypes for create_path_points and create_path_to_player.
3573  *
3574  * Revision 1.29  1994/09/15  16:34:08  mike
3575  * Prototype do_ai_robot_hit_attack.
3576  *
3577  * Revision 1.28  1994/09/12  19:12:35  mike
3578  * Prototype attempt_to_resume_path.
3579  *
3580  * Revision 1.27  1994/08/25  21:55:32  mike
3581  * Add some prototypes.
3582  *
3583  * Revision 1.26  1994/08/10  19:53:24  mike
3584  * Prototype create_path_to_player and init_robots_for_level.
3585  *
3586  * Revision 1.25  1994/08/04  16:32:58  mike
3587  * prototype create_path_to_player.
3588  *
3589  * Revision 1.24  1994/08/03  15:17:20  mike
3590  * Prototype make_random_vector.
3591  *
3592  * Revision 1.23  1994/07/31  18:10:34  mike
3593  * Update prototype for create_path_points.
3594  *
3595  * Revision 1.22  1994/07/28  12:36:14  matt
3596  * Cleaned up object bumping code
3597
3598 ------------------------------------------------------------------------
3599 main/ai2.c:
3600
3601  * Revision 1.1  1995/05/25  12:00:31  mike
3602  * Initial revision
3603
3604 ------------------------------------------------------------------------
3605 main/aipath.c:
3606
3607  * Revision 1.5  1995/10/26  14:12:03  allender
3608  * prototype functions for mcc compiler
3609  *
3610  * Revision 1.4  1995/10/25  09:38:22  allender
3611  * prototype some functions causing mcc grief
3612  *
3613  * Revision 1.3  1995/10/10  11:48:43  allender
3614  * PC ai code
3615  *
3616  * Revision 2.0  1995/02/27  11:30:48  john
3617  * New version 2.0, which has no anonymous unions, builds with
3618  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3619  *
3620  * Revision 1.101  1995/02/22  13:42:44  allender
3621  * remove anonymous unions for object structure
3622  *
3623  * Revision 1.100  1995/02/10  16:20:04  mike
3624  * fix bogosity in create_path_points, assumed all objects were robots.
3625  *
3626  * Revision 1.99  1995/02/07  21:09:30  mike
3627  * make run_from guys have diff level based speed.
3628  *
3629  * Revision 1.98  1995/02/04  17:28:29  mike
3630  * make station guys return better.
3631  *
3632  * Revision 1.97  1995/02/04  10:28:39  mike
3633  * fix compile error!
3634  *
3635  * Revision 1.96  1995/02/04  10:03:37  mike
3636  * Fly to exit cheat.
3637  *
3638  * Revision 1.95  1995/02/01  21:10:36  mike
3639  * Array name was dereferenced.  Not a bug, but unclean.
3640  *
3641  * Revision 1.94  1995/02/01  17:14:12  mike
3642  * comment out some common mprintfs which didn't matter.
3643  *
3644  * Revision 1.93  1995/01/30  13:01:23  mike
3645  * Make robots fire at player other than one they are controlled by sometimes.
3646  *
3647  * Revision 1.92  1995/01/29  22:29:32  mike
3648  * add more debug info for guys that get lost.
3649  *
3650  * Revision 1.91  1995/01/20  16:56:05  mike
3651  * station stuff.
3652  *
3653  * Revision 1.90  1995/01/18  10:59:45  mike
3654  * comment out some mprintfs.
3655  *
3656  * Revision 1.89  1995/01/17  16:58:34  mike
3657  * make path following work for multiplayer.
3658  *
3659  * Revision 1.88  1995/01/17  14:21:44  mike
3660  * make run_from guys run better.
3661  *
3662  * Revision 1.87  1995/01/14  17:09:04  mike
3663  * playing with crazy josh, he's kinda slow and dumb now.
3664  *
3665  * Revision 1.86  1995/01/13  18:52:28  mike
3666  * comment out int3.
3667  *
3668  * Revision 1.85  1995/01/05  09:42:11  mike
3669  * compile out code based on SHAREWARE.
3670  *
3671  * Revision 1.84  1995/01/02  12:38:32  mike
3672  * make crazy josh turn faster, therefore evade player better.
3673  *
3674  * Revision 1.83  1994/12/27  15:59:40  mike
3675  * tweak ai_multiplayer_awareness constants.
3676  *
3677  * Revision 1.82  1994/12/19  17:07:10  mike
3678  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3679  *
3680  * Revision 1.81  1994/12/15  13:04:30  mike
3681  * Replace Players[Player_num].time_total references with GameTime.
3682  *
3683  * Revision 1.80  1994/12/09  16:13:23  mike
3684  * remove debug code.
3685  *
3686  * Revision 1.79  1994/12/07  00:36:54  mike
3687  * make robots get out of matcens better and be aware of player.
3688  *
3689  * Revision 1.78  1994/11/30  00:59:05  mike
3690  * optimizations.
3691  *
3692  * Revision 1.77  1994/11/27  23:13:39  matt
3693  * Made changes for new mprintf calling convention
3694  *
3695  * Revision 1.76  1994/11/23  21:59:34  mike
3696  * comment out some mprintfs.
3697  *
3698  * Revision 1.75  1994/11/21  16:07:14  mike
3699  * flip PARALLAX flag, prevent annoying debug information.
3700  *
3701  * Revision 1.74  1994/11/19  15:13:28  mike
3702  * remove unused code and data.
3703  *
3704  * Revision 1.73  1994/11/17  14:53:15  mike
3705  * segment validation functions moved from editor to main.
3706  *
3707  * Revision 1.72  1994/11/16  23:38:42  mike
3708  * new improved boss teleportation behavior.
3709  *
3710  * Revision 1.71  1994/11/13  17:18:30  mike
3711  * debug code, then comment it out.
3712  *
3713  * Revision 1.70  1994/11/11  16:41:43  mike
3714  * flip the PARALLAX flag.
3715  *
3716  * Revision 1.69  1994/11/11  16:33:45  mike
3717  * twiddle the PARALLAX flag.
3718  *
3719  *
3720  * Revision 1.68  1994/11/10  21:32:29  mike
3721  * debug code.
3722  *
3723  * Revision 1.67  1994/11/10  20:15:07  mike
3724  * fix stupid bug: uninitialized pointer.
3725  *
3726  * Revision 1.66  1994/11/10  17:45:15  mike
3727  * debugging.
3728  *
3729  * Revision 1.65  1994/11/10  17:28:10  mike
3730  * debugging.
3731
3732 ------------------------------------------------------------------------
3733 main/aistruct.h:
3734
3735  * Revision 1.2  1995/10/10  11:49:04  allender
3736  * PC ai code
3737  *
3738  * Revision 1.1  1995/05/16  15:54:08  allender
3739  * Initial revision
3740  *
3741  * Revision 2.0  1995/02/27  11:30:19  john
3742  * New version 2.0, which has no anonymous unions, builds with
3743  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3744  *
3745  * Revision 1.34  1995/01/25  13:50:46  mike
3746  * Robots make angry sounds.
3747  *
3748  * Revision 1.33  1994/12/29  12:44:56  rob
3749  * Added new coop robot flag.
3750  *
3751  * Revision 1.32  1994/12/20  20:41:54  rob
3752  * Added new ai flag for multiplayer robots.
3753  *
3754  * Revision 1.31  1994/12/19  16:37:39  rob
3755  * Added a new flag for remote controlled objects.
3756  *
3757  * Revision 1.30  1994/12/07  00:36:07  mike
3758  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
3759  *
3760  * Revision 1.29  1994/12/02  22:06:28  mike
3761  * add fields to allow robots to make awareness sounds every so often, not every damn blasted frame
3762  *
3763  * Revision 1.28  1994/11/04  17:18:35  yuan
3764  * Increased MAX_SEG_POINTS to 2500.
3765  *
3766  * Revision 1.27  1994/10/17  21:19:22  mike
3767  * robot cloaking.
3768  *
3769  * Revision 1.26  1994/10/12  21:28:38  mike
3770  * Add new ai mode: AIM_OPEN_DOOR.
3771  * Add GOALSIDE to aip.
3772  *
3773  * Revision 1.25  1994/09/25  23:41:08  matt
3774  * Changed the object load & save code to read/write the structure fields one
3775  * at a time (rather than the whole structure at once).  This mean that the
3776  * object structure can be changed without breaking the load/save functions.
3777  * As a result of this change, the local_object data can be and has been
3778  * incorporated into the object array.  Also, timeleft is now a property
3779  * of all objects, and the object structure has been otherwise cleaned up.
3780  *
3781  * Revision 1.24  1994/09/21  12:28:11  mike
3782  * Change AI behavior for when player cloaked
3783  *
3784  * Revision 1.23  1994/09/19  21:43:00  mike
3785  * Add follow_path_start_seg and follow_path_end_seg to aistruct.h.
3786  *
3787  * Revision 1.22  1994/09/18  18:06:14  mike
3788  * Add Last_uncloaked_time and Last_uncloaked_position variables.
3789  *
3790  * Revision 1.21  1994/09/15  16:31:38  mike
3791  * Define GREEN_GUY
3792  * Add previous_visibility to ai_local struct.
3793  *
3794  * Revision 1.20  1994/09/12  19:12:45  mike
3795  * Change some bytes to ints in ai_local so I could set watchpoints.
3796  *
3797  * Revision 1.19  1994/08/25  21:53:31  mike
3798  * Add behavior, taking place of what used to be mode.
3799  *
3800  * Revision 1.18  1994/08/23  16:38:09  mike
3801  * rapidfire_count in ai_local.
3802  *
3803  * Revision 1.17  1994/08/19  17:38:23  mike
3804  * *** empty log message ***
3805  *
3806  * Revision 1.16  1994/08/17  22:18:58  mike
3807  * add time_since_processed to ai_local.
3808  *
3809  * Revision 1.15  1994/08/10  19:52:25  mike
3810  * Add Overall_agitation.
3811  *
3812  * Revision 1.14  1994/08/04  16:32:32  mike
3813  * Add time_player_seen.
3814  *
3815  * Revision 1.13  1994/07/28  16:58:11  mike
3816  * Move constants from ai.c
3817  *
3818  * Revision 1.12  1994/07/19  15:26:24  mike
3819  * New ai_static and ai_local structures.
3820  *
3821  * Revision 1.11  1994/07/15  15:17:19  matt
3822  * Changes MAX_AI_FLAGS for better alignment
3823
3824 ------------------------------------------------------------------------
3825 main/automap.c:
3826
3827  * Revision 1.8  1995/10/31  10:24:54  allender
3828  * shareware stuff
3829  *
3830  * Revision 1.7  1995/10/21  16:18:20  allender
3831  * blit pcx background directly to Page canvas instead of creating
3832  * seperate bitmap for it -- hope to solve VM bug on some macs
3833  *
3834  * Revision 1.6  1995/10/20  00:49:16  allender
3835  * added redbook check during automap
3836  *
3837  * Revision 1.5  1995/09/13  08:44:07  allender
3838  * Dave Denhart's changes to speed up the automap
3839  *
3840  * Revision 1.4  1995/08/18  15:46:00  allender
3841  * put text all on upper bar -- and fixed background since
3842  * changing xparency color
3843  *
3844  * Revision 1.3  1995/08/03  15:15:18  allender
3845  * fixed edge hashing problem causing automap to crash
3846  *
3847  * Revision 1.2  1995/07/12  12:49:27  allender
3848  * works in 640x480 mode
3849  *
3850  * Revision 1.1  1995/05/16  15:22:59  allender
3851  * Initial revision
3852  *
3853  * Revision 2.2  1995/03/21  14:41:26  john
3854  * Ifdef'd out the NETWORK code.
3855  *
3856  * Revision 2.1  1995/03/20  18:16:06  john
3857  * Added code to not store the normals in the segment structure.
3858  *
3859  * Revision 2.0  1995/02/27  11:32:55  john
3860  * New version 2.0, which has no anonymous unions, builds with
3861  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3862  *
3863  * Revision 1.117  1995/02/22  14:11:31  allender
3864  * remove anonymous unions from object structure
3865  *
3866  * Revision 1.116  1995/02/22  13:24:39  john
3867  * Removed the vecmat anonymous unions.
3868  *
3869  * Revision 1.115  1995/02/09  14:57:02  john
3870  * Reduced mem usage. Made automap slide farther.
3871  *
3872  * Revision 1.114  1995/02/07  20:40:44  rob
3873  * Allow for anarchy automap of player pos by option.
3874  *
3875  * Revision 1.113  1995/02/07  15:45:33  john
3876  * Made automap memory be static.
3877  *
3878  * Revision 1.112  1995/02/02  12:24:00  adam
3879  * played with automap labels
3880  *
3881  * Revision 1.111  1995/02/02  01:52:52  john
3882  * Made the automap use small font.
3883  *
3884  * Revision 1.110  1995/02/02  01:34:34  john
3885  * Made Reset in automap not change segmentlimit.
3886  *
3887  * Revision 1.109  1995/02/02  01:23:11  john
3888  * Finalized the new automap partial viewer.
3889  *
3890  * Revision 1.108  1995/02/02  00:49:45  mike
3891  * new automap segment-depth functionality.
3892  *
3893  * Revision 1.107  1995/02/02  00:23:04  john
3894  * Half of the code for new connected distance stuff in automap.
3895  *
3896  * Revision 1.106  1995/02/01  22:54:00  john
3897  * Made colored doors not fade in automap. Made default
3898  * viewing area be maxxed.
3899  *
3900  * Revision 1.105  1995/02/01  13:16:13  john
3901  * Added great grates.
3902  *
3903  * Revision 1.104  1995/01/31  12:47:06  john
3904  * Made Alt+F only work with cheats enabled.
3905  *
3906  * Revision 1.103  1995/01/31  12:41:23  john
3907  * Working with new controls.
3908  *
3909  * Revision 1.102  1995/01/31  12:04:19  john
3910  * Version 2 of new key control.
3911  *
3912  * Revision 1.101  1995/01/31  11:32:00  john
3913  * First version of new automap system.
3914  *
3915  * Revision 1.100  1995/01/28  16:55:48  john
3916  * Made keys draw in automap in the segments that you have
3917  * visited.
3918  *
3919  * Revision 1.99  1995/01/28  14:44:51  john
3920  * Made hostage doors show up on automap.
3921  *
3922  * Revision 1.98  1995/01/22  17:03:49  rob
3923  * Fixed problem drawing playerships in automap coop/team mode
3924  *
3925  * Revision 1.97  1995/01/21  17:23:11  john
3926  * Limited S movement in map. Made map bitmap load from disk
3927  * and then freed it.
3928  *
3929  * Revision 1.96  1995/01/19  18:55:38  john
3930  * Don't draw players in automap if not obj_player.
3931  *
3932  * Revision 1.95  1995/01/19  18:48:13  john
3933  * Made player colors better in automap.
3934  *
3935  * Revision 1.94  1995/01/19  17:34:52  rob
3936  * Added team colorizations in automap.
3937  *
3938  * Revision 1.93  1995/01/19  17:15:36  rob
3939  * Trying to add player ships into map for coop and team mode.
3940  *
3941  * Revision 1.92  1995/01/19  17:11:09  john
3942  * Added code for Rob to draw Multiplayer ships in automap.
3943  *
3944  * Revision 1.91  1995/01/12  13:35:20  john
3945  * Fixed bug with Segment 0 not getting displayed
3946  * in automap if you have EDITOR compiled in.
3947  *
3948  * Revision 1.90  1995/01/08  16:17:14  john
3949  * Added code to draw player's up vector while in automap.
3950  *
3951  * Revision 1.89  1995/01/08  16:09:41  john
3952  * Fixed problems with grate.
3953  *
3954  * Revision 1.88  1994/12/14  22:54:17  john
3955  * Fixed bug that didn't show hostages in automap.
3956  *
3957  * Revision 1.87  1994/12/09  00:41:03  mike
3958  * fix hang in automap print screen
3959  *
3960  * Revision 1.86  1994/12/05  23:37:15  matt
3961  * Took out calls to warning() function
3962  *
3963  * Revision 1.85  1994/12/03  22:35:28  yuan
3964  * Localization 412
3965  *
3966  * Revision 1.84  1994/12/02  15:05:45  matt
3967  * Added new "official" cheats
3968  *
3969  * Revision 1.83  1994/11/30  12:10:49  adam
3970  * added support for PCX titles/brief screens
3971  *
3972  * Revision 1.82  1994/11/27  23:15:12  matt
3973  * Made changes for new mprintf calling convention
3974  *
3975  * Revision 1.81  1994/11/27  15:35:52  matt
3976  * Enable screen shots even when debugging is turned off
3977  *
3978  * Revision 1.80  1994/11/26  22:51:43  matt
3979  * Removed editor-only fields from segment structure when editor is compiled
3980  * out, and padded segment structure to even multiple of 4 bytes.
3981  *
3982  * Revision 1.79  1994/11/26  16:22:48  matt
3983  * Reduced leave_time
3984  *
3985  * Revision 1.78  1994/11/23  22:00:10  mike
3986  * show level number.
3987  *
3988  * Revision 1.77  1994/11/21  11:40:33  rob
3989  * Tweaked the game-loop for automap in multiplayer games.
3990  *
3991  * Revision 1.76  1994/11/18  16:42:06  adam
3992  * removed a font
3993  *
3994  * Revision 1.75  1994/11/17  13:06:48  adam
3995  * changed font
3996  *
3997  * Revision 1.74  1994/11/14  20:47:17  john
3998  * Attempted to strip out all the code in the game
3999  * directory that uses any ui code.
4000
4001 ------------------------------------------------------------------------
4002 main/automap.h:
4003
4004  * Revision 1.2  1995/07/12  12:48:33  allender
4005  * moved edge_list structure into here for mallocing in mglobal
4006  *
4007  * Revision 1.1  1995/05/16  15:54:31  allender
4008  * Initial revision
4009  *
4010  * Revision 2.0  1995/02/27  11:29:35  john
4011  * New version 2.0, which has no anonymous unions, builds with
4012  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4013  *
4014  * Revision 1.5  1994/12/09  00:41:21  mike
4015  * fix hang in automap print screen
4016  *
4017  * Revision 1.4  1994/07/14  11:25:29  john
4018  * Made control centers destroy better; made automap use Tab key.
4019  *
4020  * Revision 1.3  1994/07/12  15:45:51  john
4021  * Made paritial map.
4022  *
4023  * Revision 1.2  1994/07/07  18:35:05  john
4024  * First version of automap
4025  *
4026  * Revision 1.1  1994/07/07  15:12:13  john
4027  * Initial revision
4028
4029 ------------------------------------------------------------------------
4030 main/bm.c:
4031
4032  * Revision 1.1  1995/05/16  15:23:08  allender
4033  * Initial revision
4034  *
4035  * Revision 2.3  1995/03/14  16:22:04  john
4036  * Added cdrom alternate directory stuff.
4037  *
4038  * Revision 2.2  1995/03/07  16:51:48  john
4039  * Fixed robots not moving without edtiro bug.
4040  *
4041  * Revision 2.1  1995/03/06  15:23:06  john
4042  * New screen techniques.
4043  *
4044  * Revision 2.0  1995/02/27  11:27:05  john
4045  * New version 2.0, which has no anonymous unions, builds with
4046  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4047
4048 ------------------------------------------------------------------------
4049 main/bm.h:
4050
4051  * Revision 1.1  1995/05/16  15:54:39  allender
4052  * Initial revision
4053  *
4054  * Revision 2.0  1995/02/27  11:32:59  john
4055  * New version 2.0, which has no anonymous unions, builds with
4056  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4057  *
4058  * Revision 1.60  1994/12/06  13:24:58  matt
4059  * Made exit model come out of bitmaps.tbl
4060  *
4061  * Revision 1.59  1994/11/10  14:02:48  matt
4062  * Hacked in support for player ships with different textures
4063  *
4064  * Revision 1.58  1994/10/27  13:32:17  john
4065  * Made TmapList only be in if editor
4066  *
4067  * Revision 1.57  1994/10/11  12:25:20  matt
4068  * Added "hot rocks" that create badass explosion when hit by weapons
4069  *
4070  * Revision 1.56  1994/09/29  12:38:13  matt
4071  * Took out include of digi.h, saving hours of unneeded compiles
4072  *
4073  * Revision 1.55  1994/09/25  00:39:51  matt
4074  * Added the ability to make eclips (monitors, fans) which can be blown up
4075  *
4076  * Revision 1.54  1994/09/17  01:40:59  matt
4077  * Added status bar/sizable window mode, and in the process revamped the
4078  * whole cockpit mode system.
4079  *
4080  * Revision 1.53  1994/09/08  16:20:48  matt
4081  * Gave textures the ability to cause damage when scraped
4082  *
4083  * Revision 1.52  1994/08/30  22:23:43  matt
4084  * Added cabability for player ship to have alternate model to use to
4085  * create debris.
4086  *
4087  * Revision 1.51  1994/08/26  15:35:57  matt
4088  * Made eclips usable on more than one object at a time
4089  *
4090  * Revision 1.50  1994/08/23  16:59:51  john
4091  * Added 3 cockpuits
4092  *
4093  * Revision 1.49  1994/08/19  20:09:43  matt
4094  * Added end-of-level cut scene with external scene
4095  *
4096  * Revision 1.48  1994/08/12  22:20:45  matt
4097  * Generalized polygon objects (such as control center)
4098  *
4099  * Revision 1.47  1994/08/09  16:04:21  john
4100  * Added network players to editor.
4101  *
4102  * Revision 1.46  1994/08/09  09:01:31  john
4103  * Increase MAX_TEXTURES
4104  *
4105  * Revision 1.45  1994/07/13  00:14:57  matt
4106  * Moved all (or nearly all) of the values that affect player movement to
4107  * bitmaps.tbl
4108  *
4109  * Revision 1.44  1994/06/20  21:33:15  matt
4110  * Made bm.h not include sounds.h, to reduce dependencies
4111  *
4112  * Revision 1.43  1994/06/15  11:55:58  matt
4113  * Added 3d model for player
4114  *
4115  * Revision 1.42  1994/06/13  16:09:11  adam
4116  * increased max textures to 600
4117  *
4118  * Revision 1.41  1994/06/06  15:38:58  john
4119  * Made fullscreen view be just another cockpit, but the "hole"
4120  * in the cockpit is just bigger.
4121  *
4122  * Revision 1.40  1994/05/26  21:08:59  matt
4123  * Moved robot stuff out of polygon model and into robot_info struct
4124  * Made new file, robot.c, to deal with robots
4125  *
4126  * Revision 1.39  1994/05/18  11:00:05  mike
4127  * Add robot_info stuff.
4128  *
4129  * Revision 1.38  1994/05/17  14:44:56  mike
4130  * Get object type and id from ObjType and ObjId.
4131  *
4132  * Revision 1.37  1994/05/17  12:04:45  mike
4133  * Deal with little known fact that polygon object != robot.
4134  *
4135  * Revision 1.36  1994/05/16  16:17:35  john
4136  * Bunch of stuff on my Inferno Task list May16-23
4137  *
4138  * Revision 1.35  1994/04/27  11:43:42  john
4139  * First version of sound! Yay!
4140  *
4141  * Revision 1.34  1994/04/22  10:53:48  john
4142  * Increased MAX_TEXTURES to 500.
4143  *
4144  * Revision 1.33  1994/04/01  11:15:05  yuan
4145  * Added multiple bitmap functionality to all objects...
4146  * (hostages, powerups, lasers, etc.)
4147  * Hostages and powerups are implemented in the object system,
4148  * just need to finish function call to "affect" player.
4149  *
4150  * Revision 1.32  1994/03/25  17:30:37  yuan
4151  * Checking in hostage stuff.
4152  *
4153  * Revision 1.31  1994/03/17  18:07:28  yuan
4154  * Removed switch code... Now we just have Walls, Triggers, and Links...
4155  *
4156  * Revision 1.30  1994/03/15  17:03:51  yuan
4157  * Added Robot/object bitmap capability
4158  *
4159  * Revision 1.29  1994/03/15  16:32:58  yuan
4160  * Cleaned up bm-loading code.
4161  * (Fixed structures too)
4162  *
4163  * Revision 1.28  1994/03/04  17:09:13  yuan
4164  * New door stuff.
4165  *
4166  * Revision 1.27  1994/01/31  14:50:09  yuan
4167  * Added Robotex
4168  *
4169  * Revision 1.26  1994/01/31  12:27:14  yuan
4170  * Added demo stuff (menu, etc.)
4171  *
4172  * Revision 1.25  1994/01/25  17:11:43  john
4173  * New texmaped lasers.
4174  *
4175  * Revision 1.24  1994/01/24  11:48:06  yuan
4176  * Lighting stuff
4177  *
4178  * Revision 1.23  1994/01/22  13:40:15  yuan
4179  * Modified the bmd_bitmap structure a bit.
4180  * (Saves some memory, and added reflection)
4181  *
4182  * Revision 1.22  1994/01/11  10:58:38  yuan
4183  * Added effects system
4184  *
4185  * Revision 1.21  1994/01/06  17:13:12  john
4186  * Added Video clip functionality
4187  *
4188  * Revision 1.20  1993/12/21  20:00:15  john
4189  * moved selector stuff to grs_bitmap
4190  *
4191  * Revision 1.19  1993/12/21  19:33:58  john
4192  * Added selector to bmd_bitmap.
4193  *
4194  * Revision 1.18  1993/12/07  12:28:48  john
4195  * moved bmd_palette to gr_palette
4196  *
4197  * Revision 1.17  1993/12/06  18:40:37  matt
4198  * Changed object loading & handling
4199  *
4200  * Revision 1.16  1993/12/05  23:05:03  matt
4201  * Added include of gr.h
4202  *
4203  * Revision 1.15  1993/12/03  17:38:04  yuan
4204  * Ooops. meant to say:
4205  * Moved MAX variables to bm.c, Arrays left open.
4206  *
4207  * Revision 1.14  1993/12/03  17:37:26  yuan
4208  * Added Asserts.
4209  *
4210  * Revision 1.13  1993/12/02  17:22:54  yuan
4211  * New global var. Num_object_types
4212  *
4213  * Revision 1.12  1993/12/02  16:34:39  yuan
4214  * Added fireball hack stuff.
4215  *
4216  * Revision 1.11  1993/12/02  15:45:14  yuan
4217  * Added a buncha constants, variables, and function prototypes
4218  * for the new bitmaps.tbl format.
4219  *
4220  * Revision 1.10  1993/12/01  11:25:11  yuan
4221  * Changed MALLOC'd buffers for filename and type in
4222  * the bmd_bitmap structure into arrays... Saves time
4223  * at load up.
4224  *
4225  * Revision 1.9  1993/12/01  00:28:09  yuan
4226  * New bitmap system structure.
4227  *
4228  * Revision 1.8  1993/11/03  11:34:08  john
4229  * made it use bitmaps.tbl
4230  *
4231  * Revision 1.7  1993/10/26  18:11:03  john
4232  * made all palette data be statically allocated
4233  *
4234  * Revision 1.6  1993/10/19  12:17:51  john
4235  * *** empty log message ***
4236  *
4237  * Revision 1.5  1993/10/16  20:02:41  matt
4238  * Changed name of backdrop bitmap file
4239  *
4240  * Revision 1.4  1993/10/12  15:08:52  matt
4241  * Added a bunch of new textures
4242  *
4243  * Revision 1.3  1993/10/12  12:30:41  john
4244  * *** empty log message ***
4245  *
4246  * Revision 1.2  1993/10/12  11:27:58  john
4247  * added more bitmaps
4248  *
4249  * Revision 1.1  1993/09/23  13:09:10  john
4250  * Initial revision
4251
4252 ------------------------------------------------------------------------
4253 main/bmread.c:
4254
4255  * Revision 2.4  1995/03/28  18:05:29  john
4256  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
4257  *
4258  * Revision 2.3  1995/03/07  16:52:03  john
4259  * Fixed robots not moving without edtiro bug.
4260  *
4261  * Revision 2.2  1995/03/06  16:10:20  mike
4262  * Fix compile errors if building without editor.
4263  *
4264  * Revision 2.1  1995/03/02  14:55:40  john
4265  * Fixed bug with EDITOR never defined.
4266  *
4267  * Revision 2.0  1995/02/27  11:33:10  john
4268  * New version 2.0, which has no anonymous unions, builds with
4269  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4270  *
4271  * Revision 1.1  1995/02/25  14:02:36  john
4272  * Initial revision
4273
4274 ------------------------------------------------------------------------
4275 main/ctrlcen.c:
4276
4277  * Revision 1.2  1995/10/17  13:12:13  allender
4278  * added param to ai call
4279  *
4280  * Revision 1.1  1995/05/16  15:23:27  allender
4281  * Initial revision
4282  *
4283  * Revision 2.1  1995/03/21  14:40:25  john
4284  * Ifdef'd out the NETWORK code.
4285  *
4286  * Revision 2.0  1995/02/27  11:31:25  john
4287  * New version 2.0, which has no anonymous unions, builds with
4288  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4289  *
4290  * Revision 1.22  1995/02/11  01:56:14  mike
4291  * robots don't fire cheat.
4292  *
4293  * Revision 1.21  1995/02/05  13:39:39  mike
4294  * fix stupid bug in control center firing timing.
4295  *
4296  * Revision 1.20  1995/02/03  17:41:21  mike
4297  * fix control cen next fire time in multiplayer.
4298  *
4299  * Revision 1.19  1995/01/29  13:46:41  mike
4300  * adapt to new create_small_fireball_on_object prototype.
4301  *
4302  * Revision 1.18  1995/01/18  16:12:13  mike
4303  * Make control center aware of a cloaked playerr when he fires.
4304  *
4305  * Revision 1.17  1995/01/12  12:53:44  rob
4306  * Trying to fix a bug with having cntrlcen in robotarchy games.
4307  *
4308  * Revision 1.16  1994/12/11  12:37:22  mike
4309  * make control center smarter about firing at cloaked player, don't fire through self, though
4310  * it still looks that way due to prioritization problems.
4311  *
4312  * Revision 1.15  1994/12/01  11:34:33  mike
4313  * fix control center shield strength in multiplayer team games.
4314  *
4315  * Revision 1.14  1994/11/30  15:44:29  mike
4316  * make cntrlcen harder at higher levels.
4317  *
4318  * Revision 1.13  1994/11/29  22:26:23  yuan
4319  * Fixed boss bug.
4320  *
4321  * Revision 1.12  1994/11/27  23:12:31  matt
4322  * Made changes for new mprintf calling convention
4323  *
4324  * Revision 1.11  1994/11/23  17:29:38  mike
4325  * deal with peculiarities going between net and regular game on boss level.
4326  *
4327  * Revision 1.10  1994/11/18  18:27:15  rob
4328  * Fixed some bugs with the last version.
4329  *
4330  * Revision 1.9  1994/11/18  17:13:59  mike
4331  * special case handling for level 8.
4332  *
4333  * Revision 1.8  1994/11/15  12:45:28  mike
4334  * don't let cntrlcen know where a cloaked player is.
4335  *
4336  * Revision 1.7  1994/11/08  12:18:37  mike
4337  * small explosions on control center.
4338  *
4339  * Revision 1.6  1994/11/02  17:59:18  rob
4340  * Changed control centers so they can find people in network games.
4341  * Side effect of this is that control centers can find cloaked players.
4342  * (see in-code comments for explanation).
4343  * Also added network hooks so control center shots 'sync up'.
4344  *
4345  * Revision 1.5  1994/10/22  14:13:21  mike
4346  * Make control center stop firing shortly after player dies.
4347  * Fix bug: If play from editor and die, tries to initialize non-control center object.
4348  *
4349  * Revision 1.4  1994/10/20  15:17:30  mike
4350  * Hack for control center inside boss robot.
4351  *
4352  * Revision 1.3  1994/10/20  09:47:46  mike
4353  * lots stuff.
4354  *
4355  * Revision 1.2  1994/10/17  21:35:09  matt
4356  * Added support for new Control Center/Main Reactor
4357  *
4358  * Revision 1.1  1994/10/17  20:24:01  matt
4359  * Initial revision
4360
4361 ------------------------------------------------------------------------
4362 main/ctrlcen.h:
4363
4364  * Revision 2.0  1995/02/27  11:30:40  john
4365  * New version 2.0, which has no anonymous unions, builds with
4366  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4367  *
4368  * Revision 1.7  1995/02/01  16:34:14  john
4369  * Linted.
4370  *
4371  * Revision 1.6  1995/01/03  20:19:14  john
4372  * Pretty good working version of game save.
4373  *
4374  * Revision 1.5  1994/11/08  12:18:28  mike
4375  * small explosions on control center.
4376  *
4377  * Revision 1.4  1994/11/02  18:00:12  rob
4378  * Added extern for Gun_pos array for network hooks.
4379  *
4380  * Revision 1.3  1994/10/20  09:47:37  mike
4381  * *** empty log message ***
4382  *
4383  * Revision 1.2  1994/10/17  21:35:10  matt
4384  * Added support for new Control Center/Main Reactor
4385  *
4386  * Revision 1.1  1994/10/17  20:24:28  matt
4387  * Initial revision
4388
4389 ------------------------------------------------------------------------
4390 main/collide.c:
4391
4392  * Revision 1.3  1995/11/08  17:15:21  allender
4393  * make collide_player_and_weapon play player_hit_sound if
4394  * shareware and not my playernum
4395  *
4396  * Revision 1.2  1995/10/31  10:24:37  allender
4397  * shareware stuff
4398  *
4399  * Revision 1.1  1995/05/16  15:23:34  allender
4400  * Initial revision
4401  *
4402  * Revision 2.5  1995/07/26  12:07:46  john
4403  * Made code that pages in weapon_info->robot_hit_vclip not
4404  * page in unless it is a badass weapon.  Took out old functionallity
4405  * of using this if no robot exp1_vclip, since all robots have these.
4406  *
4407  * Revision 2.4  1995/03/30  16:36:09  mike
4408  * text localization.
4409  *
4410  * Revision 2.3  1995/03/24  15:11:13  john
4411  * Added ugly robot cheat.
4412  *
4413  * Revision 2.2  1995/03/21  14:41:04  john
4414  * Ifdef'd out the NETWORK code.
4415  *
4416  * Revision 2.1  1995/03/20  18:16:02  john
4417  * Added code to not store the normals in the segment structure.
4418  *
4419  * Revision 2.0  1995/02/27  11:32:20  john
4420  * New version 2.0, which has no anonymous unions, builds with
4421  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4422  *
4423  * Revision 1.289  1995/02/22  13:56:06  allender
4424  * remove anonymous unions from object structure
4425  *
4426  * Revision 1.288  1995/02/11  15:52:45  rob
4427  * Included text.h.
4428  *
4429  * Revision 1.287  1995/02/11  15:04:11  rob
4430  * Localized a string.
4431  *
4432  * Revision 1.286  1995/02/11  14:25:41  rob
4433  * Added invul. controlcen option.
4434  *
4435  * Revision 1.285  1995/02/06  15:53:00  mike
4436  * create awareness event for player:wall collision.
4437  *
4438  * Revision 1.284  1995/02/05  23:18:17  matt
4439  * Deal with objects (such as fusion blobs) that get created already
4440  * poking through a wall
4441  *
4442  * Revision 1.283  1995/02/01  17:51:33  mike
4443  * fusion bolt can now toast multiple proximity bombs.
4444  *
4445  * Revision 1.282  1995/02/01  17:29:20  john
4446  * Lintized
4447  *
4448  * Revision 1.281  1995/02/01  15:04:00  rob
4449  * Changed sound of weapons hitting invulnerable players.
4450  *
4451  * Revision 1.280  1995/01/31  16:16:35  mike
4452  * Separate smart blobs for robot and player.
4453  *
4454  * Revision 1.279  1995/01/29  15:57:10  rob
4455  * Fixed another bug with robot_request_change calls.
4456  *
4457  * Revision 1.278  1995/01/28  18:15:06  rob
4458  * Fixed a bug in multi_request_robot_change.
4459  *
4460  * Revision 1.277  1995/01/27  15:15:44  rob
4461  * Fixing problems with controlcen damage.
4462  *
4463  * Revision 1.276  1995/01/27  15:13:10  mike
4464  * comment out mprintf.
4465  *
4466  * Revision 1.275  1995/01/26  22:11:51  mike
4467  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4468  *
4469  * Revision 1.274  1995/01/26  18:57:55  rob
4470  * Changed two uses of digi_play_sample to digi_link_sound_to_pos which
4471  * made more sense.
4472  *
4473  * Revision 1.273  1995/01/25  23:37:58  mike
4474  * make persistent objects not hit player more than once.
4475  * Also, make them hit player before degrading them, else they often did 0 damage.
4476  *
4477  * Revision 1.272  1995/01/25  18:23:54  rob
4478  * Don't let players pick up powerups in exit tunnel.
4479  *
4480  * Revision 1.271  1995/01/25  13:43:18  rob
4481  * Added robot transfer for player collisions.
4482  * Removed mprintf from collide.c on Mike's request.
4483  *
4484  * Revision 1.270  1995/01/25  10:24:01  mike
4485  * Make sizzle and rock happen in lava even if you're invulnerable.
4486  *
4487  * Revision 1.269  1995/01/22  17:05:33  mike
4488  * Call multi_robot_request_change when a robot gets whacked by a player or
4489  * player weapon, if player_num != Player_num
4490  *
4491  * Revision 1.268  1995/01/21  21:20:28  matt
4492  * Fixed stupid bug
4493  *
4494  * Revision 1.267  1995/01/21  18:47:47  rob
4495  * Fixed a really dumb bug with player keys.
4496  *
4497  * Revision 1.266  1995/01/21  17:39:30  matt
4498  * Cleaned up laser/player hit wall confusions
4499  *
4500  * Revision 1.265  1995/01/19  17:44:42  mike
4501  * damage_force removed, that information coming from strength field.
4502  *
4503  * Revision 1.264  1995/01/18  17:12:56  rob
4504  * Fixed control stuff for multiplayer.
4505  *
4506  * Revision 1.263  1995/01/18  16:12:33  mike
4507  * Make control center aware of a cloaked playerr when he fires.
4508  *
4509  * Revision 1.262  1995/01/17  17:48:42  rob
4510  * Added key syncing for coop players.
4511  *
4512  * Revision 1.261  1995/01/16  19:30:28  rob
4513  * Fixed an assert error in fireball.c
4514  *
4515  * Revision 1.260  1995/01/16  19:23:51  mike
4516  * Say Boss_been_hit if he been hit so he gates appropriately.
4517  *
4518  * Revision 1.259  1995/01/16  11:55:16  mike
4519  * make enemies become aware of player if he damages control center.
4520  *
4521  * Revision 1.258  1995/01/15  16:42:00  rob
4522  * Fixed problem with robot bumping damage.
4523  *
4524  * Revision 1.257  1995/01/14  19:16:36  john
4525  * First version of new bitmap paging code.
4526  *
4527  * Revision 1.256  1995/01/03  17:58:37  rob
4528  * Fixed scoring problems.
4529  *
4530  * Revision 1.255  1994/12/29  12:41:11  rob
4531  * Tweaking robot exploding in coop.
4532  *
4533  * Revision 1.254  1994/12/28  10:37:59  rob
4534  * Fixed ifdef of multibot stuff.
4535  *
4536  * Revision 1.253  1994/12/21  19:03:14  rob
4537  * Fixing score accounting for multiplayer robots
4538  *
4539  * Revision 1.252  1994/12/21  17:36:31  rob
4540  * Fix hostage pickup problem in network.
4541  * tweaking robot powerup drops.
4542  *
4543  * Revision 1.251  1994/12/19  20:32:34  rob
4544  * Remove awareness events from player collisions and lasers that are not the console player.
4545  *
4546  * Revision 1.250  1994/12/19  20:01:22  rob
4547  * Added multibot.h include.
4548  *
4549  * Revision 1.249  1994/12/19  16:36:41  rob
4550  * Patches damaging of multiplayer robots.
4551  *
4552  * Revision 1.248  1994/12/14  21:15:18  rob
4553  * play lava hiss across network.
4554  *
4555  * Revision 1.247  1994/12/14  17:09:09  matt
4556  * Fixed problem with no sound when lasers hit closed walls, like grates.
4557  *
4558  * Revision 1.246  1994/12/14  09:51:49  mike
4559  * make any weapon cause proximity bomb detonation.
4560  *
4561  * Revision 1.245  1994/12/13  12:55:25  mike
4562  * change number of proximity bomb powerups which get dropped.
4563  *
4564  * Revision 1.244  1994/12/12  17:17:53  mike
4565  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
4566  *
4567  * Revision 1.243  1994/12/12  12:07:51  rob
4568  * Don't take damage if we're in endlevel sequence.
4569  *
4570  * Revision 1.242  1994/12/11  23:44:52  mike
4571  * less phys_apply_rot() at higher skill levels.
4572  *
4573  * Revision 1.241  1994/12/11  12:37:02  mike
4574  * remove stupid robot spinning code.  it was really stupid.  (actually, call here, code in ai.c).
4575  *
4576  * Revision 1.240  1994/12/10  16:44:51  matt
4577  * Added debugging code to track down door that turns into rock
4578  *
4579  * Revision 1.239  1994/12/09  14:59:19  matt
4580  * Added system to attach a fireball to another object for rendering purposes,
4581  * so the fireball always renders on top of (after) the object.
4582  *
4583  * Revision 1.238  1994/12/09  09:57:02  mike
4584  * Don't allow robots or their weapons to pass through control center.
4585  *
4586  * Revision 1.237  1994/12/08  15:46:03  mike
4587  * better robot behavior.
4588  *
4589  * Revision 1.236  1994/12/08  12:32:56  mike
4590  * make boss dying more interesting.
4591  *
4592  * Revision 1.235  1994/12/07  22:49:15  mike
4593  * tweak rotation due to collision.
4594  *
4595  * Revision 1.234  1994/12/07  16:44:50  mike
4596  * make bump sound if supposed to, even if not taking damage.
4597  *
4598  * Revision 1.233  1994/12/07  12:55:08  mike
4599  * tweak rotvel applied from collisions.
4600  *
4601  * Revision 1.232  1994/12/05  19:30:48  matt
4602  * Fixed horrible segment over-dereferencing
4603  *
4604  * Revision 1.231  1994/12/05  00:32:15  mike
4605  * do rotvel on badass and bump collisions.
4606  *
4607  * Revision 1.230  1994/12/03  12:49:22  mike
4608  * don't play bonk sound when you collide with a volatile wall (like lava).
4609  *
4610  * Revision 1.229  1994/12/02  16:51:09  mike
4611  * make lava sound only happen at 4 Hz.
4612  *
4613  * Revision 1.228  1994/11/30  23:55:27  rob
4614  * Fixed a bug where a laser hitting a wall was making 2 sounds.
4615  *
4616  * Revision 1.227  1994/11/30  20:11:00  rob
4617  * Fixed # of dropped laser powerups.
4618  *
4619  * Revision 1.226  1994/11/30  19:19:03  rob
4620  * Transmit collission sounds for net games.
4621  *
4622  * Revision 1.225  1994/11/30  16:33:01  mike
4623  * new boss behavior.
4624  *
4625  * Revision 1.224  1994/11/30  15:44:17  mike
4626  * /2 on boss smart children damage.
4627  *
4628  * Revision 1.223  1994/11/30  14:03:03  mike
4629  * hook for claw sounds
4630  *
4631  * Revision 1.222  1994/11/29  20:41:09  matt
4632  * Deleted a bunch of commented-out lines
4633  *
4634  * Revision 1.221  1994/11/27  23:15:08  matt
4635  * Made changes for new mprintf calling convention
4636  *
4637  * Revision 1.220  1994/11/19  16:11:28  rob
4638  * Collision damage with walls or lava is counted as suicides in net games
4639  *
4640  * Revision 1.219  1994/11/19  15:20:41  mike
4641  * rip out unused code and data
4642  *
4643  * Revision 1.218  1994/11/17  18:44:27  rob
4644  * Added OBJ_GHOST to list of valid player types to create eggs.
4645  *
4646  * Revision 1.217  1994/11/17  14:57:59  mike
4647  * moved segment validation functions from editor to main.
4648  *
4649  * Revision 1.216  1994/11/16  23:38:36  mike
4650  * new improved boss teleportation behavior.
4651  *
4652  * Revision 1.215  1994/11/16  12:16:29  mike
4653  * Enable collisions between robots.  A hack in fvi.c only does this for robots which lunge to attack (eg, green guy)
4654  *
4655  * Revision 1.214  1994/11/15  16:51:50  mike
4656  * bump player when he hits a volatile wall.
4657  *
4658  * Revision 1.213  1994/11/12  16:38:44  mike
4659  * allow flares to open doors.
4660  *
4661  * Revision 1.212  1994/11/10  13:09:19  matt
4662  * Added support for new run-length-encoded bitmaps
4663  *
4664  * Revision 1.211  1994/11/09  17:05:43  matt
4665  * Fixed problem with volatile walls
4666  *
4667  * Revision 1.210  1994/11/09  12:11:46  mike
4668  * only award points if ConsoleObject killed robot.
4669  *
4670  * Revision 1.209  1994/11/09  11:11:03  yuan
4671  * Made wall volatile if either tmap_num1 or tmap_num2 is a volatile wall.
4672  *
4673  * Revision 1.208  1994/11/08  12:20:15  mike
4674  * moved do_controlcen_destroyed_stuff from here to cntrlcen.c
4675  *
4676  * Revision 1.207  1994/11/02  23:22:08  mike
4677  * Make ` (backquote, KEY_LAPOSTRO) tell what wall was hit by laser.
4678  *
4679  * Revision 1.206  1994/11/02  18:03:00  rob
4680  * Fix control_center_been_hit logic so it only cares about the local player.
4681  * Other players take care of their own control center 'ai'.
4682  *
4683  * Revision 1.205  1994/11/01  19:37:33  rob
4684  * Changed the max # of consussion missiles to 4.
4685  * (cause they're lame and clutter things up)
4686  *
4687  * Revision 1.204  1994/11/01  18:06:35  john
4688  * Tweaked wall banging sound constant.
4689  *
4690  * Revision 1.203  1994/11/01  18:01:40  john
4691  * Made wall bang less obnoxious, but volume based.
4692  *
4693  * Revision 1.202  1994/11/01  17:11:05  rob
4694  * Changed some stuff in drop_player_eggs.
4695  *
4696  * Revision 1.201  1994/11/01  12:18:23  john
4697  * Added sound volume support. Made wall collisions be louder/softer.
4698  *
4699  * Revision 1.200  1994/10/31  13:48:44  rob
4700  * Fixed bug in opening doors over network/modem.  Added a new message
4701  * type to multi.c that communicates door openings across the net.
4702  * Changed includes in multi.c and wall.c to accomplish this.
4703  *
4704  * Revision 1.199  1994/10/28  14:42:52  john
4705  * Added sound volumes to all sound calls.
4706  *
4707  * Revision 1.198  1994/10/27  16:58:37  allender
4708  * added demo recording of monitors blowing up
4709  *
4710  * Revision 1.197  1994/10/26  23:20:52  matt
4711  * Tone down flash even more
4712  *
4713  * Revision 1.196  1994/10/26  23:01:50  matt
4714  * Toned down red flash when damaged
4715  *
4716  * Revision 1.195  1994/10/26  15:56:29  yuan
4717  * Tweaked some palette flashes.
4718  *
4719  * Revision 1.194  1994/10/25  11:32:26  matt
4720  * Fixed bugs with vulcan powerups in mutliplayer
4721  *
4722  * Revision 1.193  1994/10/25  10:51:18  matt
4723  * Vulcan cannon powerups now contain ammo count
4724  *
4725  * Revision 1.192  1994/10/24  14:14:05  matt
4726  * Fixed bug in bump_two_objects()
4727  *
4728  * Revision 1.191  1994/10/23  19:17:04  matt
4729  * Fixed bug with "no key" messages
4730  *
4731  * Revision 1.190  1994/10/22  00:08:46  matt
4732  * Fixed up problems with bonus & game sequencing
4733  * Player doesn't get credit for hostages unless he gets them out alive
4734  *
4735  * Revision 1.189  1994/10/21  20:42:34  mike
4736  * Clear number of hostages on board between levels.
4737  *
4738  * Revision 1.188  1994/10/20  15:17:43  mike
4739  * control center in boss handling.
4740  *
4741  * Revision 1.187  1994/10/20  10:09:47  mike
4742  * Only ever drop 1 shield powerup in multiplayer (as an egg).
4743  *
4744  * Revision 1.186  1994/10/20  09:47:11  mike
4745  * Fix bug in dropping vulcan ammo in multiplayer.
4746  * Also control center stuff.
4747  *
4748  * Revision 1.185  1994/10/19  15:14:32  john
4749  * Took % hits out of player structure, made %kills work properly.
4750  *
4751  * Revision 1.184  1994/10/19  11:33:16  john
4752  * Fixed hostage rescued percent.
4753  *
4754  * Revision 1.183  1994/10/19  11:16:49  mike
4755  * Don't allow crazy josh to open locked doors.
4756  * Don't allow weapons to harm parent.
4757  *
4758  * Revision 1.182  1994/10/18  18:37:01  mike
4759  * No more hostage killing.  Too much stuff to do to integrate into game.
4760  *
4761  * Revision 1.181  1994/10/18  16:37:35  mike
4762  * Debug function for Yuan: Show seg:side when hit by puny laser if Show_seg_and_side != 0.
4763  *
4764  * Revision 1.180  1994/10/18  10:53:17  mike
4765  * Support attack type as a property of a robot, not of being == GREEN_GUY.
4766  *
4767  * Revision 1.179  1994/10/17  21:18:36  mike
4768  * diminish damage player does to robot due to collision, only took 2-3 hits to kill a josh.
4769  *
4770  * Revision 1.178  1994/10/17  20:30:40  john
4771  * Made player_hostages_rescued or whatever count properly.
4772  *
4773  * Revision 1.177  1994/10/16  12:42:56  mike
4774  * Trap bogus amount of vulcan ammo dropping.
4775  *
4776  * Revision 1.176  1994/10/15  19:06:51  mike
4777  * Drop vulcan ammo if player has it, but no vulcan cannon (when he dies).
4778  *
4779  * Revision 1.175  1994/10/13  15:42:06  mike
4780  * Remove afterburner.
4781  *
4782  * Revision 1.174  1994/10/13  11:12:57  mike
4783  * Apply damage to robots.  I hosed it a couple weeks ago when I made the green guy special.
4784
4785 ------------------------------------------------------------------------
4786 main/collide.h:
4787
4788  * Revision 1.1  1995/05/16  15:55:09  allender
4789  * Initial revision
4790  *
4791  * Revision 2.0  1995/02/27  11:28:59  john
4792  * New version 2.0, which has no anonymous unions, builds with
4793  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4794  *
4795  * Revision 1.23  1995/01/26  22:11:47  mike
4796  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4797  *
4798  * Revision 1.22  1994/12/21  19:03:24  rob
4799  * Fixing score accounting for multiplayer robots
4800  *
4801  * Revision 1.21  1994/12/21  11:34:56  mike
4802  * make control center take badass damage.
4803  *
4804  * Revision 1.20  1994/10/29  16:53:16  allender
4805  * added check_effect_blowup for demo recording to record monitor explosions
4806  *
4807  * Revision 1.19  1994/10/09  13:46:48  mike
4808  * Make public collide_player_and_powerup.
4809  *
4810  * Revision 1.18  1994/10/05  14:54:29  rob
4811  * Added serial game support in control center sequence..
4812  *
4813  * Revision 1.17  1994/09/15  16:32:12  mike
4814  * Prototype collide_player_and_nasty_robot.
4815  *
4816  * Revision 1.16  1994/09/11  15:49:04  mike
4817  * Prototype for maybe_detonate_weapon.
4818  *
4819  * Revision 1.15  1994/09/09  14:20:07  matt
4820  * Added prototype for scrape function
4821  *
4822  * Revision 1.14  1994/09/02  14:00:44  matt
4823  * Simplified explode_object() & mutliple-stage explosions
4824  *
4825  * Revision 1.13  1994/08/18  10:47:35  john
4826  * Cleaned up game sequencing and player death stuff
4827  * in preparation for making the player explode into
4828  * pieces when dead.
4829  *
4830  * Revision 1.12  1994/08/17  16:50:08  john
4831  * Added damaging fireballs, missiles.
4832  *
4833  * Revision 1.11  1994/08/03  16:45:31  mike
4834  * Prototype a function.
4835  *
4836  * Revision 1.10  1994/08/03  15:17:41  mike
4837  * make matcen whack on you if it's ready to make a robot.
4838  *
4839  * Revision 1.9  1994/07/22  12:08:03  mike
4840  * Make robot hit vclip and sound weapon-based until robot dies, then robot-based.
4841  *
4842  * Revision 1.8  1994/07/09  17:36:31  mike
4843  * Prototype apply_damage_to_robot.
4844  *
4845  * Revision 1.7  1994/07/09  13:20:36  mike
4846  * Prototype apply_damage_to_player.
4847  *
4848  * Revision 1.6  1994/06/20  23:35:52  john
4849  * Bunch of stuff.
4850  *
4851  * Revision 1.5  1994/06/17  18:04:03  yuan
4852  * Added Immaterialization...
4853  * Fixed Invulnerability to allow being hit.
4854  *
4855  * Revision 1.4  1994/05/13  20:28:02  john
4856  * Version II of John's new object code.
4857  *
4858  * Revision 1.3  1994/05/13  12:20:35  john
4859  * Fixed some potential problems with code using global variables
4860  * that are set in fvi.
4861  *
4862  * Revision 1.2  1994/05/12  23:20:32  john
4863  * Moved all object collision handling into collide.c.
4864  *
4865  * Revision 1.1  1994/05/12  20:39:09  john
4866  * Initial revision
4867
4868 ------------------------------------------------------------------------
4869 main/compbit.h:
4870
4871  * Revision 1.1  1995/05/16  15:55:16  allender
4872  * Initial revision
4873  *
4874  * Revision 2.0  1995/02/27  11:28:46  john
4875  * New version 2.0, which has no anonymous unions, builds with
4876  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4877  *
4878  * Revision 1.3  1994/12/05  15:10:28  allender
4879  * changed extern prototype definition
4880  *
4881  * Revision 1.2  1994/10/19  15:43:33  allender
4882  * header file which contains the xor value which is used when encrypting
4883  * bitmaps.tbl
4884  *
4885  * Revision 1.1  1994/10/19  13:22:19  allender
4886  * Initial revision
4887
4888 ------------------------------------------------------------------------
4889 main/config.c:
4890
4891  * Revision 1.8  1995/10/27  10:52:20  allender
4892  * call digi_set_master_volume when prefs are read in to
4893  * set the master volume of the mac
4894  *
4895  * Revision 1.7  1995/10/24  17:08:39  allender
4896  * Config_master_volume added for saving sound manager volume
4897  * across games
4898  *
4899  * Revision 1.6  1995/10/20  00:49:31  allender
4900  * use default values when no prefs file
4901  *
4902  * Revision 1.5  1995/09/21  10:06:58  allender
4903  * set digi and midi volume appropriately
4904  *
4905  * Revision 1.4  1995/09/13  08:49:38  allender
4906  * prefs file stuff
4907  *
4908  * Revision 1.3  1995/09/05  08:47:37  allender
4909  * prefs file working
4910  *
4911  * Revision 1.2  1995/05/26  06:54:14  allender
4912  * removed midi and digi references from config file
4913  *
4914  * Revision 1.1  1995/05/16  15:23:45  allender
4915  * Initial revision
4916  *
4917  * Revision 2.2  1995/03/27  09:42:59  john
4918  * Added VR Settings in config file.
4919  *
4920  * Revision 2.1  1995/03/16  11:20:40  john
4921  * Put in support for Crystal Lake soundcard.
4922  *
4923  * Revision 2.0  1995/02/27  11:30:13  john
4924  * New version 2.0, which has no anonymous unions, builds with
4925  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4926  *
4927  * Revision 1.14  1995/02/11  16:19:36  john
4928  * Added code to make the default mission be the one last played.
4929  *
4930  * Revision 1.13  1995/01/18  13:23:24  matt
4931  * Made curtom detail level vars initialize properly at load
4932  *
4933  * Revision 1.12  1995/01/04  22:15:36  matt
4934  * Fixed stupid bug using scanf() to read bytes
4935  *
4936  * Revision 1.11  1995/01/04  13:14:21  matt
4937  * Made custom detail level settings save in config file
4938  *
4939  * Revision 1.10  1994/12/12  21:35:09  john
4940  * *** empty log message ***
4941  *
4942  * Revision 1.9  1994/12/12  21:31:51  john
4943  * Made volume work better by making sure volumes are valid
4944  * and set correctly at program startup.
4945  *
4946  * Revision 1.8  1994/12/12  13:58:01  john
4947  * MAde -nomusic work.
4948  * Fixed GUS hang at exit by deinitializing digi before midi.
4949  *
4950  * Revision 1.7  1994/12/08  10:01:33  john
4951  * Changed the way the player callsign stuff works.
4952  *
4953  * Revision 1.6  1994/12/01  11:24:07  john
4954  * Made volume/gamma/joystick sliders all be the same length.  0-->8.
4955  *
4956  * Revision 1.5  1994/11/29  02:01:07  john
4957  * Added code to look at -volume command line arg.
4958  *
4959  * Revision 1.4  1994/11/14  20:14:11  john
4960  * Fixed some warnings.
4961  *
4962  * Revision 1.3  1994/11/14  19:51:01  john
4963  * Added joystick cal values to descent.cfg.
4964  *
4965  * Revision 1.2  1994/11/14  17:53:09  allender
4966  * read and write descent.cfg file
4967  *
4968  * Revision 1.1  1994/11/14  16:28:08  allender
4969  * Initial revision
4970
4971 ------------------------------------------------------------------------
4972 main/config.h:
4973
4974  * Revision 1.3  1995/09/08  17:12:26  allender
4975  * added modem tool stuff for prefs file
4976  *
4977  * Revision 1.2  1995/09/05  08:47:48  allender
4978  * prefs file working
4979  *
4980  * Revision 1.1  1995/05/16  15:55:23  allender
4981  * Initial revision
4982  *
4983  * Revision 2.0  1995/02/27  11:32:48  john
4984  * New version 2.0, which has no anonymous unions, builds with
4985  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4986  *
4987  * Revision 1.4  1995/02/11  16:20:06  john
4988  * Added code to make the default mission be the one last played.
4989  *
4990  * Revision 1.3  1994/12/08  10:01:41  john
4991  * Changed the way the player callsign stuff works.
4992  *
4993  * Revision 1.2  1994/11/14  17:53:17  allender
4994  * extern definitions for ReadConfigFile and WriteConfigFile
4995  *
4996  * Revision 1.1  1994/11/14  16:56:17  allender
4997  * Initial revision
4998
4999 ------------------------------------------------------------------------
5000 main/controls.c:
5001
5002  * Revision 1.3  1995/11/20  17:17:27  allender
5003  * call fix_fastsincos with tmp variable to prevent
5004  * writing to NULL
5005  *
5006  * Revision 1.2  1995/08/11  16:00:04  allender
5007  * fixed bug we think we never saw (overflow on max_rotthrust
5008  *
5009  * Revision 1.1  1995/05/16  15:23:53  allender
5010  * Initial revision
5011  *
5012  * Revision 2.0  1995/02/27  11:27:11  john
5013  * New version 2.0, which has no anonymous unions, builds with
5014  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5015  *
5016  * Revision 1.50  1995/02/22  14:11:19  allender
5017  * remove anonymous unions from object structure
5018  *
5019  * Revision 1.49  1994/12/15  13:04:10  mike
5020  * Replace Players[Player_num].time_total references with GameTime.
5021  *
5022  * Revision 1.48  1994/11/27  23:12:13  matt
5023  * Made changes for new mprintf calling convention
5024  *
5025  * Revision 1.47  1994/11/25  22:15:54  matt
5026  * Added asserts to try to trap frametime < 0 bug
5027  *
5028  * Revision 1.46  1994/11/16  11:25:40  matt
5029  * Took out int3's since I determined that the errors are caused by neg frametime
5030  *
5031  * Revision 1.45  1994/11/15  13:07:23  matt
5032  * Added int3's to try to trap bug
5033  *
5034  * Revision 1.44  1994/10/14  16:18:12  john
5035  * Made Assert that the object was player just nicely exit
5036  * the function.
5037  *
5038  * Revision 1.43  1994/10/13  11:35:25  john
5039  * Made Thrustmaster FCS Hat work.  Put a background behind the
5040  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
5041  * menu to new menu. Made F6 be calibrate joystick.
5042  *
5043  * Revision 1.42  1994/09/29  11:22:02  mike
5044  * Zero thrust when player dies.
5045  *
5046  * Revision 1.41  1994/09/16  13:10:30  mike
5047  * Hook in afterburner stuff.
5048  *
5049  * Revision 1.40  1994/09/14  22:21:54  matt
5050  * Avoid post-death assert
5051  *
5052  * Revision 1.39  1994/09/11  20:30:27  matt
5053  * Cleaned up thrust vars, changing a few names
5054  *
5055  * Revision 1.38  1994/09/10  15:46:31  john
5056  * First version of new keyboard configuration.
5057  *
5058  * Revision 1.37  1994/09/07  15:58:12  mike
5059  * Check for player dead in controls so you can't fire or move after dead, logical, huh?
5060  *
5061  * Revision 1.36  1994/09/06  14:51:56  john
5062  * Added sensitivity adjustment, fixed bug with joystick button not
5063  * staying down.
5064  *
5065  * Revision 1.35  1994/09/01  15:43:26  john
5066  * Put pitch bak like it was.
5067  *
5068  * Revision 1.34  1994/08/31  18:59:35  john
5069  * Made rotthrust back like it was.
5070  *
5071  * Revision 1.33  1994/08/31  18:49:17  john
5072  * Slowed Maxrothrust a bit,
5073  * ..
5074  *
5075  * Revision 1.32  1994/08/31  18:32:05  john
5076  * Lower max rotational thrust
5077  *
5078  * Revision 1.31  1994/08/29  21:18:27  john
5079  * First version of new keyboard/oystick remapping stuff.
5080  *
5081  * Revision 1.30  1994/08/29  16:18:30  mike
5082  * trap divide overflow.
5083  *
5084  * Revision 1.29  1994/08/26  14:40:45  john
5085  * *** empty log message ***
5086  *
5087  * Revision 1.28  1994/08/26  12:23:50  john
5088  * MAde joystick read up to 15 times per second max.
5089  *
5090  * Revision 1.27  1994/08/26  10:50:59  john
5091  * Took out Controls_always_stopped.
5092  *
5093  * Revision 1.26  1994/08/26  10:47:27  john
5094  * *** empty log message ***
5095  *
5096  * Revision 1.25  1994/08/26  10:46:50  john
5097  * New version of controls.
5098  *
5099  * Revision 1.24  1994/08/25  19:41:44  john
5100  * *** empty log message ***
5101  *
5102  * Revision 1.23  1994/08/25  18:44:55  john
5103  * *** empty log message ***
5104  *
5105  * Revision 1.22  1994/08/25  18:43:46  john
5106  * First revision of new control code.
5107  *
5108  * Revision 1.21  1994/08/24  20:02:46  john
5109  * Added cyberman support; made keys work key_down_time
5110  * returning seconds instead of milliseconds,.
5111  *
5112  *
5113  * Revision 1.20  1994/08/24  19:00:27  john
5114  * Changed key_down_time to return fixed seconds instead of
5115  * milliseconds.
5116  *
5117  * Revision 1.19  1994/08/19  15:22:12  mike
5118  * Fix divide overflow in sliding.
5119  *
5120  * Revision 1.18  1994/08/19  14:42:50  john
5121  * Added joystick sensitivity.
5122  *
5123  * Revision 1.17  1994/08/17  16:50:01  john
5124  * Added damaging fireballs, missiles.
5125  *
5126  * Revision 1.16  1994/08/12  22:41:54  john
5127  * Took away Player_stats; added Players array.
5128  *
5129  * Revision 1.15  1994/08/09  16:03:56  john
5130  * Added network players to editor.
5131  *
5132  * Revision 1.14  1994/07/28  12:33:31  matt
5133  * Made sliding use thrust, rather than changing velocity directly
5134  *
5135  * Revision 1.13  1994/07/27  20:53:21  matt
5136  * Added rotational drag & thrust, so turning now has momemtum like moving
5137  *
5138  * Revision 1.12  1994/07/25  10:24:06  john
5139  * Victor stuff.
5140  *
5141  * Revision 1.11  1994/07/22  17:53:16  john
5142  * Added better victormax support
5143  *
5144  * Revision 1.10  1994/07/21  21:31:29  john
5145  * First cheapo version of VictorMaxx tracking.
5146  *
5147  * Revision 1.9  1994/07/15  15:16:18  john
5148  * Fixed some joystick stuff.
5149  *
5150  * Revision 1.8  1994/07/15  09:32:09  john
5151  * Changes player movement.
5152  *
5153  * Revision 1.7  1994/07/13  00:14:58  matt
5154  * Moved all (or nearly all) of the values that affect player movement to
5155  * bitmaps.tbl
5156  *
5157  * Revision 1.6  1994/07/12  12:40:14  matt
5158  * Revamped physics system
5159  *
5160  * Revision 1.5  1994/07/02  13:50:39  matt
5161  * Cleaned up includes
5162  *
5163  * Revision 1.4  1994/07/01  10:55:25  john
5164  * Added analog joystick throttle
5165  *
5166  * Revision 1.3  1994/06/30  20:04:28  john
5167  * Added -joydef support.
5168  *
5169  * Revision 1.2  1994/06/30  19:01:58  matt
5170  * Moved flying controls code from physics.c to controls.c
5171  *
5172  * Revision 1.1  1994/06/30  18:41:25  matt
5173  * Initial revision
5174
5175 ------------------------------------------------------------------------
5176 main/controls.h:
5177
5178  * Revision 1.1  1995/05/16  15:55:31  allender
5179  * Initial revision
5180  *
5181  * Revision 2.0  1995/02/27  11:27:17  john
5182  * New version 2.0, which has no anonymous unions, builds with
5183  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5184  *
5185  * Revision 1.4  1994/07/21  18:15:33  matt
5186  * Ripped out a bunch of unused stuff
5187  *
5188  * Revision 1.3  1994/07/15  09:32:08  john
5189  * Changes player movement.
5190  *
5191  * Revision 1.2  1994/06/30  19:02:22  matt
5192  * Moved flying controls code from physics.c to controls.c
5193  *
5194  * Revision 1.1  1994/06/30  18:41:36  matt
5195  * Initial revision
5196
5197 ------------------------------------------------------------------------
5198 main/credits.c:
5199
5200  * Revision 1.8  1995/11/07  13:54:56  allender
5201  * loop shareware song since it is too short
5202  *
5203  * Revision 1.7  1995/10/31  10:24:25  allender
5204  * shareware stuff
5205  *
5206  * Revision 1.6  1995/10/27  15:17:57  allender
5207  * minor fix to get them to look right at top and bottom
5208  * of screens
5209  *
5210  * Revision 1.5  1995/10/21  22:50:49  allender
5211  * credits is way cool!!!!
5212  *
5213  * Revision 1.3  1995/08/08  13:45:26  allender
5214  * added macsys header file
5215  *
5216  * Revision 1.2  1995/07/17  08:49:48  allender
5217  * make work in 640x480 -- still needs major work!!
5218  *
5219  * Revision 1.1  1995/05/16  15:24:01  allender
5220  * Initial revision
5221  *
5222  * Revision 2.2  1995/06/14  17:26:08  john
5223  * Fixed bug with VFX palette not getting loaded for credits, titles.
5224  *
5225  * Revision 2.1  1995/03/06  15:23:30  john
5226  * New screen techniques.
5227  *
5228  * Revision 2.0  1995/02/27  11:29:25  john
5229  * New version 2.0, which has no anonymous unions, builds with
5230  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5231  *
5232  * Revision 1.33  1995/02/11  12:41:56  john
5233  * Added new song method, with FM bank switching..
5234  *
5235  * Revision 1.32  1995/02/03  14:18:06  john
5236  * Added columns.
5237  *
5238  * Revision 1.31  1994/12/28  10:43:00  john
5239  * More VFX tweaking.
5240  *
5241  * Revision 1.30  1994/12/20  18:22:31  john
5242  * Added code to support non-looping songs, and put
5243  * it in for endlevel and credits.
5244  *
5245  * Revision 1.29  1994/12/15  14:23:00  adam
5246  * fixed timing.
5247  *
5248  * Revision 1.28  1994/12/14  16:56:33  adam
5249  * *** empty log message ***
5250  *
5251  * Revision 1.27  1994/12/14  12:18:11  adam
5252  * messed w/timing
5253  *
5254  * Revision 1.26  1994/12/12  22:52:59  matt
5255  * Fixed little bug
5256  *
5257  * Revision 1.25  1994/12/12  22:49:35  adam
5258  * *** empty log message ***
5259  *
5260  * Revision 1.24  1994/12/09  23:16:50  john
5261  * Make credits.txb load.
5262  *
5263  * Revision 1.23  1994/12/09  00:41:54  mike
5264  * fix hang in automap print screen.
5265  *
5266  * Revision 1.22  1994/12/09  00:34:22  matt
5267  * Added support for half-height lines
5268  *
5269  * Revision 1.21  1994/12/08  18:36:03  yuan
5270  * More HOGfile support.
5271  *
5272  * Revision 1.20  1994/12/04  14:48:17  john
5273  * Made credits restore playing descent.hmp.
5274  *
5275  * Revision 1.19  1994/12/04  14:30:20  john
5276  * Added hooks for music..
5277  *
5278  * Revision 1.18  1994/12/04  12:06:46  matt
5279  * Put in support for large font
5280  *
5281  * Revision 1.17  1994/12/01  10:47:27  john
5282  * Took out code that allows keypresses to change scroll rate.
5283  *
5284  * Revision 1.16  1994/11/30  12:10:52  adam
5285  * added support for PCX titles/brief screens
5286  *
5287  * Revision 1.15  1994/11/27  23:12:17  matt
5288  * Made changes for new mprintf calling convention
5289  *
5290  * Revision 1.14  1994/11/27  19:51:46  matt
5291  * Made screen shots work in a few more places
5292  *
5293  * Revision 1.13  1994/11/18  16:41:51  adam
5294  * trimmed some more meat for shareware
5295  *
5296  * Revision 1.12  1994/11/10  20:38:29  john
5297  * Made credits not loop.
5298  *
5299  * Revision 1.11  1994/11/05  15:04:06  john
5300  * Added non-popup menu for the main menu, so that scores and credits don't have to save
5301  * the background.
5302  *
5303  * Revision 1.10  1994/11/05  14:05:52  john
5304  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
5305  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
5306  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
5307  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
5308  *
5309  * Revision 1.9  1994/11/04  12:02:32  john
5310  * Fixed fading transitions a bit more.
5311  *
5312  * Revision 1.8  1994/11/04  11:30:44  john
5313  * Fixed fade transitions between game/menu/credits.
5314  *
5315  * Revision 1.7  1994/11/04  11:06:32  john
5316  * Added code to support credit fade table.
5317  *
5318  * Revision 1.6  1994/11/04  10:16:13  john
5319  * Made the credits fade in/out smoothly on top of a bitmap background.
5320  *
5321  * Revision 1.5  1994/11/03  21:24:12  john
5322  * Made credits exit the instant a key is pressed.
5323  * Made it scroll a bit slower.
5324  *
5325  * Revision 1.4  1994/11/03  21:20:28  john
5326  * Working.
5327  *
5328  * Revision 1.3  1994/11/03  21:01:24  john
5329  * First version of credits that works.
5330  *
5331  * Revision 1.2  1994/11/03  20:17:39  john
5332  * Added initial code for showing credits.
5333  *
5334  * Revision 1.1  1994/11/03  20:09:05  john
5335  * Initial revision
5336
5337 ------------------------------------------------------------------------
5338 main/credits.h:
5339
5340  * Revision 1.1  1995/05/16  15:55:39  allender
5341  * Initial revision
5342  *
5343  * Revision 2.0  1995/02/27  11:32:30  john
5344  * New version 2.0, which has no anonymous unions, builds with
5345  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5346  *
5347  * Revision 1.2  1994/11/03  20:17:40  john
5348  * Added initial code for showing credits.
5349  *
5350  * Revision 1.1  1994/11/03  20:09:19  john
5351  * Initial revision
5352
5353 ------------------------------------------------------------------------
5354 main/desc_id.h:
5355
5356  * Revision 1.1  1995/05/16  15:55:53  allender
5357  * Initial revision
5358  *
5359  * Revision 2.0  1995/02/27  11:29:38  john
5360  * New version 2.0, which has no anonymous unions, builds with
5361  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5362  *
5363  * Revision 1.3  1994/10/19  09:52:57  allender
5364  * Added variable for bogus error number return when game exits
5365  *
5366  * Revision 1.2  1994/10/18  16:43:52  allender
5367  * Added constants for id and time stamping
5368  *
5369  * Revision 1.1  1994/10/17  09:56:47  allender
5370  * Initial revision
5371  * Header for checksum stuff - No idea what for.
5372
5373 ------------------------------------------------------------------------
5374 main/digi.h:
5375
5376  * Revision 2.0  1995/02/27  11:28:40  john
5377  * New version 2.0, which has no anonymous unions, builds with
5378  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5379  *
5380  * Revision 1.29  1995/02/11  12:42:00  john
5381  * Added new song method, with FM bank switching..
5382  *
5383  * Revision 1.28  1995/02/03  17:08:26  john
5384  * Changed sound stuff to allow low memory usage.
5385  * Also, changed so that Sounds isn't an array of digi_sounds, it
5386  * is a ubyte pointing into GameSounds, this way the digi.c code that
5387  * locks sounds won't accidentally unlock a sound that is already playing, but
5388  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
5389  *
5390  * Revision 1.27  1995/02/01  22:20:31  john
5391  * Added digi_is_sound_playing.
5392  *
5393  * Revision 1.26  1994/12/20  18:03:51  john
5394  * Added loop midi flag.
5395  *
5396  * Revision 1.25  1994/12/13  00:46:14  john
5397  * Split digi and midi volume into 2 seperate functions.
5398  *
5399  * Revision 1.24  1994/12/10  20:34:53  john
5400  * Added digi_kill_sound_linked_to_object.
5401  *
5402  * Revision 1.23  1994/12/10  15:59:39  mike
5403  * Fixed bug.
5404  *
5405  * Revision 1.22  1994/12/10  15:44:35  john
5406  * Added max_distance passing for sound objects.
5407  *
5408  * Revision 1.21  1994/12/05  12:17:40  john
5409  * Added code that locks/unlocks digital sounds on demand.
5410  *
5411  * Revision 1.20  1994/11/28  18:34:57  john
5412  * Made the digi_max_channels cut of an old sound instead of
5413  * not playing a new sound.
5414  *
5415  * Revision 1.19  1994/11/14  17:53:56  allender
5416  * made some digi variables extern
5417  *
5418  * Revision 1.18  1994/10/28  14:42:58  john
5419  * Added sound volumes to all sound calls.
5420  *
5421  * Revision 1.17  1994/10/11  15:25:37  john
5422  * Added new function to play a sound once...
5423  *
5424  * Revision 1.16  1994/10/03  20:51:44  john
5425  * Started added pause sound function; for the network I changed to
5426  * packet structure a bit; never tested, though.
5427  *
5428  *
5429  * Revision 1.15  1994/10/03  13:09:43  john
5430  * Added Pause function, but never tested it yet.
5431  *
5432  * Revision 1.14  1994/09/30  10:09:24  john
5433  * Changed sound stuff... made it so the reseting card doesn't hang,
5434  * made volume change only if sound is installed.
5435  *
5436  * Revision 1.13  1994/09/29  21:13:43  john
5437  * Added Master volumes for digi and midi. Also took out panning,
5438  * because it doesn't work with MasterVolume stuff.
5439  *
5440  * Revision 1.12  1994/09/29  12:42:34  john
5441  * Added sidenum to keep track of sound pos. Made sound functions
5442  * not do anything if nosound. Made sounds_init delete currently
5443  * playing sounds.
5444  *
5445  * Revision 1.11  1994/09/29  12:23:42  john
5446  * Added digi_kill_sound_linked_to_segment function.
5447  *
5448  * Revision 1.10  1994/09/29  11:59:04  john
5449  * Added digi_kill_sound
5450  *
5451  * Revision 1.9  1994/09/29  10:37:38  john
5452  * Added sound objects that dynamicaly change volume,pan.
5453  *
5454  * Revision 1.8  1994/09/28  16:18:37  john
5455  * Added capability to play midi song.
5456  *
5457  * Revision 1.7  1994/06/17  18:01:41  john
5458  * A bunch of new stuff by John
5459  *
5460  * Revision 1.6  1994/06/15  19:00:58  john
5461  * Added the capability to make 3d sounds play just once for the
5462  * laser hit wall effects.
5463  *
5464  * Revision 1.5  1994/06/07  10:54:30  john
5465  * Made key S reinit the sound system.
5466  *
5467  * Revision 1.4  1994/05/09  21:11:39  john
5468  * Sound changes; pass index instead of pointer to digi routines.
5469  * Made laser sound cut off the last laser sound.
5470  *
5471  * Revision 1.3  1994/04/27  11:44:25  john
5472  * First version of sound! Yay!
5473  *
5474  * Revision 1.2  1994/04/20  21:58:50  john
5475  * First version of sound stuff... hopefully everything
5476  * is commented out because it hangs..
5477  *
5478  * Revision 1.1  1994/04/15  14:25:02  john
5479  * Initial revision
5480
5481 ------------------------------------------------------------------------
5482 main/dumpmine.c:
5483
5484  * Revision 1.1  1995/05/16  15:24:16  allender
5485  * Initial revision
5486  *
5487  * Revision 2.1  1995/04/06  12:21:50  mike
5488  * Add texture map information to txm files.
5489  *
5490  * Revision 2.0  1995/02/27  11:26:41  john
5491  * New version 2.0, which has no anonymous unions, builds with
5492  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5493  *
5494  * Revision 1.24  1995/01/23  15:34:43  mike
5495  * New diagnostic code, levels.all stuff.
5496  *
5497  * Revision 1.23  1994/12/20  17:56:36  yuan
5498  * Multiplayer object capability.
5499  *
5500  * Revision 1.22  1994/11/27  23:12:19  matt
5501  * Made changes for new mprintf calling convention
5502  *
5503  * Revision 1.21  1994/11/23  12:19:04  mike
5504  * move out level names, stick in gamesave.
5505  *
5506  * Revision 1.20  1994/11/21  16:54:36  mike
5507  * oops.
5508  *
5509  *
5510  * Revision 1.19  1994/11/20  22:12:55  mike
5511  * Lotsa new stuff in this fine debug file.
5512  *
5513  * Revision 1.18  1994/11/17  14:58:09  mike
5514  * moved segment validation functions from editor to main.
5515  *
5516  * Revision 1.17  1994/11/15  21:43:02  mike
5517  * texture usage system.
5518  *
5519  * Revision 1.16  1994/11/15  12:45:59  mike
5520  * debug code for dumping texture info.
5521  *
5522  * Revision 1.15  1994/11/14  20:47:50  john
5523  * Attempted to strip out all the code in the game
5524  * directory that uses any ui code.
5525  *
5526  * Revision 1.14  1994/10/14  17:33:38  mike
5527  * Fix error reporting for number of multiplayer objects in mine.
5528  *
5529  * Revision 1.13  1994/10/14  13:37:46  mike
5530  * Forgot parameter in fprintf, was getting bogus number of excess keys.
5531  *
5532  * Revision 1.12  1994/10/12  08:05:33  mike
5533  * Detect keys contained in objects for error checking (txm file).
5534  *
5535  * Revision 1.11  1994/10/10  17:02:08  mike
5536  * fix fix.
5537  *
5538  * Revision 1.10  1994/10/10  17:00:37  mike
5539  * Add checking for proper number of players.
5540  *
5541  * Revision 1.9  1994/10/03  23:37:19  mike
5542  * Adapt to clear and rational understanding of matcens as related to fuelcens as related to something that might work.
5543  *
5544  * Revision 1.8  1994/09/30  17:15:29  mike
5545  * Fix error message, was telling bogus filename.
5546  *
5547  * Revision 1.7  1994/09/30  11:50:55  mike
5548  * More diagnostics.
5549  *
5550  * Revision 1.6  1994/09/28  17:31:19  mike
5551  * More error checking.
5552  *
5553  * Revision 1.5  1994/09/28  11:14:05  mike
5554  * Better checking on bogus walls.
5555  *
5556  * Revision 1.4  1994/09/28  09:23:50  mike
5557  * Change some Error messages to Warnings.
5558  *
5559  * Revision 1.3  1994/09/27  17:08:31  mike
5560  * More mine validation stuff.
5561  *
5562  * Revision 1.2  1994/09/27  15:43:22  mike
5563  * The amazing code to tell you everything and more about our mines!
5564  *
5565  * Revision 1.1  1994/09/27  10:51:15  mike
5566  * Initial revision
5567
5568 ------------------------------------------------------------------------
5569 main/editor/autosave.c:
5570
5571  * Revision 2.0  1995/02/27  11:34:53  john
5572  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5573  * for bitmaps.tbl.
5574  * 
5575  * Revision 1.25  1994/11/19  00:04:40  john
5576  * Changed some shorts to ints.
5577  * 
5578  * Revision 1.24  1994/11/17  11:38:59  matt
5579  * Ripped out code to load old mines
5580  * 
5581  * Revision 1.23  1994/07/28  17:00:01  mike
5582  * fix diagnostic_message erasing.
5583  * 
5584  * Revision 1.22  1994/07/21  12:48:28  mike
5585  * Make time of day a global, fix clock so it doesn't show 10:2 instead of 10:02
5586  * 
5587  * Revision 1.21  1994/05/14  17:17:58  matt
5588  * Got rid of externs in source (non-header) files
5589  * 
5590  * Revision 1.20  1994/05/02  18:04:14  yuan
5591  * Fixed warning.
5592  * 
5593  * Revision 1.19  1994/05/02  17:59:04  yuan
5594  * Changed undo_status into an array rather than malloced pointers.
5595  * 
5596  * Revision 1.18  1994/03/16  09:55:48  mike
5597  * Flashing : in time.
5598  * 
5599  * Revision 1.17  1994/02/11  10:27:36  matt
5600  * Changed 'if !DEMO' to 'ifndef DEMO'
5601  * 
5602  * Revision 1.16  1994/02/08  12:43:18  yuan
5603  * Crippled save game function from demo version
5604  * 
5605  * Revision 1.15  1994/02/01  13:27:26  yuan
5606  * autosave default off.
5607  * 
5608  * Revision 1.14  1994/01/05  09:57:37  yuan
5609  * Fixed calendar/clock problem.
5610  * 
5611  * Revision 1.13  1993/12/17  16:09:59  yuan
5612  * Changed clock font from Red to Black.
5613  * 
5614  * Revision 1.12  1993/12/15  13:08:38  yuan
5615  * Fixed :0x times, so that the 0 shows up.
5616  * 
5617  * Revision 1.11  1993/12/15  11:19:52  yuan
5618  * Added code to display clock in upper right.
5619  * 
5620  * Revision 1.10  1993/12/14  21:18:51  yuan
5621  * Added diagnostic message to display
5622  * 
5623  * Revision 1.9  1993/12/14  18:32:59  yuan
5624  * Added timed autosave code
5625  * 
5626  * Revision 1.8  1993/12/13  17:23:25  yuan
5627  * Fixed bugs with undo.
5628  * They were caused by badly changed extensions.
5629  * 
5630  * Revision 1.7  1993/12/09  16:42:32  yuan
5631  * Changed extension of temp mines from .mi? -> .mn? 
5632  * and now to .m? (So it doesn't interfere with .mnu)
5633  * 
5634  * Revision 1.6  1993/12/09  16:27:06  yuan
5635  * Added toggle for autosave
5636  * 
5637  * Revision 1.5  1993/11/29  19:46:32  matt
5638  * Changed includes
5639  * 
5640  * Revision 1.4  1993/11/11  15:54:11  yuan
5641  * Added display message for Undo...
5642  * Eg. Attach Segment UNDONE.
5643  * 
5644  * Revision 1.3  1993/11/09  18:53:11  yuan
5645  * Autosave/Undo works up to 10 moves.
5646  * 
5647  * Revision 1.2  1993/11/08  19:14:03  yuan
5648  * Added Undo command (not working yet)
5649  * 
5650  * Revision 1.1  1993/11/08  16:57:59  yuan
5651  * Initial revision
5652
5653 ------------------------------------------------------------------------
5654 main/editor/centers.c:
5655
5656  * Revision 2.0  1995/02/27  11:35:30  john
5657  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5658  * for bitmaps.tbl.
5659  * 
5660  * Revision 1.9  1994/11/27  23:17:28  matt
5661  * Made changes for new mprintf calling convention
5662  * 
5663  * Revision 1.8  1994/10/05  22:13:46  mike
5664  * Clean up Centers dialog.
5665  * 
5666  * Revision 1.7  1994/10/03  23:39:55  mike
5667  * Call fuelcen_activate instead of fuelcen_create.
5668  * 
5669  * Revision 1.6  1994/08/02  12:16:35  mike
5670  * Change materialization center functionality.
5671  * 
5672  * Revision 1.5  1994/08/01  11:04:42  yuan
5673  * New materialization centers.
5674  * 
5675  * Revision 1.4  1994/07/22  17:19:10  yuan
5676  * Working on dialog box for refuel/repair/material/control centers.
5677  * 
5678  * Revision 1.3  1994/07/21  19:35:09  yuan
5679  * Fixed #include problem
5680  * 
5681  * Revision 1.2  1994/07/21  19:02:41  yuan
5682  * *** empty log message ***
5683  * 
5684  * Revision 1.1  1994/07/18  16:00:54  yuan
5685  * Initial revision
5686
5687 ------------------------------------------------------------------------
5688 main/editor/centers.h:
5689
5690  * Revision 2.0  1995/02/27  11:35:02  john
5691  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5692  * for bitmaps.tbl.
5693  * 
5694  * Revision 1.3  1994/08/02  12:16:27  mike
5695  * Prototype Center_names.
5696  * 
5697  * Revision 1.2  1994/07/21  19:35:20  yuan
5698  * Fixed #include problem
5699  * 
5700  * Revision 1.1  1994/07/21  19:11:36  yuan
5701  * Initial revision
5702
5703 ------------------------------------------------------------------------
5704 main/editor/eglobal.c:
5705
5706  * Revision 2.0  1995/02/27  11:35:52  john
5707  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5708  * for bitmaps.tbl.
5709  * 
5710  * Revision 1.35  1994/05/23  14:48:15  mike
5711  * make current segment be add segment.
5712  * 
5713  * Revision 1.34  1994/05/19  12:10:30  matt
5714  * Use new vecmat macros and globals
5715  * 
5716  * Revision 1.33  1994/05/04  19:16:27  mike
5717  * Add Degenerate_segment_found.
5718  * 
5719  * Revision 1.32  1994/05/03  11:02:57  mike
5720  * Add SegSizeMode.
5721  * 
5722  * Revision 1.31  1994/02/16  13:49:12  mike
5723  * enable editor to compile out.
5724  * 
5725  * Revision 1.30  1994/02/10  15:36:35  matt
5726  * Various changes to make editor compile out.
5727  * 
5728  * Revision 1.29  1993/12/16  14:00:33  mike
5729  * Add Curvert and Curedge.
5730  * 
5731  * Revision 1.28  1993/12/10  14:48:28  mike
5732  * Kill orthogonal views.
5733  * 
5734  * Revision 1.27  1993/12/08  10:58:49  mike
5735  * Add Cur_object_index.
5736  * 
5737  * Revision 1.26  1993/12/06  18:45:45  matt
5738  * Changed object loading & handling
5739  * 
5740  * Revision 1.25  1993/12/02  17:51:49  john
5741  * Changed my variable to match Mike's.
5742  * 
5743  * Revision 1.24  1993/12/02  17:36:13  john
5744  * Added cur_obj_type
5745  * 
5746  * Revision 1.23  1993/11/24  14:41:16  mike
5747  * Add variable Num_tilings.
5748  * 
5749  * Revision 1.22  1993/11/12  16:40:55  mike
5750  * Add Identity_matrix, which is an identity matrix.
5751  * 
5752  * Revision 1.21  1993/11/02  13:08:17  mike
5753  * Add N_warning_segs and Warning_segs
5754  * 
5755  * Revision 1.20  1993/11/02  10:31:53  mike
5756  * Document some variables,
5757  * Add Been_visited, removing it from editor.c
5758  * Add Selected_segs[] and N_selected_segs.
5759  * 
5760  * Revision 1.19  1993/10/31  18:07:48  mike
5761  * Add variable Lock_view_to_cursegp.
5762  * 
5763  * Revision 1.18  1993/10/19  20:54:51  matt
5764  * Changed/cleaned up window updates
5765  * 
5766  * Revision 1.17  1993/10/18  18:35:43  mike
5767  * Move Highest_vertex_index and Highest_segment_index here because they need
5768  * to be globals.
5769  * 
5770  * Revision 1.16  1993/10/15  13:10:00  mike
5771  * Move globals from editor.c to eglobal.c
5772  * 
5773  * Revision 1.15  1993/10/14  18:08:55  mike
5774  * Change use of CONNECTIVITY to MAX_SIDES_PER_SEGMENT
5775  * 
5776  * Revision 1.14  1993/10/13  11:11:38  matt
5777  * Made coordinate axes off by default
5778  * 
5779  * Revision 1.13  1993/10/12  09:59:27  mike
5780  * Remove definition of Side_to_verts, which belongs in the game, not in the editor.
5781  * 
5782  * Revision 1.12  1993/10/09  15:48:07  mike
5783  * Change type of Vertex_active and Side_to_verts from char to byte
5784  * Move N_found_segs and Found_segs here from render.c
5785  * Add Show_axes_flag.
5786  * 
5787  * Revision 1.11  1993/10/06  11:29:58  mike
5788  * Add prototype for Side_opposite
5789  * 
5790  * Revision 1.10  1993/10/05  17:00:17  mike
5791  * Add Vertex_active.
5792  * 
5793  * Revision 1.9  1993/10/04  17:18:16  mike
5794  * Add variables Markedsegp, Markedside
5795  * 
5796  * Revision 1.8  1993/10/02  18:18:02  mike
5797  * Added Draw_all_segments.  If !0, then all segments are drawn in draw_world.  If not set, then only those segments which
5798  * are connected to the first segment are drawn.
5799  * 
5800  * Revision 1.7  1993/10/01  10:03:15  mike
5801  * Fix ordering of vertices on front face: Used to be 0,1,2,3 made it 3,2,1,0
5802  * 
5803  * Revision 1.6  1993/09/27  16:04:28  mike
5804  * Add Side_to_verts to replace _verts, which was local to segment.c
5805  * 
5806  * Revision 1.5  1993/09/27  15:20:52  mike
5807  * Add Curside, which is current side, so we can make a certain side active.
5808  * 
5809  * Revision 1.4  1993/09/23  15:01:13  mike
5810  * Remove game specific variables, put in mglobal.c
5811  * 
5812  * Revision 1.3  1993/09/22  10:52:17  mike
5813  * Add global New_segment
5814  * 
5815  * Revision 1.2  1993/09/22  09:41:21  mike
5816  * Change constand and variable names to conform to coding standards.
5817  * 
5818  * Revision 1.1  1993/09/20  17:06:09  mike
5819  * Initial revision
5820
5821 ------------------------------------------------------------------------
5822 main/editor/ehostage.c:
5823
5824  * Revision 2.0  1995/02/27  11:35:45  john
5825  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5826  * for bitmaps.tbl.
5827  * 
5828  * Revision 1.17  1995/01/14  19:18:05  john
5829  * First version of object paging.
5830  * 
5831  * Revision 1.16  1994/11/20  14:11:41  matt
5832  * Show object number in hostage window
5833  * 
5834  * Revision 1.15  1994/11/19  19:55:46  matt
5835  * Added code to full support different hostage head clip & message for
5836  * each hostage.
5837  * 
5838  * 
5839  * Revision 1.14  1994/10/28  15:03:27  john
5840  * Made digi_play_sample use volume.
5841  * 
5842  * 
5843  * Revision 1.13  1994/10/23  02:11:39  matt
5844  * Got rid of obsolete hostage_info stuff
5845  * 
5846  * Revision 1.12  1994/10/04  13:15:44  john
5847  * Changed PLAY_SOUND to digi_play_sample.
5848  * 
5849  * Revision 1.11  1994/08/02  14:17:28  mike
5850  * Clean up dialog boxes.
5851  * 
5852  * Revision 1.10  1994/07/22  17:19:17  yuan
5853  * Working on dialog box for refuel/repair/material/control centers.
5854  * 
5855  * Revision 1.9  1994/07/06  15:22:34  john
5856  * Added new sound.
5857  * 
5858  * 
5859  * Revision 1.8  1994/07/06  14:26:07  john
5860  * Added vclip.
5861  * 
5862  * Revision 1.7  1994/07/06  13:25:52  john
5863  * Added compress hostages functions.
5864  * 
5865  * Revision 1.6  1994/07/06  12:52:27  john
5866  * Fixed warnings.
5867  * 
5868  * Revision 1.5  1994/07/06  12:43:04  john
5869  * Made generic messages for hostages.
5870  * 
5871  * Revision 1.4  1994/07/06  11:49:01  john
5872  * Made adding hostage update current object.
5873  * 
5874  * Revision 1.3  1994/07/06  10:56:00  john
5875  * New structures for hostages.
5876  * 
5877  * Revision 1.2  1994/07/01  17:57:13  john
5878  * First version of not-working hostage system
5879  * 
5880  * 
5881  * Revision 1.1  1994/07/01  14:21:44  john
5882  * Initial revision
5883
5884 ------------------------------------------------------------------------
5885 main/editor/ehostage.h:
5886
5887  * Revision 2.0  1995/02/27  11:35:13  john
5888  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5889  * for bitmaps.tbl.
5890  * 
5891  * Revision 1.2  1994/07/01  17:57:14  john
5892  * First version of not-working hostage system
5893  * 
5894  * 
5895  * Revision 1.1  1994/07/01  14:24:41  john
5896  * Initial revision
5897
5898 ------------------------------------------------------------------------
5899 main/editor/elight.c:
5900
5901  * Revision 2.0  1995/02/27  11:35:16  john
5902  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5903  * for bitmaps.tbl.
5904  * 
5905  * Revision 1.21  1994/06/14  16:59:23  mike
5906  * Fix references to tmap_num2, must strip off orientation bits.
5907  * 
5908  * Revision 1.20  1994/05/31  12:31:57  mike
5909  * fix bug in lighting -- WALL_IS_DOORWAY return value getting ignored,
5910  * almost never recursively propagated light.
5911  * 
5912  * Revision 1.19  1994/05/19  23:35:12  mike
5913  * Support uv coordinates in range 0..1.0.
5914  * 
5915  * Revision 1.18  1994/05/16  12:05:29  john
5916  * Made texturemap light be a fix from 0 to 1.
5917  * 
5918  * Revision 1.17  1994/05/14  18:00:38  matt
5919  * Got rid of externs in source (non-header) files
5920  * 
5921  * Revision 1.16  1994/05/03  11:04:27  mike
5922  * Add function to select edge.
5923  * 
5924  * Revision 1.15  1994/04/20  17:29:11  yuan
5925  * Fixed bug where tmaps above 256 don't light properly.
5926  * (duh!)
5927  * 
5928  * Revision 1.14  1994/03/22  14:20:46  yuan
5929  * Made texture map 1 also cast light.  (Cumulative with tmap_num2)
5930  * 
5931  * Revision 1.13  1994/03/15  16:34:14  yuan
5932  * Fixed bm loader (might have some changes in walls and switches)
5933  * 
5934  * Revision 1.12  1994/02/22  18:55:10  yuan
5935  * Ambient lighting "shines" on doors too!
5936  * 
5937  * Revision 1.11  1994/02/17  12:05:55  matt
5938  * Got rid of warnings
5939  * 
5940  * Revision 1.10  1994/02/16  22:28:03  mike
5941  * fix ambient lighting and smoothing.
5942  * 
5943  * Revision 1.9  1994/02/14  12:05:42  mike
5944  * change segment data structure.
5945  * 
5946  * Revision 1.8  1994/01/26  17:27:45  yuan
5947  * Still not perfected ambient lighting
5948  * 
5949  * Revision 1.7  1994/01/25  17:58:08  yuan
5950  * Added ambient lighting, and also added fixing bogus segments
5951  * functions to the editor... (they don't work fully... need to
5952  * check out seguvs.c
5953  * 
5954  * Revision 1.6  1994/01/24  11:46:10  yuan
5955  * *** empty log message ***
5956  * 
5957  * Revision 1.5  1994/01/24  11:03:05  yuan
5958  * Set lgiht maximum added... Changes are still in progress
5959  * 
5960  * Revision 1.4  1994/01/18  19:16:07  yuan
5961  * Added assign default to lighting pad.
5962  * 
5963  * Revision 1.3  1993/12/17  12:26:00  mike
5964  * Add functions for setting light values on whole segment at once.
5965  * 
5966  * Revision 1.2  1993/12/16  16:56:12  mike
5967  * Add new texture map lighting control functions.
5968  * 
5969  * Revision 1.1  1993/12/16  13:21:50  mike
5970  * Initial revision
5971
5972 ------------------------------------------------------------------------
5973 main/editor/eobject.c:
5974
5975  * Revision 2.0  1995/02/27  11:35:14  john
5976  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5977  * for bitmaps.tbl.
5978  * 
5979  * Revision 1.93  1995/02/22  15:09:04  allender
5980  * remove anonymous unions from object structure
5981  * 
5982  * Revision 1.92  1995/01/12  12:10:32  yuan
5983  * Added coop object capability.
5984  * 
5985  * Revision 1.91  1994/12/20  17:57:02  yuan
5986  * Multiplayer object stuff.
5987  * 
5988  * Revision 1.90  1994/11/27  23:17:49  matt
5989  * Made changes for new mprintf calling convention
5990  * 
5991  * Revision 1.89  1994/11/17  14:48:06  mike
5992  * validation functions moved from editor to game.
5993  * 
5994  * Revision 1.88  1994/11/14  11:40:03  mike
5995  * fix default robot behavior.
5996  * 
5997  * Revision 1.87  1994/10/25  10:51:31  matt
5998  * Vulcan cannon powerups now contain ammo count
5999  * 
6000  * Revision 1.86  1994/10/23  02:11:40  matt
6001  * Got rid of obsolete hostage_info stuff
6002  * 
6003  * Revision 1.85  1994/10/17  21:35:32  matt
6004  * Added support for new Control Center/Main Reactor
6005  * 
6006  * Revision 1.84  1994/10/10  17:23:13  mike
6007  * Verify that not placing too many player objects.
6008  * 
6009  * Revision 1.83  1994/09/24  14:15:35  mike
6010  * Custom colored object support.
6011  * 
6012  * Revision 1.82  1994/09/15  22:58:12  matt
6013  * Made new objects be oriented to their segment
6014  * Added keypad function to flip an object upside-down
6015  * 
6016  * Revision 1.81  1994/09/01  10:58:41  matt
6017  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
6018  * correctly if width & height of bitmap are different.
6019  * 
6020  * Revision 1.80  1994/08/25  21:58:14  mike
6021  * Write ObjectSelectPrevInMine and something else, I think...
6022  * 
6023  * Revision 1.79  1994/08/16  20:19:54  mike
6024  * Make STILL default (from CHASE_OBJECT).
6025  * 
6026  * Revision 1.78  1994/08/14  23:15:45  matt
6027  * Added animating bitmap hostages, and cleaned up vclips a bit
6028  * 
6029  * Revision 1.77  1994/08/13  14:58:43  matt
6030  * Finished adding support for miscellaneous objects
6031  * 
6032  * Revision 1.76  1994/08/12  22:24:58  matt
6033  * Generalized polygon objects (such as control center)
6034  * 
6035  * Revision 1.75  1994/08/09  16:06:11  john
6036  * Added the ability to place players.  Made old
6037  * Player variable be ConsoleObject.
6038  * 
6039  * Revision 1.74  1994/08/05  18:18:55  matt
6040  * Made object rotation have 4x resolution, and SHIFT+rotate do old resolution.
6041  * 
6042  * Revision 1.73  1994/08/01  13:30:56  matt
6043  * Made fvi() check holes in transparent walls, and changed fvi() calling
6044  * parms to take all input data in query structure.
6045
6046 ------------------------------------------------------------------------
6047 main/editor/eobject.h:
6048
6049  * Revision 2.0  1995/02/27  11:35:30  john
6050  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6051  * for bitmaps.tbl.
6052  * 
6053  * Revision 1.5  1994/09/15  22:57:46  matt
6054  * Made new objects be oriented to their segment
6055  * Added keypad function to flip an object upside-down
6056  * 
6057  * Revision 1.4  1994/08/25  21:57:23  mike
6058  * Prototype ObjectSelectPrevInMine, and probably wrote it too, though not in this file.
6059  * 
6060  * Revision 1.3  1994/08/05  18:17:48  matt
6061  * Made object rotation have 4x resolution, and SHIFT+rotate do old resolution.
6062  * 
6063  * Revision 1.2  1994/05/14  18:00:59  matt
6064  * Got rid of externs in source (non-header) files
6065  * 
6066  * Revision 1.1  1994/05/14  17:36:30  matt
6067  * Initial revision
6068
6069 ------------------------------------------------------------------------
6070 main/editor/eswitch.c:
6071
6072  * Revision 2.0  1995/02/27  11:35:18  john
6073  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6074  * for bitmaps.tbl.
6075  * 
6076  * Revision 1.33  1995/01/14  19:18:04  john
6077  * First version of object paging.
6078  * 
6079  * Revision 1.32  1994/11/27  23:18:01  matt
6080  * Made changes for new mprintf calling convention
6081  * 
6082  * Revision 1.31  1994/11/07  10:55:42  yuan
6083  * *** empty log message ***
6084  * 
6085  * Revision 1.30  1994/10/13  13:15:06  yuan
6086  * Fixed trigger removal bug.
6087  * 
6088  * Revision 1.29  1994/10/06  21:24:16  matt
6089  * Added switch for exit to secret level
6090  * 
6091  * Revision 1.28  1994/09/29  17:06:10  matt
6092  * Took out references to obsolete external triggers
6093  * 
6094  * Revision 1.27  1994/09/28  13:40:34  yuan
6095  * Fixed control center trigger bug.
6096  * 
6097  * Revision 1.26  1994/09/26  16:25:04  yuan
6098  * Only allow one binding of each matcen .
6099  * 
6100  * Revision 1.25  1994/09/24  17:10:19  yuan
6101  * Added Matcen triggers.
6102  * 
6103  * Revision 1.24  1994/09/20  18:23:58  yuan
6104  * Killed the BOGIFYING WALL DRAGON...
6105  * 
6106  * There was a problem with triggers being created that had bogus
6107  * pointers back to their segments.
6108  * 
6109  * Revision 1.23  1994/08/25  21:56:33  mike
6110  * IS_CHILD stuff.
6111  * 
6112  * Revision 1.22  1994/08/15  18:06:54  yuan
6113  * Added external trigger.
6114  * 
6115  * Revision 1.21  1994/07/22  17:18:47  yuan
6116  * Working on dialog box for refuel/repair/material/control centers.
6117  * 
6118  * Revision 1.20  1994/07/06  10:55:55  john
6119  * New structures for hostages.
6120  * 
6121  * Revision 1.19  1994/07/01  16:36:20  yuan
6122  * Working on triggers that aren't always on.
6123  * 
6124  * Revision 1.18  1994/06/21  18:50:14  john
6125  * Made ESC key exit dialog.
6126  * 
6127  * Revision 1.17  1994/06/20  22:30:36  yuan
6128  * Fixed crazy runaway trigger bug that Adam found
6129  * 
6130  * Revision 1.16  1994/05/31  10:03:48  yuan
6131  * Fixed compiler warnings...
6132  * 
6133  * 
6134  * Revision 1.15  1994/05/30  20:22:30  yuan
6135  * New triggers.
6136  * 
6137  * Revision 1.14  1994/05/27  12:33:50  yuan
6138  * Fixed some bugs when adding trigger.
6139  * 
6140  * Revision 1.13  1994/05/27  10:34:29  yuan
6141  * Added new Dialog boxes for Walls and Triggers.
6142  * 
6143  * Revision 1.12  1994/05/25  18:15:02  yuan
6144  * Fixed make warnings to save 10 cents!
6145  * 
6146  * Revision 1.11  1994/05/25  18:08:03  yuan
6147  * Revamping walls and triggers interface.
6148  * Wall interface complete, but triggers are still in progress.
6149  * 
6150  * Revision 1.10  1994/04/29  15:05:50  yuan
6151  * Trigger/Link removing stuff still needs to be fixed.
6152  * 
6153  * Revision 1.9  1994/04/28  23:25:34  yuan
6154  * Obliterated warnings.
6155  * 
6156  * Revision 1.8  1994/04/28  18:08:06  yuan
6157  * Fixed trigger bug.
6158
6159 ------------------------------------------------------------------------
6160 main/editor/eswitch.h:
6161
6162  * Revision 2.0  1995/02/27  11:35:40  john
6163  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6164  * for bitmaps.tbl.
6165  * 
6166  * Revision 1.6  1994/05/30  20:22:35  yuan
6167  * New triggers.
6168  * 
6169  * Revision 1.5  1994/05/27  10:34:35  yuan
6170  * Added new Dialog boxes for Walls and Triggers.
6171  * 
6172  * Revision 1.4  1994/05/25  18:08:39  yuan
6173  * Revamping walls and triggers interface.
6174  * Wall interface complete, but triggers are still in progress.
6175  * 
6176  * Revision 1.3  1994/04/28  23:46:56  yuan
6177  * Added prototype for remove_trigger.
6178  * 
6179  * Revision 1.2  1994/03/15  16:34:20  yuan
6180  * Fixed bm loader (might have some changes in walls and switches)
6181  * 
6182  * Revision 1.1  1994/03/10  14:49:03  yuan
6183  * Initial revision
6184
6185 ------------------------------------------------------------------------
6186 main/editor/fixseg.c:
6187
6188  * Revision 2.0  1995/02/27  11:36:25  john
6189  * Version 2.0. Ansi-fied.
6190  * 
6191  * Revision 1.7  1994/11/27  23:18:01  matt
6192  * Made changes for new mprintf calling convention
6193  * 
6194  * Revision 1.6  1994/11/17  14:48:00  mike
6195  * validation functions moved from editor to game.
6196  * 
6197  * Revision 1.5  1994/08/04  19:13:26  matt
6198  * Changed a bunch of vecmat calls to use multiple-function routines, and to
6199  * allow the use of C macros for some functions
6200  * 
6201  * Revision 1.4  1994/02/10  15:36:31  matt
6202  * Various changes to make editor compile out.
6203  * 
6204  * Revision 1.3  1993/12/03  18:45:09  mike
6205  * initial stuff.
6206  * 
6207  * Revision 1.2  1993/11/30  17:05:09  mike
6208  * Added part of code to make a side planar.
6209  * 
6210  * Revision 1.1  1993/11/30  10:05:36  mike
6211  * Initial revision
6212
6213 ------------------------------------------------------------------------
6214 main/editor/func.c:
6215
6216  * Revision 1.1  1994/11/21  14:13:17  matt
6217  * Initial revision
6218  * 
6219  * Revision 1.1  1993/11/15  12:28:17  john
6220  * Initial revision
6221
6222 ------------------------------------------------------------------------
6223 main/editor/group.c:
6224
6225  * Revision 2.0  1995/02/27  11:35:05  john
6226  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6227  * for bitmaps.tbl.
6228  * 
6229  * Revision 1.65  1994/11/27  23:17:21  matt
6230  * Made changes for new mprintf calling convention
6231  * 
6232  * Revision 1.64  1994/11/17  14:48:08  mike
6233  * validation functions moved from editor to game.
6234  * 
6235  * Revision 1.63  1994/11/17  11:38:56  matt
6236  * Ripped out code to load old mines
6237  * 
6238  * Revision 1.62  1994/10/27  10:06:20  mike
6239  * adapt to no inverse table.
6240  * 
6241  * Revision 1.61  1994/10/03  23:40:08  mike
6242  * New fuelcen_activate parameters.
6243  * 
6244  * Revision 1.60  1994/09/28  17:32:01  mike
6245  * Make group copying work for copying a group's walls.
6246  * 
6247  * Revision 1.59  1994/09/20  14:35:28  mike
6248  * Fix bugs in group subtraction code.  Don't allow to attach a group if the attach side is unfree.
6249  * 
6250  * Revision 1.58  1994/08/25  21:58:07  mike
6251  * IS_CHILD stuff.
6252  * 
6253  * Revision 1.57  1994/08/04  19:12:58  matt
6254  * Changed a bunch of vecmat calls to use multiple-function routines, and to
6255  * allow the use of C macros for some functions
6256  * 
6257  * Revision 1.56  1994/08/03  15:40:01  mike
6258  * Enable calls to compress_mine to get rid of bugs in group
6259  * copying -- was creating invalid segments.
6260  * 
6261  * Revision 1.55  1994/06/30  10:59:13  yuan
6262  * Fixed texture translations.
6263  * 
6264  * Revision 1.54  1994/06/22  17:36:00  mike
6265  * Fix bug in group creation, was stuffing first two group segs over number
6266  * of segments in group (then number would overwrite them), so there would
6267  * be two bogus segments in group, one of which was always 0, the other
6268  * would be a small number.
6269  * 
6270  * Revision 1.53  1994/06/14  17:07:15  john
6271  * *** empty log message ***
6272  * 
6273  * Revision 1.52  1994/06/14  16:59:09  mike
6274  * Fix references to tmap_num2, must strip off orientation bits.
6275  * 
6276  * Revision 1.51  1994/05/23  14:56:37  mike
6277  * make current segment be add segment.
6278  * 
6279  * Revision 1.50  1994/05/19  12:10:01  matt
6280  * Use new vecmat macros and globals
6281  * 
6282  * Revision 1.49  1994/05/17  10:33:59  matt
6283  * Deleted unused get_free_object_num() func.
6284  * 
6285  * Revision 1.48  1994/05/09  23:34:17  mike
6286  * Punch all sloppy sides in a group, speed up segment rotation.
6287  * 
6288  * Revision 1.47  1994/05/06  14:39:56  mike
6289  * Make objects move and copy with groups.
6290  * 
6291  * Revision 1.46  1994/05/05  16:05:54  yuan
6292  * Added fuelcen/repaircens to groups...
6293  * 
6294  * Eventually, walls will be added too...
6295  * 
6296  * Revision 1.45  1994/05/05  12:56:25  yuan
6297  * Fixed a bunch of group bugs.
6298  * 
6299  * Revision 1.44  1994/05/04  14:10:04  mike
6300  * Assert added to prevent bombing out when current_group = -1
6301  * 
6302  * Revision 1.43  1994/05/02  17:59:18  yuan
6303  * Changed undo_status into an array rather than malloced pointers.
6304  * 
6305  * Revision 1.42  1994/05/02  15:23:19  mike
6306  * Call med_combine_duplicate_vertices in med_copy_group and med_move_group.
6307  * 
6308  * Revision 1.41  1994/04/27  12:11:23  mike
6309  * Fix bug in group rotation.
6310  * 
6311  * Revision 1.40  1994/04/22  10:07:37  yuan
6312  * Make sure we don't get obj->next equal itself error.
6313  * 
6314  * Revision 1.39  1994/04/18  17:15:13  yuan
6315  * Added error checking for select prev, and next group.
6316
6317 ------------------------------------------------------------------------
6318 main/editor/info.c:
6319
6320  * Revision 2.0  1995/02/27  11:35:34  john
6321  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6322  * for bitmaps.tbl.
6323  * 
6324  * Revision 1.42  1995/02/22  15:12:50  allender
6325  * remove anonymous unions from object structure
6326  * 
6327  * Revision 1.41  1994/12/08  13:59:39  matt
6328  * *** empty log message ***
6329  * 
6330  * Revision 1.40  1994/09/30  00:38:30  mike
6331  * Fix some diagnostic messages
6332  * 
6333  * Revision 1.39  1994/09/29  20:13:12  mike
6334  * Clean up some text, prevent it from writing outside canvas.
6335  * 
6336  * Revision 1.38  1994/09/29  09:32:17  mike
6337  * Fix text clipping problem in UI keypad info text.
6338  * 
6339  * Revision 1.37  1994/09/25  23:42:20  matt
6340  * Took out references to obsolete constants
6341  * 
6342  * Revision 1.36  1994/08/25  21:57:05  mike
6343  * IS_CHILD stuff.
6344  * 
6345  * Revision 1.35  1994/08/23  16:39:50  mike
6346  * mode replaced by behavior in ai_info.
6347  * 
6348  * Revision 1.34  1994/07/18  10:45:23  mike
6349  * Fix erase window in texture pads after adding more click-boxes.
6350  * 
6351  * Revision 1.33  1994/07/15  12:34:10  mike
6352  * Remove use of AIM_FOLLOW_PATH_CIRCULAR.
6353  * 
6354  * Revision 1.32  1994/06/17  17:13:46  yuan
6355  * Fixed text so it doesn't overflow screen
6356  * 
6357  * Revision 1.31  1994/06/01  17:22:31  matt
6358  * Set font color before drawing info; got rid of superfluous %d
6359  * 
6360  * Revision 1.30  1994/05/29  23:40:29  matt
6361  * Killed reference to now-unused movement type
6362  * 
6363  * Revision 1.29  1994/05/29  22:52:32  matt
6364  * Deleted unused stuff
6365  * 
6366  * Revision 1.28  1994/05/27  10:34:16  yuan
6367  * Added new Dialog boxes for Walls and Triggers.
6368  * 
6369  * Revision 1.27  1994/05/17  10:34:35  matt
6370  * Changed Num_objects to num_objects, since it's not really global anymore
6371  * 
6372  * Revision 1.26  1994/05/14  17:17:59  matt
6373  * Got rid of externs in source (non-header) files
6374  * 
6375  * Revision 1.25  1994/05/12  14:47:07  mike
6376  * Adjust for Ai_states killed, replaced by field in object structure.
6377  * 
6378  * Revision 1.24  1994/05/06  12:52:11  yuan
6379  * Adding some gamesave checks...
6380  * 
6381  * Revision 1.23  1994/05/03  19:21:28  matt
6382  * Removed reference to robot flythrough mode, which doesn't exist anymore
6383  * 
6384  * Revision 1.22  1994/05/03  11:03:06  mike
6385  * Customize text for segment sizing keypad.
6386  * 
6387  * Revision 1.21  1994/04/29  15:05:40  yuan
6388  * More info added...
6389  * 
6390  * Revision 1.20  1994/04/22  17:45:58  john
6391  * MAde top 2 bits of paste-ons pick the 
6392  * orientation of the bitmap.
6393  * 
6394  * Revision 1.19  1994/04/20  17:29:30  yuan
6395  * Added tmap_num info.
6396  * 
6397  * Revision 1.18  1994/04/13  19:12:55  mike
6398  * Fix font color problems in keypads.
6399  * 
6400  * Revision 1.17  1994/04/13  13:26:37  mike
6401  * Kill a mprintf.
6402  * 
6403  * Revision 1.16  1994/04/13  13:24:44  mike
6404  * Separate info display, customize for each keypad.
6405  * 
6406  * Revision 1.15  1994/03/19  17:21:31  yuan
6407  * Wall system implemented until specific features need to be added...
6408  * (Needs to be hammered on though.)
6409  * 
6410  * Revision 1.14  1994/02/22  18:13:13  yuan
6411  * Added tmap number field.
6412  * 
6413  * Revision 1.13  1994/02/17  09:46:27  matt
6414  * Removed include of slew.h
6415  * 
6416  * Revision 1.12  1994/02/16  19:58:56  yuan
6417  * Added type to info
6418  * 
6419  * Revision 1.11  1994/02/16  16:48:08  yuan
6420  * Added Curside.
6421  * 
6422  * Revision 1.10  1994/02/03  17:26:43  yuan
6423  * Fixed formatting of vertex numbering.
6424  * 
6425  * Revision 1.9  1994/01/31  12:17:06  yuan
6426  * Make sure Num_segments, etc. are drawn.
6427  * 
6428  * Revision 1.8  1994/01/22  13:43:12  yuan
6429  * Cosmetic fixes.
6430  * 
6431  * Revision 1.7  1994/01/21  12:14:59  yuan
6432  * Fixed cosmetic problem
6433  * 
6434  * Revision 1.6  1994/01/21  12:01:03  yuan
6435  * Added segment and vertex info
6436  * 
6437  * Revision 1.5  1994/01/20  11:28:11  john
6438  * *** empty log message ***
6439  * 
6440  * Revision 1.4  1994/01/19  10:44:42  john
6441  * *** empty log message ***
6442  * 
6443  * Revision 1.3  1994/01/19  10:32:36  john
6444  * *** empty log message ***
6445  * 
6446  * Revision 1.2  1994/01/19  09:34:31  john
6447  * First version.
6448  * 
6449  * Revision 1.1  1994/01/19  09:30:43  john
6450  * Initial revision
6451
6452 ------------------------------------------------------------------------
6453 main/editor/info.h:
6454
6455  * Revision 2.0  1995/02/27  11:34:32  john
6456  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6457  * for bitmaps.tbl.
6458  * 
6459  * Revision 1.2  1994/05/14  17:18:17  matt
6460  * Got rid of externs in source (non-header) files
6461  * 
6462  * Revision 1.1  1994/05/14  16:30:39  matt
6463  * Initial revision
6464
6465 ------------------------------------------------------------------------
6466 main/editor/kbuild.c:
6467
6468  * Revision 2.0  1995/02/27  11:35:43  john
6469  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6470  * for bitmaps.tbl.
6471  * 
6472  * Revision 1.20  1995/02/22  11:00:47  yuan
6473  * prototype include.
6474  * 
6475  * Revision 1.19  1995/02/22  10:59:01  yuan
6476  * Save sloppy mine before punching.
6477  * 
6478  * Revision 1.18  1994/08/25  21:57:56  mike
6479  * IS_CHILD stuff.
6480  * 
6481  * Revision 1.17  1994/05/16  12:00:52  mike
6482  * Call med_combine_duplicate_vertices before various build functions.
6483  * 
6484  * Revision 1.16  1994/05/09  23:34:31  mike
6485  * Punch all sloppy sides in a group.
6486  * 
6487  * Revision 1.15  1994/02/16  15:23:06  yuan
6488  * Checking in for editor make.
6489  * 
6490  * Revision 1.14  1994/01/21  12:01:31  yuan
6491  * Added clearer editor_status messages (sloppy joint vs. joint)
6492  * 
6493  * Revision 1.13  1994/01/14  11:59:52  yuan
6494  * New function in build menu. 
6495  * "Punch" through walls to force a joint formation with
6496  * closest segment:side, if the closest segment:side allows
6497  * a connection.
6498  * 
6499  * Revision 1.12  1994/01/07  17:45:05  yuan
6500  * Just changed some tabs and formatting I believe.
6501  * 
6502  * Revision 1.11  1993/12/06  19:33:36  yuan
6503  * Fixed autosave stuff so that undo restores Cursegp and
6504  * Markedsegp
6505  * 
6506  * Revision 1.10  1993/12/02  12:39:15  matt
6507  * Removed extra includes
6508  * 
6509  * Revision 1.9  1993/11/12  14:31:31  yuan
6510  * Added warn_if_concave_segments.
6511  * 
6512  * Revision 1.8  1993/11/11  17:12:45  yuan
6513  * Fixed display of messages, so that concave segment
6514  * warning doesn't wipe them out immediately.
6515  * 
6516  * Revision 1.7  1993/11/09  12:09:28  mike
6517  * Remove extern for mine_filename, put it in editor.h
6518  * 
6519  * Revision 1.6  1993/11/08  19:14:06  yuan
6520  * Added Undo command (not working yet)
6521  * 
6522  * Revision 1.5  1993/11/05  17:32:36  john
6523  * added funcs
6524  * .,
6525  * 
6526  * Revision 1.4  1993/11/01  16:53:51  mike
6527  * Add CreateAdjacentJointsSegment and CreateAdjacentJointsAll
6528  * 
6529  * Revision 1.3  1993/11/01  11:24:59  mike
6530  * Add CreateJointAdjacent
6531  * 
6532  * Revision 1.2  1993/10/29  19:13:11  yuan
6533  * Added diagnostic messages
6534  * 
6535  * Revision 1.1  1993/10/13  18:53:27  john
6536  * Initial revision
6537
6538 ------------------------------------------------------------------------
6539 main/editor/kcurve.c:
6540
6541  * Revision 2.0  1995/02/27  11:35:29  john
6542  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6543  * for bitmaps.tbl.
6544  * 
6545  * Revision 1.17  1994/08/25  21:56:43  mike
6546  * IS_CHILD stuff.
6547  * 
6548  * Revision 1.16  1994/05/14  17:17:54  matt
6549  * Got rid of externs in source (non-header) files
6550  * 
6551  * Revision 1.15  1994/01/28  10:52:24  mike
6552  * Bind set_average_light_on_curside to DeleteCurve
6553  * 
6554  * Revision 1.14  1994/01/25  17:34:47  mike
6555  * Stupidly bound fix_bogus_uvs_all to delete curve.
6556  * 
6557  * Revision 1.13  1993/12/06  19:34:15  yuan
6558  * Fixed autosave so that undo restores Cursegp
6559  * and Markedsegp
6560  * 
6561  * Revision 1.12  1993/12/02  12:39:28  matt
6562  * Removed extra includes
6563  * 
6564  * Revision 1.11  1993/11/12  13:08:38  yuan
6565  * Fixed warning for concave segment so it appears after any
6566  * "less important" diagnostic messages.
6567  * 
6568  * Revision 1.10  1993/11/11  17:03:25  yuan
6569  * Fixed undo-status display
6570  * 
6571  * Revision 1.9  1993/11/11  15:55:11  yuan
6572  * Added undo messages.
6573  * 
6574  * Revision 1.8  1993/11/08  19:13:30  yuan
6575  * Added Undo command (not working yet)
6576  * 
6577  * Revision 1.7  1993/11/05  17:32:51  john
6578  * added funcs
6579  * .,
6580  * 
6581  * Revision 1.6  1993/10/29  19:12:41  yuan
6582  * Added diagnostic messages
6583  * 
6584  * Revision 1.5  1993/10/29  16:26:30  yuan
6585  * Added diagnostic messages for curve generation
6586  * 
6587  * Revision 1.4  1993/10/22  19:47:30  yuan
6588  * Can't build curve if Marked Seg has a segment attached.
6589  * 
6590  * Revision 1.3  1993/10/19  20:54:50  matt
6591  * Changed/cleaned up window updates
6592  * 
6593  * Revision 1.2  1993/10/14  13:52:17  mike
6594  * Add return value to AssignTexture
6595  * 
6596  * Revision 1.1  1993/10/13  18:53:11  john
6597  * Initial revision
6598
6599 ------------------------------------------------------------------------
6600 main/editor/kfuncs.c:
6601
6602  * Revision 2.1  1995/03/08  16:07:23  yuan
6603  * Added segment sizing default functions.
6604  * 
6605  * Revision 2.0  1995/02/27  11:34:45  john
6606  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6607  * for bitmaps.tbl.
6608  * 
6609  * Revision 1.112  1995/01/12  12:10:31  yuan
6610  * Added coop object capability.
6611  * 
6612  * Revision 1.111  1994/11/27  23:17:16  matt
6613  * Made changes for new mprintf calling convention
6614  * 
6615  * Revision 1.110  1994/11/23  12:17:22  mike
6616  * bind retmap functions.
6617  * 
6618  * Revision 1.109  1994/11/19  15:20:54  mike
6619  * rip out unused code and data.
6620  * 
6621  * Revision 1.108  1994/11/17  11:39:02  matt
6622  * Ripped out code to load old mines
6623  * 
6624  * Revision 1.107  1994/10/27  10:06:12  mike
6625  * kill macro stuff.
6626  * 
6627  * Revision 1.106  1994/10/18  15:31:43  mike
6628  * Bind mine correction function to test keypad, key=1.
6629  * 
6630  * Revision 1.105  1994/09/26  23:22:06  matt
6631  * Added functions to keep player's starting position from getting messed up
6632  * 
6633  * Revision 1.104  1994/09/24  14:15:41  mike
6634  * Custom colored object support.
6635  * 
6636  * Revision 1.103  1994/09/23  18:03:54  yuan
6637  * Finished wall checking code.
6638  * 
6639  * Revision 1.102  1994/09/22  19:03:52  mike
6640  * Test function test_shortpos on ctrl-keypad3
6641  * 
6642  * Revision 1.101  1994/09/20  14:35:56  mike
6643  * Bind functions to keypad 2, 3.
6644  * 
6645  * Revision 1.100  1994/09/15  22:58:10  matt
6646  * Made new objects be oriented to their segment
6647  * Added keypad function to flip an object upside-down
6648  * 
6649  * Revision 1.99  1994/09/14  16:50:50  yuan
6650  * Added load mine only function
6651  * 
6652  * Revision 1.98  1994/08/25  21:57:52  mike
6653  * IS_CHILD stuff.
6654  * 
6655  * Revision 1.97  1994/08/16  18:10:52  yuan
6656  * Maded C place you in the center of a segment.
6657  * 
6658  * Revision 1.96  1994/08/15  17:48:01  yuan
6659  * Added external walls.
6660  * 
6661  * Revision 1.95  1994/08/13  17:32:38  mike
6662  * test function.
6663  * 
6664  * Revision 1.94  1994/08/05  21:17:57  matt
6665  * Allow two doors to be linked together
6666  * 
6667  * Revision 1.93  1994/08/05  18:18:52  matt
6668  * Made object rotation have 4x resolution, and SHIFT+rotate do old resolution.
6669  * 
6670  * Revision 1.92  1994/08/03  10:31:06  mike
6671  * Add texture map propagation without uv assignment.
6672  * 
6673  * Revision 1.91  1994/08/02  14:17:00  mike
6674  * Clean up dialog boxes, add one for Matt.
6675  * 
6676  * Revision 1.90  1994/07/30  17:04:47  mike
6677  * Bind key for max_depth on path testing.
6678
6679 ------------------------------------------------------------------------
6680 main/editor/kfuncs.h:
6681
6682  * Revision 2.0  1995/02/27  11:34:33  john
6683  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6684  * for bitmaps.tbl.
6685  * 
6686  * Revision 1.2  1994/05/14  17:18:18  matt
6687  * Got rid of externs in source (non-header) files
6688  * 
6689  * Revision 1.1  1994/05/14  16:37:14  matt
6690  * Initial revision
6691
6692 ------------------------------------------------------------------------
6693 main/editor/kgame.c:
6694
6695  * Revision 2.0  1995/02/27  11:34:55  john
6696  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6697  * for bitmaps.tbl.
6698  * 
6699  * Revision 1.25  1995/02/23  10:18:05  allender
6700  * fixed parameter mismatch with compute_segment_center
6701  * 
6702  * Revision 1.24  1994/11/17  11:38:59  matt
6703  * Ripped out code to load old mines
6704  * 
6705  * Revision 1.23  1994/11/09  11:58:56  matt
6706  * Fixed small bug
6707  * 
6708  * Revision 1.22  1994/10/20  12:48:02  matt
6709  * Replaced old save files (MIN/SAV/HOT) with new LVL files
6710  * 
6711  * Revision 1.21  1994/10/15  19:08:47  mike
6712  * Fix bug if player object out of mine at save.
6713  * 
6714  * Revision 1.20  1994/10/13  13:15:43  matt
6715  * Properly relink player object when bashed for "permanant" position save
6716  * 
6717  * Revision 1.19  1994/10/11  17:07:23  matt
6718  * Fixed problem that sometimes caused bad player segnum after compress
6719  * 
6720  * Revision 1.18  1994/10/08  17:10:40  matt
6721  * Correctly set current_level_num when loading/creating mine in editor
6722  * 
6723  * Revision 1.17  1994/09/26  23:46:13  matt
6724  * Improved player position save code
6725  * 
6726  * Revision 1.16  1994/09/26  23:22:50  matt
6727  * Added functions to keep player's starting position from getting messed up
6728  * 
6729  * Revision 1.15  1994/09/14  16:50:51  yuan
6730  * Added load mine only function
6731  * 
6732  * Revision 1.14  1994/07/22  12:36:50  matt
6733  * Cleaned up editor/game interactions some more.
6734  * 
6735  * Revision 1.13  1994/07/21  17:26:26  matt
6736  * When new mine created, the default save filename is now reset
6737  * 
6738  * Revision 1.12  1994/06/03  12:27:05  yuan
6739  * Fixed restore game state.
6740  * 
6741  * 
6742  * Revision 1.11  1994/05/30  11:36:09  yuan
6743  * Do gamesave if new mine is loaded and game is entered...
6744  * 
6745  * Revision 1.10  1994/05/14  18:00:33  matt
6746  * Got rid of externs in source (non-header) files
6747  * 
6748  * Revision 1.9  1994/05/10  12:15:44  yuan
6749  * Fixed load_game functions to match prototype.
6750  * 
6751  * Revision 1.8  1994/05/06  12:52:15  yuan
6752  * Adding some gamesave checks...
6753  * 
6754  * Revision 1.7  1994/05/04  17:32:05  yuan
6755  * med_load_game changed to load_game
6756  * med_save_game changed to save_game
6757
6758 ------------------------------------------------------------------------
6759 main/editor/khelp.c:
6760
6761  * Revision 2.0  1995/02/27  11:34:27  john
6762  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6763  * for bitmaps.tbl.
6764  * 
6765  * Revision 1.5  1993/12/02  12:39:30  matt
6766  * Removed extra includes
6767  * 
6768  * Revision 1.4  1993/11/05  17:32:57  john
6769  * added funcs
6770  * .,
6771  * 
6772  * Revision 1.3  1993/11/03  13:42:41  yuan
6773  * Updated help commands
6774  * 
6775  * Revision 1.2  1993/10/22  19:48:07  yuan
6776  * added ctrl-shift-keypad comment in help.
6777  * 
6778  * Revision 1.1  1993/10/13  18:53:16  john
6779  * Initial revision
6780
6781 ------------------------------------------------------------------------
6782 main/editor/kmine.c:
6783
6784  * Revision 2.0  1995/02/27  11:34:22  john
6785  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6786  * for bitmaps.tbl.
6787  * 
6788  * Revision 1.53  1995/02/22  15:04:52  allender
6789  * remove anonymous unions from vecmat stuff
6790  * 
6791  * Revision 1.52  1994/11/27  23:17:13  matt
6792  * Made changes for new mprintf calling convention
6793  * 
6794  * Revision 1.51  1994/11/17  14:48:05  mike
6795  * validation functions moved from editor to game.
6796  * 
6797  * Revision 1.50  1994/11/17  11:38:49  matt
6798  * Ripped out code to load old mines
6799  * 
6800  * Revision 1.49  1994/10/08  17:10:22  matt
6801  * Correctly set current_level_num when loading/creating mine in editor
6802  * 
6803  * Revision 1.48  1994/10/03  11:30:45  matt
6804  * Fixed problem with permanant player position when creating a new mine
6805  * 
6806  * Revision 1.47  1994/09/29  17:42:19  matt
6807  * Cleaned up game_mode a little
6808  * 
6809  * Revision 1.46  1994/08/18  10:48:21  john
6810  * Cleaned up game sequencing.
6811  * 
6812  * Revision 1.45  1994/08/09  16:05:36  john
6813  * Added the ability to place players.  Made old
6814  * Player variable be ConsoleObject.
6815  * 
6816  * Revision 1.44  1994/07/22  12:37:06  matt
6817  * Cleaned up editor/game interactions some more.
6818  * 
6819  * Revision 1.43  1994/07/21  17:26:50  matt
6820  * When new mine created, the default save filename is now reset
6821  * 
6822  * Revision 1.42  1994/06/08  14:29:25  matt
6823  * Took out support for old mine versions
6824  * 
6825  * Revision 1.41  1994/06/03  12:28:04  yuan
6826  * Fixed game restore state.
6827  * 
6828  * Revision 1.40  1994/05/19  12:10:29  matt
6829  * Use new vecmat macros and globals
6830  * 
6831  * Revision 1.39  1994/05/14  17:17:56  matt
6832  * Got rid of externs in source (non-header) files
6833  * 
6834  * Revision 1.38  1994/05/12  14:47:47  mike
6835  * New previous mine structure and object structure.
6836  * 
6837  * Revision 1.37  1994/05/06  12:52:12  yuan
6838  * Adding some gamesave checks...
6839  * 
6840  * Revision 1.36  1994/05/05  20:37:02  yuan
6841  * Added gamesave checks when entering and leaving the game.
6842  * 
6843  * Removed Load Game Save Game functions...
6844  * Now there is only Load/Save Mine... (equivalent to old Load/Save Game)
6845  * 
6846  * Revision 1.35  1994/04/27  22:57:54  matt
6847  * Made sit mine load from path of sit file
6848  * 
6849  * Revision 1.34  1994/04/21  18:29:55  matt
6850  * Don't use same variable for mine filename & sit filename
6851  * 
6852  * Revision 1.33  1994/04/21  18:21:43  matt
6853  * Strip path from mine filename in sit file
6854  * 
6855  * Revision 1.32  1994/04/18  10:54:35  mike
6856  * Add situation save/load
6857  * 
6858  * Revision 1.31  1994/02/16  16:47:54  yuan
6859  * Removed temp.min.
6860  * 
6861  * Revision 1.30  1994/02/16  15:22:51  yuan
6862  * Checking in for editor make.
6863  * 
6864  * Revision 1.29  1994/02/09  15:04:23  yuan
6865  * brought back save ability
6866  * 
6867  * Revision 1.28  1994/02/08  12:42:45  yuan
6868  * fixed log.
6869  * 
6870  * Revision 1.27  1994/02/08  12:41:47  yuan
6871  *      Crippled save mine function from demo version.
6872  * 
6873  * Revision 1.26  1994/01/13  13:26:05  yuan
6874  * Added med_compress_mine when creating new mine or
6875  * when loading mine
6876  * 
6877  * Revision 1.25  1994/01/11  12:03:23  yuan
6878  * Fixed so that when old mine implementation not in,
6879  * message is displayed when you try to load an old mine
6880  * 
6881  * Revision 1.24  1994/01/11  11:47:57  yuan
6882  * *** empty log message ***
6883  * 
6884  * Revision 1.23  1994/01/05  09:59:56  yuan
6885  * Added load old mine funciton
6886  * 
6887  * Revision 1.22  1993/12/16  15:58:08  john
6888  * moved texture selection page to texpage.c
6889  * ,
6890  * 
6891  * Revision 1.21  1993/12/10  14:48:55  mike
6892  * Kill orthogonal views.
6893  * 
6894  * Revision 1.20  1993/12/03  16:44:06  yuan
6895  * Changed some 0.0 return values to 0
6896  * 
6897  * 
6898  * Revision 1.19  1993/12/02  12:39:34  matt
6899  * Removed extra includes
6900  * 
6901  * Revision 1.18  1993/11/17  13:14:48  yuan
6902  * Moved Save Group to group.c
6903  * 
6904  * Revision 1.17  1993/11/16  17:25:48  yuan
6905  * Unworking group function added... 
6906  * 
6907  * Revision 1.16  1993/11/15  14:46:25  john
6908  * Changed Menu to MenuX
6909  * 
6910  * Revision 1.15  1993/11/08  19:13:45  yuan
6911  * Added Undo command (not working yet)
6912
6913 ------------------------------------------------------------------------
6914 main/editor/ksegmove.c:
6915
6916  * Revision 2.0  1995/02/27  11:33:37  john
6917  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6918  * for bitmaps.tbl.
6919  * 
6920  * Revision 1.5  1993/12/02  12:39:36  matt
6921  * Removed extra includes
6922  * 
6923  * Revision 1.4  1993/11/12  16:40:23  mike
6924  * Use rotate_segment_new in place of med_rotate_segment_ang.
6925  * 
6926  * Revision 1.3  1993/11/05  17:32:54  john
6927  * added funcs
6928  * .,
6929  * 
6930  * Revision 1.2  1993/10/26  11:28:41  mike
6931  * Write common routine SegOrientCommon so all movement can pass
6932  * through the same routine to check for concavity, among other things.
6933  * 
6934  * Revision 1.1  1993/10/13  18:53:21  john
6935  * Initial revision
6936
6937 ------------------------------------------------------------------------
6938 main/editor/ksegsel.c:
6939
6940  * Revision 2.0  1995/02/27  11:35:33  john
6941  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6942  * for bitmaps.tbl.
6943  * 
6944  * Revision 1.12  1994/08/25  21:57:02  mike
6945  * IS_CHILD stuff.
6946  * 
6947  * Revision 1.11  1994/05/23  14:48:35  mike
6948  * make current segment be add segment.
6949  * 
6950  * Revision 1.10  1993/12/06  19:33:43  yuan
6951  * Fixed autosave stuff so that undo restores Cursegp and
6952  * Markedsegp
6953  * 
6954  * Revision 1.9  1993/12/02  12:39:37  matt
6955  * Removed extra includes
6956  * 
6957  * Revision 1.8  1993/11/12  13:08:17  yuan
6958  * Fixed warning for concave segment so it appears after any
6959  * "less important" diagnostic messages.
6960  * 
6961  * Revision 1.7  1993/11/05  17:32:49  john
6962  * added funcs
6963  * .,
6964  * 
6965  * Revision 1.6  1993/11/01  09:53:18  mike
6966  * Write functions get_next_segment and get_previous_segment.
6967  * 
6968  * Revision 1.5  1993/10/31  18:06:56  mike
6969  * Only set_view_target_from_segment if in that mode.
6970  * 
6971  * Revision 1.4  1993/10/28  15:01:09  matt
6972  * Mucked with update flags
6973  * 
6974  * Revision 1.3  1993/10/14  18:07:47  mike
6975  * Change use of CONNECTIVITY to MAX_SIDES_PER_SEGMENT
6976  * 
6977  * Revision 1.2  1993/10/14  11:47:34  john
6978  * *** empty log message ***
6979  * 
6980  * Revision 1.1  1993/10/13  18:53:39  john
6981  * Initial revision
6982
6983 ------------------------------------------------------------------------
6984 main/editor/ksegsize.c:
6985
6986  * Revision 2.1  1995/03/08  16:07:21  yuan
6987  * Added segment sizing default functions.
6988  * 
6989  * Revision 2.0  1995/02/27  11:35:46  john
6990  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
6991  * for bitmaps.tbl.
6992  * 
6993  * Revision 1.15  1994/11/17  14:47:42  mike
6994  * validation functions moved from editor to game.
6995  * 
6996  * Revision 1.14  1994/08/25  21:57:45  mike
6997  * IS_CHILD stuff.
6998  * 
6999  * Revision 1.13  1994/07/18  10:44:43  mike
7000  * Fix uv propagation after segment sizing.
7001  * 
7002  * Revision 1.12  1994/05/04  19:16:34  mike
7003  * *** empty log message ***
7004  * 
7005  * Revision 1.11  1994/05/03  18:31:00  mike
7006  * Add PerturbCurside.
7007  * 
7008  * Revision 1.10  1994/05/03  11:05:14  mike
7009  * Overhaul segment sizing system to allow sizing of non-free vertices,
7010  * and also sizing of vertices on a side, edge or a single vertex.
7011  * 
7012  * Revision 1.9  1993/12/12  17:16:00  mike
7013  * Kill some mprintf code.
7014  * 
7015  * 
7016  * Revision 1.8  1993/12/10  11:10:53  mike
7017  * Fix bugs in tmap propagation in segment sizing.
7018  * 
7019  * Revision 1.7  1993/12/06  13:25:30  mike
7020  * Fix bug in setting size of New_segment after segment scale.
7021  * 
7022  * Revision 1.6  1993/11/17  18:57:52  mike
7023  * Change scaling to be additive.
7024  * 
7025  * Revision 1.5  1993/11/12  16:52:57  mike
7026  * *** empty log message ***
7027  * 
7028  * Revision 1.4  1993/11/05  17:32:47  john
7029  * added funcs
7030  * .,
7031  * 
7032  * Revision 1.3  1993/10/19  11:22:11  matt
7033  * Removed extra includes
7034  * 
7035  * Revision 1.2  1993/10/17  14:17:52  mike
7036  * Add big scale changes for segment.
7037  * 
7038  * Revision 1.1  1993/10/13  18:53:01  john
7039  * Initial revision
7040
7041 ------------------------------------------------------------------------
7042 main/editor/ktmap.c:
7043
7044  * Revision 2.0  1995/02/27  11:35:37  john
7045  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7046  * for bitmaps.tbl.
7047  * 
7048  * Revision 1.26  1994/08/25  21:57:12  mike
7049  * IS_CHILD stuff.
7050  * 
7051  * Revision 1.25  1994/08/03  10:32:41  mike
7052  * Texture map stretching.
7053  * 
7054  * Revision 1.24  1994/05/14  17:17:35  matt
7055  * Got rid of externs in source (non-header) files
7056  * 
7057  * Revision 1.23  1994/04/28  10:48:38  yuan
7058  * Fixed undo message for Clear Texture.
7059  * 
7060  * Revision 1.22  1994/04/22  17:45:42  john
7061  * MAde top 2 bits of paste-ons pick the 
7062  * orientation of the bitmap.
7063  * 
7064  * Revision 1.21  1994/04/01  14:36:08  yuan
7065  * Fixed propogate function so you can propogate and move.
7066  * 
7067  * Revision 1.20  1994/03/19  17:22:08  yuan
7068  * Wall system implemented until specific features need to be added...
7069  * (Needs to be hammered on though.)
7070  * 
7071  * Revision 1.19  1994/02/14  12:06:12  mike
7072  * change segment data structure.
7073  * 
7074  * Revision 1.18  1994/01/25  17:58:47  yuan
7075  * Added ambient lighting, and also added fixing bogus segments
7076  * functions to the editor... (they don't work fully... need to
7077  * check out seguvs.c
7078  * 
7079  * Revision 1.17  1994/01/24  11:54:52  yuan
7080  * Checking everything in
7081  * 
7082  * Revision 1.16  1994/01/18  16:05:57  yuan
7083  * Added clear texture 2 function (shift 0)
7084  * 
7085  * Revision 1.15  1994/01/18  10:15:01  yuan
7086  * added texture stuff
7087  * 
7088  * Revision 1.14  1993/12/06  19:33:57  yuan
7089  * Fixed autosave stuff so that undo restores Cursegp and
7090  * Markedsegp
7091  * 
7092  * Revision 1.13  1993/12/02  12:39:39  matt
7093  * Removed extra includes
7094  * 
7095  * Revision 1.12  1993/11/28  17:31:34  mike
7096  * Use new segment data structure.
7097  * 
7098  * Revision 1.11  1993/11/12  16:38:37  mike
7099  * Change call to med_propagate_tmaps_to_segments to include new uv_only_flag parameter.
7100  * 
7101  * Revision 1.10  1993/11/11  15:53:30  yuan
7102  * Fixed undo display message
7103  * 
7104  * Revision 1.9  1993/11/08  19:13:46  yuan
7105  * Added Undo command (not working yet)
7106  * 
7107  * Revision 1.8  1993/11/05  17:32:48  john
7108  * added funcs
7109  * .,
7110  * 
7111  * Revision 1.7  1993/11/02  10:31:08  mike
7112  * Add PropagateTexturesSelected.
7113  * 
7114  * Revision 1.6  1993/10/29  11:43:15  mike
7115  * Write PropagateTextures
7116  * 
7117  * Revision 1.5  1993/10/25  13:26:39  mike
7118  * Force redraw whenever a texture map is assigned.
7119  * 
7120  * Revision 1.4  1993/10/15  17:42:53  mike
7121  * Make AssignTexture also assign texture maps to New_segment.
7122  * 
7123  * Revision 1.3  1993/10/15  13:10:24  mike
7124  * Adapt AssignTexture to new segment structure.
7125  * 
7126  * Revision 1.2  1993/10/14  18:09:17  mike
7127  * Debug code for AssignTexture and comment out code.
7128  * 
7129  * Revision 1.1  1993/10/14  14:01:49  mike
7130  * Initial revision
7131
7132 ------------------------------------------------------------------------
7133 main/editor/kview.c:
7134
7135  * Revision 2.0  1995/02/27  11:34:21  john
7136  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7137  * for bitmaps.tbl.
7138  * 
7139  * Revision 1.11  1993/12/02  12:39:41  matt
7140  * Removed extra includes
7141  * 
7142  * Revision 1.10  1993/11/16  13:47:54  john
7143  * Xchanged move away/closer
7144  * 
7145  * Revision 1.9  1993/11/16  13:45:32  john
7146  * Exchanged zoom in/out.
7147  * 
7148  * Revision 1.8  1993/11/05  17:32:56  john
7149  * added funcs
7150  * .,
7151  * 
7152  * Revision 1.7  1993/11/03  12:10:21  yuan
7153  * No keypress associated with chase mode
7154  * 
7155  * Revision 1.6  1993/11/02  17:06:55  yuan
7156  * Icon stuff added.
7157  * 
7158  * Revision 1.5  1993/11/01  12:48:59  yuan
7159  * Added Chase mode icon to status bar.
7160  * 
7161  * Revision 1.4  1993/10/29  19:12:55  yuan
7162  * Added diagnostic messages
7163  * 
7164  * Revision 1.3  1993/10/27  18:26:16  matt
7165  * Made zoom & related keys not do anything if no current view
7166  * 
7167  * Revision 1.2  1993/10/19  20:54:33  matt
7168  * Changed/cleaned up window updates
7169  * 
7170  * Revision 1.1  1993/10/13  18:53:34  john
7171  * Initial revision
7172
7173 ------------------------------------------------------------------------
7174 main/editor/macro.c:
7175
7176  * Revision 2.0  1995/02/27  11:35:09  john
7177  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7178  * for bitmaps.tbl.
7179  * 
7180  * Revision 1.12  1993/11/15  14:46:37  john
7181  * Changed Menu to MenuX
7182  * 
7183  * Revision 1.11  1993/11/05  17:32:44  john
7184  * added funcs
7185  * .,
7186  * 
7187  * Revision 1.10  1993/10/28  16:23:20  john
7188  * *** empty log message ***
7189  * 
7190  * Revision 1.9  1993/10/28  13:03:12  john
7191  * ..
7192  * 
7193  * Revision 1.8  1993/10/25  16:02:35  john
7194  * *** empty log message ***
7195  * 
7196  * Revision 1.7  1993/10/22  13:35:29  john
7197  * *** empty log message ***
7198  * 
7199  * Revision 1.6  1993/10/21  17:10:09  john
7200  * Fixed bug w/ load macro.
7201  * 
7202  * Revision 1.5  1993/10/19  12:58:47  john
7203  * *** empty log message ***
7204  * 
7205  * Revision 1.4  1993/10/19  12:55:02  john
7206  * *** empty log message ***
7207  * 
7208  * Revision 1.3  1993/10/19  12:49:49  john
7209  * made EventBuffer dynamic, use ReadFile, WriteFile
7210  * 
7211  * Revision 1.2  1993/10/15  17:42:20  john
7212  * *** empty log message ***
7213  * 
7214  * Revision 1.1  1993/10/15  17:28:06  john
7215  * Initial revision
7216
7217 ------------------------------------------------------------------------
7218 main/editor/macro.h:
7219
7220  * Revision 2.0  1995/02/27  11:34:32  john
7221  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7222  * for bitmaps.tbl.
7223  * 
7224  * Revision 1.2  1994/05/14  17:18:19  matt
7225  * Got rid of externs in source (non-header) files
7226  * 
7227  * Revision 1.1  1994/05/14  16:38:50  matt
7228  * Initial revision
7229
7230 ------------------------------------------------------------------------
7231 main/editor/med.c:
7232
7233  * Revision 2.3  1995/03/06  18:23:52  john
7234  * Fixed bug with font screwing up.
7235  * 
7236  * Revision 2.2  1995/03/06  16:34:55  john
7237  * Fixed bug with previous.
7238  * 
7239  * Revision 2.1  1995/03/06  15:20:57  john
7240  * New screen mode method.
7241  * 
7242  * Revision 2.0  1995/02/27  11:35:54  john
7243  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7244  * for bitmaps.tbl.
7245  * 
7246  * Revision 1.192  1994/11/30  12:33:55  mike
7247  * set window clearing mode for editor.
7248  * 
7249  * Revision 1.191  1994/11/27  23:17:02  matt
7250  * Made changes for new mprintf calling convention
7251  * 
7252  * Revision 1.190  1994/11/19  00:04:33  john
7253  * Changed some shorts to ints.
7254  * 
7255  * Revision 1.189  1994/11/17  14:47:57  mike
7256  * validation functions moved from editor to game.
7257  * 
7258  * Revision 1.188  1994/11/14  11:41:38  john
7259  * Fixed bug with editor/game sequencing.
7260  * 
7261  * Revision 1.187  1994/11/13  15:36:44  john
7262  * Changed game sequencing with editor.
7263  * 
7264  * Revision 1.186  1994/11/10  16:49:12  matt
7265  * Don't sort seg list if no segs in list
7266  * 
7267  * Revision 1.185  1994/11/08  09:28:39  mike
7268  * reset ai paths on going to game.
7269  * 
7270  * Revision 1.184  1994/10/30  14:13:05  mike
7271  * rip out repair center stuff.
7272  * 
7273  * Revision 1.183  1994/10/27  10:07:06  mike
7274  * adapt to no inverse table.
7275  * 
7276  * Revision 1.182  1994/10/20  12:48:03  matt
7277  * Replaced old save files (MIN/SAV/HOT) with new LVL files
7278  * 
7279  * Revision 1.181  1994/10/13  11:39:22  john
7280  * Took out network stuff/.
7281  * 
7282  * Revision 1.180  1994/10/07  22:21:38  mike
7283  * Stop Delete-{whatever} from hanging you!
7284  * 
7285  * Revision 1.179  1994/10/03  23:39:37  mike
7286  * Adapt to newer, better, fuelcen_activate function.
7287  * 
7288  * Revision 1.178  1994/09/30  00:38:05  mike
7289  * Shorten diagnostic message erase -- was erasing outside canvas.
7290  * 
7291  * Revision 1.177  1994/09/28  17:31:37  mike
7292  * Add call to check_wall_validity();
7293  * 
7294  * Revision 1.176  1994/08/19  10:57:42  mike
7295  * Fix status message erase bug.
7296  * 
7297  * Revision 1.175  1994/08/18  10:48:12  john
7298  * Cleaned up game sequencing.
7299  * 
7300  * Revision 1.174  1994/08/16  18:11:04  yuan
7301  * Maded C place you in the center of a segment.
7302  * 
7303  * Revision 1.173  1994/08/10  19:55:05  john
7304  * Changed font stuff.
7305  * 
7306  * Revision 1.172  1994/08/09  16:06:06  john
7307  * Added the ability to place players.  Made old
7308  * Player variable be ConsoleObject.
7309  * 
7310  * Revision 1.171  1994/08/04  09:14:11  matt
7311  * Fixed problem I said I fixed last time
7312  * 
7313  * Revision 1.170  1994/08/04  00:27:57  matt
7314  * When viewing a wall, update the objects segnum if moved out of the segment
7315  * 
7316  * Revision 1.169  1994/08/02  14:18:12  mike
7317  * Clean up dialog boxes.
7318  * 
7319  * Revision 1.168  1994/07/29  15:34:35  mike
7320  * Kill some mprintfs.
7321  * 
7322  * Revision 1.167  1994/07/29  14:56:46  yuan
7323  * Close centers window, when you go into game.
7324  * 
7325  * Revision 1.166  1994/07/28  17:16:20  john
7326  * MAde editor use Network stuff.
7327  * 
7328  * Revision 1.165  1994/07/28  16:59:10  mike
7329  * objects containing objects.
7330  * 
7331  * Revision 1.164  1994/07/22  12:37:07  matt
7332  * Cleaned up editor/game interactions some more.
7333  * 
7334  * Revision 1.163  1994/07/21  19:35:11  yuan
7335  * Fixed #include problem
7336  * 
7337  * Revision 1.162  1994/07/21  18:02:09  matt
7338  * Don't re-init player stats when going from editor -> game
7339  * 
7340  * Revision 1.161  1994/07/21  12:47:53  mike
7341  * Add tilde key functionality for object movement.
7342  * 
7343  * Revision 1.160  1994/07/18  10:44:55  mike
7344  * One-click access to keypads.
7345  * 
7346  * Revision 1.159  1994/07/01  18:05:54  john
7347  * *** empty log message ***
7348  * 
7349  * Revision 1.158  1994/07/01  17:57:06  john
7350  * First version of not-working hostage system
7351  * 
7352  * 
7353  * Revision 1.157  1994/07/01  11:32:29  john
7354  * *** empty log message ***
7355  * 
7356  * Revision 1.156  1994/06/24  17:04:36  john
7357  * *** empty log message ***
7358  * 
7359  * Revision 1.155  1994/06/23  15:53:47  matt
7360  * Finished hacking in 3d rendering in big window
7361  * 
7362  * Revision 1.154  1994/06/21  16:17:54  yuan
7363  * Init stats when you go to game from editor
7364  * 
7365  * Revision 1.153  1994/06/21  12:57:14  yuan
7366  * Remove center from segment function added to menu.
7367
7368 ------------------------------------------------------------------------
7369 main/editor/meddraw.c:
7370
7371  * Revision 2.0  1995/02/27  11:34:42  john
7372  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7373  * for bitmaps.tbl.
7374  * 
7375  * Revision 1.34  1994/11/09  11:46:30  matt
7376  * Don't draw non-existant special segments
7377  * 
7378  * Revision 1.33  1994/10/27  10:06:38  mike
7379  * adapt to no inverse table.
7380  * 
7381  * Revision 1.32  1994/10/17  18:06:23  john
7382  * Made net player objects draw in dark green.
7383  * 
7384  * Revision 1.31  1994/09/26  16:44:33  yuan
7385  * Colored special segments.
7386  * 
7387  * Revision 1.30  1994/09/01  17:02:41  matt
7388  * Redraw pointer after world draw
7389  * 
7390  * Revision 1.29  1994/08/25  21:56:21  mike
7391  * IS_CHILD stuff.
7392  * 
7393  * Revision 1.28  1994/08/11  18:59:46  mike
7394  * Adapt to new int (vs short) version of gameseg functions.
7395  * 
7396  * Revision 1.27  1994/08/09  16:06:03  john
7397  * Added the ability to place players.  Made old
7398  * Player variable be ConsoleObject.
7399  * 
7400  * Revision 1.26  1994/07/25  00:03:05  matt
7401  * Various changes to accomodate new 3d, which no longer takes point numbers
7402  * as parms, and now only takes pointers to points.
7403  * 
7404  * Revision 1.25  1994/07/09  17:38:13  mike
7405  * comment out mprintf(0, "\n");
7406  * 
7407  * Revision 1.24  1994/07/07  19:34:47  matt
7408  * These changes are mostly Mike's, but I fixed a little bug that caused
7409  * some edges to think they were never used.
7410  * 
7411  * Revision 1.23  1994/07/06  16:36:18  mike
7412  * Optionally only draw segment lines which are in only one segment.
7413  * 
7414  * Revision 1.22  1994/05/27  10:34:28  yuan
7415  * Added new Dialog boxes for Walls and Triggers.
7416  * 
7417  * Revision 1.21  1994/05/14  18:00:56  matt
7418  * Got rid of externs in source (non-header) files
7419  * 
7420  * Revision 1.20  1994/05/09  23:35:21  mike
7421  * Change order of drawing found and selected segments.
7422  * 
7423  * Revision 1.19  1994/05/05  12:55:38  yuan
7424  * Fixed a bunch of group bugs.
7425  * 
7426  * Revision 1.18  1994/05/04  13:07:52  matt
7427  * Made current edge draw in green in wire-frame window
7428  * Also, moved a bunch of color constants here from editor.h
7429
7430 ------------------------------------------------------------------------
7431 main/editor/meddraw.h:
7432
7433  * Revision 2.0  1995/02/27  11:35:12  john
7434  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7435  * for bitmaps.tbl.
7436  * 
7437  * Revision 1.3  1994/07/06  16:36:54  mike
7438  * Prototype for draw_mine_all.
7439  * 
7440  * Revision 1.2  1993/12/17  12:05:09  john
7441  * Took stuff out of med.c; moved into medsel.c, meddraw.c, medmisc.c
7442  * 
7443  * Revision 1.1  1993/12/17  08:55:14  john
7444  * Initial revision
7445
7446 ------------------------------------------------------------------------
7447 main/editor/medmisc.c:
7448
7449  * Revision 2.1  1995/03/06  15:20:50  john
7450  * New screen mode method.
7451  * 
7452  * Revision 2.0  1995/02/27  11:36:40  john
7453  * Version 2.0. Ansi-fied.
7454  * 
7455  * Revision 1.31  1994/11/27  23:17:20  matt
7456  * Made changes for new mprintf calling convention
7457  * 
7458  * Revision 1.30  1994/11/17  14:48:11  mike
7459  * validation functions moved from editor to game.
7460  * 
7461  * Revision 1.29  1994/08/25  21:56:15  mike
7462  * IS_CHILD stuff.
7463  * 
7464  * Revision 1.28  1994/08/09  16:06:00  john
7465  * Added the ability to place players.  Made old
7466  * Player variable be ConsoleObject.
7467  * 
7468  * Revision 1.27  1994/07/21  17:25:43  matt
7469  * Took out unused func medlisp_create_new_mine() and its prototype
7470  * 
7471  * Revision 1.26  1994/07/21  13:27:01  matt
7472  * Cleaned up render code and added error checking
7473  * 
7474  * Revision 1.25  1994/07/20  15:32:52  matt
7475  * Added func to call g3_point_2_vec() for texture-mapped window
7476  * 
7477  * Revision 1.24  1994/07/15  15:26:53  yuan
7478  * Fixed warning
7479  * 
7480  * Revision 1.23  1994/07/14  14:45:16  yuan
7481  * Added function to set default segment and attach.
7482  * 
7483  * Revision 1.22  1994/07/14  09:46:34  yuan
7484  * Make E attach segment as well as make default.
7485  * 
7486  * 
7487  * Revision 1.21  1994/07/11  18:39:17  john
7488  * Reversed y axis roll.
7489  * 
7490  * Revision 1.20  1994/07/06  16:36:32  mike
7491  * Add hook for game to render wireframe view: draw_world_from_game.
7492  * 
7493  * Revision 1.19  1994/06/24  14:08:31  john
7494  * Changed calling params for render_frame.
7495  * 
7496  * Revision 1.18  1994/06/23  15:54:02  matt
7497  * Finished hacking in 3d rendering in big window
7498  * 
7499  * Revision 1.17  1994/06/22  00:32:56  matt
7500  * New version, without all the errors of the last version. Sorry.
7501  * 
7502  * Revision 1.15  1994/05/23  14:48:54  mike
7503  * make current segment be add segment.
7504  * 
7505  * Revision 1.14  1994/05/19  12:09:35  matt
7506  * Use new vecmat macros and globals
7507  * 
7508  * Revision 1.13  1994/05/14  17:17:55  matt
7509  * Got rid of externs in source (non-header) files
7510  * 
7511  * Revision 1.12  1994/05/09  23:35:06  mike
7512  * Add ClearFoundList, which is probably no longer being called.
7513  * 
7514  * Revision 1.11  1994/05/04  14:11:40  mike
7515  * Increase render depth from 4 to 6 by default.
7516  * 
7517  * Revision 1.10  1994/04/27  21:00:25  matt
7518  * Made texture-mapped window redraw when editor state variables (such as
7519  * current object) have changed.
7520  * 
7521  * Revision 1.9  1994/03/31  12:03:38  matt
7522  * Cleaned up includes
7523  * 
7524  * Revision 1.8  1994/02/17  11:31:21  matt
7525  * Changes in object system
7526  * 
7527  * Revision 1.7  1994/02/11  11:05:14  yuan
7528  * Make chase mode unsettable... Gives a warning on the mono.
7529  * 
7530  * Revision 1.6  1994/01/21  17:37:24  matt
7531  * Moved code from render_frame() to caller, making code cleaner
7532  * 
7533  * Revision 1.5  1994/01/11  18:12:43  yuan
7534  * compress_mines removed.  Now it is called within
7535  * the gamesave.min save whenever we go into the game.
7536  * 
7537  * Revision 1.4  1994/01/05  10:54:15  john
7538  * New object code by John
7539  * 
7540  * Revision 1.3  1993/12/29  16:15:27  mike
7541  * Kill scale field from segment struct.
7542  * 
7543  * Revision 1.2  1993/12/17  12:05:00  john
7544  * Took stuff out of med.c; moved into medsel.c, meddraw.c, medmisc.c
7545  * 
7546  * Revision 1.1  1993/12/17  08:35:47  john
7547  * Initial revision
7548
7549 ------------------------------------------------------------------------
7550 main/editor/medmisc.h:
7551
7552  * Revision 2.0  1995/02/27  11:34:40  john
7553  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7554  * for bitmaps.tbl.
7555  * 
7556  * Revision 1.3  1994/07/21  17:25:28  matt
7557  * Took out unused func medlisp_create_new_mine() and its prototype
7558  * 
7559  * Revision 1.2  1993/12/17  12:05:04  john
7560  * Took stuff out of med.c; moved into medsel.c, meddraw.c, medmisc.c
7561  * 
7562  * Revision 1.1  1993/12/17  08:45:23  john
7563  * Initial revision
7564
7565 ------------------------------------------------------------------------
7566 main/editor/medrobot.c:
7567
7568  * Revision 2.0  1995/02/27  11:35:59  john
7569  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7570  * for bitmaps.tbl.
7571  * 
7572  * Revision 1.46  1995/02/22  15:22:03  allender
7573  * remove anonyous unions from object structure
7574  * 
7575  * Revision 1.45  1994/11/27  23:17:32  matt
7576  * Made changes for new mprintf calling convention
7577  * 
7578  * Revision 1.44  1994/11/14  11:39:57  mike
7579  * fix default robot behavior
7580  * 
7581  * Revision 1.43  1994/11/02  16:18:47  matt
7582  * Moved draw_model_picture() out of editor, and cleaned up code
7583  * 
7584  * Revision 1.42  1994/10/10  17:23:23  mike
7585  * Verify that not placing too many player objects.
7586  * 
7587  * Revision 1.41  1994/10/09  22:04:38  mike
7588  * Maybe improve, maybe not, robot selection in shift-R menu.
7589  * 
7590  * Revision 1.40  1994/09/30  21:49:01  mike
7591  * Fix stupid shift-R dialog bug which caused lots of mprintf and selecting of object and frustration.
7592  * 
7593  * Revision 1.39  1994/09/30  11:51:33  mike
7594  * Fix boolean logic on an error trap.
7595  * 
7596  * Revision 1.38  1994/09/20  14:36:32  mike
7597  * Clean up Robot dialog.
7598  * 
7599  * Revision 1.37  1994/09/12  19:11:56  mike
7600  * Fix stupid bugs in selecting objects.
7601  * 
7602  * Revision 1.36  1994/09/01  17:05:51  matt
7603  * Don't force redraw if object select fails
7604  * 
7605  * Revision 1.35  1994/08/31  19:24:40  mike
7606  * Fix hang bug when only objects in mine are not robots.
7607  * 
7608  * Revision 1.34  1994/08/25  21:56:38  mike
7609  * IS_CHILD stuff.
7610  * 
7611  * Revision 1.33  1994/08/23  16:39:29  mike
7612  * mode replaced by behavior in ai_info.
7613  * 
7614  * Revision 1.32  1994/08/15  23:47:16  mike
7615  * fix bugs.
7616  * 
7617  * Revision 1.31  1994/08/13  17:32:45  mike
7618  * set to still function.
7619  * 
7620  * Revision 1.30  1994/08/09  16:06:02  john
7621  * Added the ability to place players.  Made old
7622  * Player variable be ConsoleObject.
7623  * 
7624  * Revision 1.29  1994/08/02  16:22:48  matt
7625  * Finished object editor dialog
7626
7627 ------------------------------------------------------------------------
7628 main/editor/medrobot.h:
7629
7630  * Revision 2.0  1995/02/27  11:35:04  john
7631  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7632  * for bitmaps.tbl.
7633  * 
7634  * Revision 1.4  1994/08/02  14:17:56  mike
7635  * Clean up dialog boxes.
7636  * 
7637  * Revision 1.3  1994/07/21  19:34:58  yuan
7638  * Fixed #include problem
7639  * 
7640  * Revision 1.2  1994/04/27  21:01:16  matt
7641  * Added prototypes for robot functions
7642  * 
7643  * Revision 1.1  1994/04/27  20:28:59  matt
7644  * Initial revision
7645
7646 ------------------------------------------------------------------------
7647 main/editor/medsel.c:
7648
7649  * Revision 2.0  1995/02/27  11:35:20  john
7650  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7651  * for bitmaps.tbl.
7652  * 
7653  * Revision 1.10  1994/08/09  16:05:59  john
7654  * Added the ability to place players.  Made old
7655  * Player variable be ConsoleObject.
7656  * 
7657  * Revision 1.9  1994/05/23  14:56:27  mike
7658  * make current segment be add segment.
7659  * 
7660  * Revision 1.8  1994/05/14  18:00:50  matt
7661  * Got rid of externs in source (non-header) files
7662  * 
7663  * Revision 1.7  1994/03/31  12:03:33  matt
7664  * Cleaned up includes
7665  * 
7666  * Revision 1.6  1994/02/17  12:52:13  yuan
7667  * Unbackdated
7668  * y
7669  * 
7670  * Revision 1.4  1994/02/17  09:46:53  matt
7671  * Removed include of slew.h
7672  * 
7673  * Revision 1.3  1994/01/05  10:54:23  john
7674  * New object code by John
7675  * 
7676  * Revision 1.2  1993/12/17  12:18:22  john
7677  * Moved selection stuff out of med.c
7678  * 
7679  * Revision 1.1  1993/12/17  09:29:34  john
7680  * Initial revision
7681
7682 ------------------------------------------------------------------------
7683 main/editor/medsel.h:
7684
7685  * Revision 2.0  1995/02/27  11:34:28  john
7686  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7687  * for bitmaps.tbl.
7688  * 
7689  * Revision 1.2  1993/12/17  12:18:35  john
7690  * Moved selection stuff out of med.c
7691  * 
7692  * Revision 1.1  1993/12/17  09:29:51  john
7693  * Initial revision
7694
7695 ------------------------------------------------------------------------
7696 main/editor/medwall.c:
7697
7698  * Revision 2.0  1995/02/27  11:35:47  john
7699  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7700  * for bitmaps.tbl.
7701  * 
7702  * Revision 1.71  1995/02/01  16:30:03  yuan
7703  * Stabilizing triggers and matcens.
7704  * 
7705  * Revision 1.70  1995/01/28  15:28:08  yuan
7706  * Return proper bug description.
7707  * 
7708  * Revision 1.69  1995/01/14  19:18:07  john
7709  * First version of object paging.
7710  * 
7711  * Revision 1.68  1995/01/12  12:10:44  yuan
7712  * Added delete trigger function
7713  * 
7714  * Revision 1.67  1994/11/29  16:51:53  yuan
7715  * Fixed false bogus trigger info.
7716  * 
7717  * Revision 1.66  1994/11/27  23:17:29  matt
7718  * Made changes for new mprintf calling convention
7719  * 
7720  * Revision 1.65  1994/11/15  11:59:42  john
7721  * Changed timing for door to use fixed seconds instead of milliseconds.
7722  * 
7723  * Revision 1.64  1994/11/03  10:41:17  yuan
7724  * Made walls add whichever the previous type was.
7725  * 
7726  * Revision 1.63  1994/10/13  13:14:59  yuan
7727  * Fixed trigger removal bug.
7728  * 
7729  * Revision 1.62  1994/10/07  17:43:39  yuan
7730  * Make validate walls default to 1.
7731  * 
7732  * Revision 1.61  1994/10/03  23:40:20  mike
7733  * Fix hosedness in walls in group copying.
7734  * 
7735  * Revision 1.60  1994/09/29  00:20:36  matt
7736  * Took out reference to unused external wall type
7737  * 
7738  * Revision 1.59  1994/09/28  17:32:24  mike
7739  * Functions to copy walls withing groups.
7740  * 
7741  * Revision 1.58  1994/09/28  13:40:46  yuan
7742  * Fixed control center trigger bug.
7743  * 
7744  * Revision 1.57  1994/09/24  12:41:52  matt
7745  * Took out references to obsolete constants
7746  * 
7747  * Revision 1.56  1994/09/23  18:03:55  yuan
7748  * Finished wall checking code.
7749  * 
7750  * Revision 1.55  1994/09/22  14:35:25  matt
7751  * Made blastable walls work again
7752  * 
7753  * Revision 1.54  1994/09/21  16:46:07  yuan
7754  * Fixed bug that reset wall slot which was just deleted.
7755  * 
7756  * Revision 1.53  1994/09/20  18:31:21  yuan
7757  * Output right Wallnum
7758  * 
7759  * Revision 1.52  1994/09/20  18:23:24  yuan
7760  * Killed the BOGIFYING WALL DRAGON...
7761  * 
7762  * There was a problem with triggers being created that had bogus
7763  * pointers back to their segments.
7764  * 
7765  * Revision 1.51  1994/09/20  11:13:11  yuan
7766  * Delete all bogus walls when checking walls.
7767  * 
7768  * Revision 1.50  1994/09/19  23:31:14  yuan
7769  * Adding wall checking stuff.
7770  * 
7771  * Revision 1.49  1994/09/13  21:11:20  matt
7772  * Added wclips that use tmap1 instead of tmap2, saving lots of merging
7773  * 
7774  * Revision 1.48  1994/09/10  13:32:08  matt
7775  * Made exploding walls a type of blastable walls.
7776  * Cleaned up blastable walls, making them tmap2 bitmaps.
7777  * 
7778  * Revision 1.47  1994/09/10  09:47:47  yuan
7779  * Added wall checking function.
7780  * 
7781  * Revision 1.46  1994/08/26  14:14:56  yuan
7782  * Fixed wall clip being set to -2 bug.
7783  * 
7784  * Revision 1.45  1994/08/25  21:56:26  mike
7785  * IS_CHILD stuff.
7786  * 
7787  * Revision 1.44  1994/08/19  19:30:27  matt
7788  * Added informative message if wall is already external when making it so.
7789  * 
7790  * Revision 1.43  1994/08/17  11:13:46  matt
7791  * Changed way external walls work
7792  * 
7793  * Revision 1.42  1994/08/15  17:47:29  yuan
7794  * Added external walls
7795  * 
7796  * Revision 1.41  1994/08/05  21:18:09  matt
7797  * Allow two doors to be linked together
7798  * 
7799  * Revision 1.40  1994/08/02  14:18:06  mike
7800  * Clean up dialog boxes.
7801  * 
7802  * Revision 1.39  1994/08/01  11:04:33  yuan
7803  * New materialization centers.
7804  * 
7805  * Revision 1.38  1994/07/22  17:19:11  yuan
7806  * Working on dialog box for refuel/repair/material/control centers.
7807  * 
7808  * Revision 1.37  1994/07/20  17:35:33  yuan
7809  * Added new gold key.
7810  * 
7811  * Revision 1.36  1994/07/19  14:31:44  yuan
7812  * Fixed keys bug.
7813  * 
7814  * Revision 1.35  1994/07/18  15:58:31  yuan
7815  * Hopefully prevent any "Adam door bombouts"
7816  * 
7817  * Revision 1.34  1994/07/18  15:48:40  yuan
7818  * Made minor cosmetic change.
7819  * 
7820  * Revision 1.33  1994/07/15  16:09:22  yuan
7821  * Error checking
7822  * 
7823  * Revision 1.32  1994/07/14  16:47:05  yuan
7824  * Fixed wall dialog for selected dooranims.
7825  * 
7826  * Revision 1.31  1994/07/11  15:09:16  yuan
7827  * Wall anim filenames stored in wclip structure.
7828  * 
7829  * Revision 1.30  1994/07/06  10:56:01  john
7830  * New structures for hostages.
7831  * 
7832  * Revision 1.29  1994/07/01  16:35:54  yuan
7833  * Added key system
7834  * 
7835  * Revision 1.28  1994/06/21  18:50:12  john
7836  * Made ESC key exit dialog.
7837  * 
7838  * Revision 1.27  1994/06/20  22:29:59  yuan
7839  * Fixed crazy runaway trigger bug that Adam found
7840  * 
7841  * Revision 1.26  1994/06/01  15:50:25  yuan
7842  * Added one more door... Needs to be set by bm.c in the future.
7843  * 
7844  * Revision 1.25  1994/05/30  20:22:34  yuan
7845  * New triggers.
7846  * 
7847  * Revision 1.24  1994/05/27  10:34:31  yuan
7848  * Added new Dialog boxes for Walls and Triggers.
7849  * 
7850  * Revision 1.23  1994/05/25  18:08:45  yuan
7851  * Revamping walls and triggers interface.
7852  * Wall interface complete, but triggers are still in progress.
7853  * 
7854  * Revision 1.22  1994/05/18  18:21:56  yuan
7855  * Fixed delete segment and walls bug.
7856  * 
7857  * Revision 1.21  1994/05/11  18:24:29  yuan
7858  * Oops.. trigger not triggers..
7859  * 
7860  * Revision 1.20  1994/05/11  18:23:53  yuan
7861  * Fixed trigger not set to -1 bug.
7862
7863 ------------------------------------------------------------------------
7864 main/editor/medwall.h:
7865
7866  * Revision 2.0  1995/02/27  11:35:10  john
7867  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7868  * for bitmaps.tbl.
7869  * 
7870  * Revision 1.9  1994/09/28  17:31:51  mike
7871  * Prototype copy_group_walls().
7872  * 
7873  * Revision 1.8  1994/08/05  21:18:16  matt
7874  * Allow two doors to be linked together
7875  * 
7876  * Revision 1.7  1994/06/20  22:30:10  yuan
7877  * Fixed crazy runaway trigger bug that Adam found
7878  * 
7879  * Revision 1.6  1994/05/30  20:22:58  yuan
7880  * New triggers.
7881  * 
7882  * Revision 1.5  1994/05/25  18:08:37  yuan
7883  * Revamping walls and triggers interface.
7884  * Wall interface complete, but triggers are still in progress.
7885  * 
7886  * Revision 1.4  1994/05/18  18:22:04  yuan
7887  * Fixed delete segment and walls bug.
7888  * 
7889  * Revision 1.3  1994/03/17  18:08:41  yuan
7890  * New wall stuff... Cut out switches....
7891  * 
7892  * Revision 1.2  1994/03/15  16:34:10  yuan
7893  * Fixed bm loader (might have some changes in walls and switches)
7894  * 
7895  * Revision 1.1  1994/02/10  17:52:01  matt
7896  * Initial revision
7897
7898 ------------------------------------------------------------------------
7899 main/editor/mine.c:
7900
7901  * Revision 2.0  1995/02/27  11:34:38  john
7902  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7903  * for bitmaps.tbl.
7904  * 
7905  * Revision 1.82  1995/01/19  15:19:42  mike
7906  * New super-compressed registered file format.
7907  * 
7908  * Revision 1.81  1994/12/15  16:51:39  mike
7909  * fix error message.
7910  * 
7911  * Revision 1.80  1994/12/09  22:52:27  yuan
7912  * *** empty log message ***
7913  * 
7914  * Revision 1.79  1994/11/27  23:17:14  matt
7915  * Made changes for new mprintf calling convention
7916  * 
7917  * Revision 1.78  1994/11/26  21:48:24  matt
7918  * Fixed saturation in short light value
7919  * 
7920  * Revision 1.77  1994/11/18  09:43:22  mike
7921  * mprintf and clean up instead of Assert on values which don't fit in a short.
7922  * 
7923  * Revision 1.76  1994/11/17  20:37:37  john
7924  * Added comment to get mike or john.
7925  * 
7926  * Revision 1.75  1994/11/17  20:08:51  john
7927  * Added new compiled level format.
7928  * 
7929  * Revision 1.74  1994/11/17  11:39:00  matt
7930  * Ripped out code to load old mines
7931  * 
7932  * Revision 1.73  1994/10/20  12:47:47  matt
7933  * Replaced old save files (MIN/SAV/HOT) with new LVL files
7934  * 
7935  * Revision 1.72  1994/09/23  22:13:58  matt
7936  * Tooks out references to obsolete structure fields
7937  * 
7938  * Revision 1.71  1994/09/22  18:39:40  john
7939  * *** empty log message ***
7940  * 
7941  * Revision 1.70  1994/09/22  18:38:09  john
7942  * Added better help for locked files.
7943  * 
7944  * Revision 1.69  1994/08/01  11:04:44  yuan
7945  * New materialization centers.
7946  * 
7947  * Revision 1.68  1994/06/08  14:29:35  matt
7948  * Took out support for old mine versions
7949  * 
7950  * Revision 1.67  1994/05/27  10:34:37  yuan
7951  * Added new Dialog boxes for Walls and Triggers.
7952  * 
7953  * Revision 1.66  1994/05/23  14:48:08  mike
7954  * make current segment be add segment.
7955  * 
7956  * Revision 1.65  1994/05/17  10:34:52  matt
7957  * New parm to reset_objects; Num_objects no longer global
7958  * 
7959  * Revision 1.64  1994/05/12  14:46:46  mike
7960  * Load previous mine type.
7961  * 
7962  * Revision 1.63  1994/05/06  12:52:13  yuan
7963  * Adding some gamesave checks...
7964  * 
7965  * Revision 1.62  1994/05/05  12:56:32  yuan
7966  * Fixed a bunch of group bugs.
7967  * 
7968  * Revision 1.61  1994/05/03  11:36:55  yuan
7969  * Fixing mine save.
7970  * 
7971  * Revision 1.60  1994/03/19  17:22:14  yuan
7972  * Wall system implemented until specific features need to be added...
7973  * (Needs to be hammered on though.)
7974  * 
7975  * Revision 1.59  1994/03/17  18:08:32  yuan
7976  * New wall stuff... Cut out switches....
7977  * 
7978  * Revision 1.58  1994/03/15  16:34:15  yuan
7979  * Fixed bm loader (might have some changes in walls and switches)
7980  * 
7981  * Revision 1.57  1994/03/01  18:14:09  yuan
7982  * Added new walls, switches, and triggers.
7983
7984 ------------------------------------------------------------------------
7985 main/editor/objpage.c:
7986
7987  * Revision 2.0  1995/02/27  11:34:43  john
7988  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
7989  * for bitmaps.tbl.
7990  * 
7991  * Revision 1.37  1995/01/14  19:17:55  john
7992  * First version of object paging.
7993  * 
7994  * Revision 1.36  1995/01/05  16:20:13  mike
7995  * bah, remove the int3.
7996  * 
7997  * Revision 1.35  1995/01/05  12:47:13  mike
7998  * Move code about to prevent compiler warning.
7999  * 
8000  * Revision 1.34  1994/11/18  15:23:55  john
8001  * Made so the int3 for drawing an invalib object just returns.
8002  * 
8003  * Revision 1.33  1994/11/02  16:19:18  matt
8004  * Moved draw_model_picture() out of editor, and cleaned up code
8005  * 
8006  * Revision 1.32  1994/10/23  02:11:18  matt
8007  * Got rid of obsolete hostage_info stuff
8008  * 
8009  * Revision 1.31  1994/09/09  14:41:35  matt
8010  * New parms for draw_polygon_model()
8011  * 
8012  * Revision 1.30  1994/08/29  19:26:53  matt
8013  * Fixed botches change from yesterday
8014  * 
8015  * Revision 1.29  1994/08/28  23:40:35  matt
8016  * 
8017  * 
8018  * Revision 1.28  1994/08/14  23:15:32  matt
8019  * Added animating bitmap hostages, and cleaned up vclips a bit
8020  * 
8021  * Revision 1.27  1994/08/13  14:59:02  matt
8022  * Finished adding support for miscellaneous objects
8023  * 
8024  * Revision 1.26  1994/08/09  16:06:15  john
8025  * Added the ability to place players.  Made old
8026  * Player variable be ConsoleObject.
8027  * 
8028  * Revision 1.25  1994/07/28  16:59:23  mike
8029  * objects containing objects.
8030  * 
8031  * Revision 1.24  1994/06/08  18:17:25  john
8032  * Changed the way object types and id's work for hostages
8033  * and powerups.
8034  * 
8035  * Revision 1.23  1994/06/07  16:52:30  matt
8036  * Made object lighting work correctly; changed name of Ambient_light to
8037  * Dynamic_light; cleaned up polygobj object rendering a little.
8038  * 
8039  * Revision 1.22  1994/05/31  18:42:07  matt
8040  * Made robot photos unlighted
8041  * 
8042  * Revision 1.21  1994/05/26  21:09:34  matt
8043  * Moved robot stuff out of polygon model and into robot_info struct
8044  * Made new file, robot.c, to deal with robots
8045  * 
8046  * Revision 1.20  1994/05/19  12:10:11  matt
8047  * Use new vecmat macros and globals
8048  * 
8049  * Revision 1.19  1994/05/17  14:45:27  mike
8050  * Get object type and id from ObjType and ObjId.
8051  * 
8052  * Revision 1.18  1994/05/17  12:03:36  mike
8053  * Deal with little known fact that polygon object != robot.
8054  * 
8055  * Revision 1.17  1994/04/29  09:16:56  matt
8056  * Added support for multiple-piece explosions
8057  * 
8058  * Revision 1.16  1994/04/18  14:15:00  john
8059  * Initial version of robot dialog box.
8060  * 
8061  * Revision 1.15  1994/04/11  12:01:36  yuan
8062  * Fixed resetting to first object on page annoyance.
8063  * 
8064  * Revision 1.14  1994/04/01  14:35:50  yuan
8065  * Removed debug "id %d\n" for placing objects
8066  * 
8067  * Revision 1.13  1994/04/01  11:17:04  yuan
8068  * Added objects to objpage. Added buttons for easier tmap scrolling.
8069  * Objects are selected fully from objpage and add object menu or pad.
8070  * 
8071  * Revision 1.12  1994/03/25  18:42:26  matt
8072  * Adjusted constant to make robot pictures more correct size
8073  * 
8074  * Revision 1.11  1994/03/25  16:57:17  matt
8075  * New parm to draw_polygon_object(), and draw object "snapshots" in
8076  * correct size (although this probably doesn't work yet).
8077  * 
8078  * Revision 1.10  1994/03/25  14:23:01  matt
8079  * Disabled lighting when taking "snapshots" of robots
8080  * 
8081  * Revision 1.9  1994/03/17  10:47:24  john
8082  * Corrected all kinds of problems associated with N_polygon_objects.
8083  * 
8084  * Revision 1.8  1994/03/16  11:07:31  john
8085  * Made zoom work a bit better.
8086  * 
8087  * Revision 1.7  1994/03/16  10:50:32  john
8088  * fixed warning with constant length.
8089  * 
8090  * Revision 1.6  1994/03/16  10:43:18  john
8091  * Added controls to rotate/zoom object.
8092  * 
8093  * Revision 1.5  1994/03/15  22:23:24  matt
8094  * Render little bitmap pictures of robots for display on editor page
8095  * 
8096  * Revision 1.4  1994/02/01  11:27:14  john
8097  * Hacked in 8 object types for demo.
8098  * 
8099  * Revision 1.3  1994/01/26  16:42:19  john
8100  * Display numbers instead of bitmaps... made 
8101  * Num_robot_types or whatever be set to 4
8102  * in init_object_page... this is a hack!!!
8103  * 
8104  * Revision 1.2  1993/12/16  17:26:24  john
8105  * Moved texture and object selection to texpage and objpage
8106  * 
8107  * Revision 1.1  1993/12/16  16:12:57  john
8108  * Initial revision
8109
8110 ------------------------------------------------------------------------
8111 main/editor/objpage.h:
8112
8113  * Revision 2.0  1995/02/27  11:35:32  john
8114  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8115  * for bitmaps.tbl.
8116  * 
8117  * Revision 1.8  1994/11/02  16:19:20  matt
8118  * Moved draw_model_picture() out of editor, and cleaned up code
8119  * 
8120  * Revision 1.7  1994/07/28  16:59:36  mike
8121  * objects containing objects.
8122  * 
8123  * Revision 1.6  1994/05/17  14:45:48  mike
8124  * Get object type and id from ObjectType and ObjectId.
8125  * 
8126  * Revision 1.5  1994/05/17  12:03:55  mike
8127  * Deal with little known fact that polygon object != robot.
8128  * 
8129  * Revision 1.4  1994/05/14  18:00:33  matt
8130  * Got rid of externs in source (non-header) files
8131  * 
8132  * Revision 1.3  1994/04/01  11:17:06  yuan
8133  * Added objects to objpage. Added buttons for easier tmap scrolling.
8134  * Objects are selected fully from objpage and add object menu or pad.
8135  * 
8136  * Revision 1.2  1993/12/16  17:26:27  john
8137  * Moved texture and object selection to texpage and objpage
8138  * 
8139  * Revision 1.1  1993/12/16  16:13:08  john
8140  * Initial revision
8141
8142 ------------------------------------------------------------------------
8143 main/editor/segment.c:
8144
8145  * Revision 2.0  1995/02/27  11:35:21  john
8146  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8147  * for bitmaps.tbl.
8148  * 
8149  * Revision 1.191  1995/02/22  15:28:30  allender
8150  * remove anonymous unions from object structure
8151  * 
8152  * Revision 1.190  1995/02/02  02:59:40  yuan
8153  * Working on exterminating bogus matcen_nums... (harmless though)
8154  * 
8155  * Revision 1.189  1995/02/01  16:29:51  yuan
8156  * Stabilizing triggers and matcens.
8157  * 
8158  * Revision 1.188  1995/02/01  11:31:47  yuan
8159  * Trigger bug fixed.
8160  * 
8161  * Revision 1.187  1994/11/27  23:17:24  matt
8162  * Made changes for new mprintf calling convention
8163  * 
8164  * Revision 1.186  1994/11/17  14:48:12  mike
8165  * validation functions moved from editor to game.
8166  * 
8167  * Revision 1.185  1994/10/30  14:13:17  mike
8168  * rip out local segment stuff.
8169  * 
8170  * Revision 1.184  1994/10/27  10:04:24  matt
8171  * When triangulating, don't use WID() to see if connected, look at children
8172  * 
8173  * Revision 1.183  1994/10/26  13:40:23  mike
8174  * debug code for matt.
8175  * 
8176  * Revision 1.182  1994/10/24  16:34:00  mike
8177  * Force render after mine compress to prevent bugs in segment selection via clicking in 3d window.
8178  * 
8179  * Revision 1.181  1994/10/20  18:16:15  mike
8180  * Initialize ControlCenterTriggers.num_links in create_new_mine.
8181  * 
8182  * Revision 1.180  1994/10/18  16:29:14  mike
8183  * Write function to automatically fix bogus segnums in segment array.
8184  * 
8185  * Revision 1.179  1994/10/08  17:10:41  matt
8186  * Correctly set current_level_num when loading/creating mine in editor
8187  * 
8188  * Revision 1.178  1994/09/25  14:17:51  mike
8189  * Initialize (to 0) Num_robot_centers and Num_open_doors at mine creation.
8190  * 
8191  * Revision 1.177  1994/09/20  14:36:06  mike
8192  * Write function to find overlapping segments.
8193  * 
8194  * Revision 1.176  1994/08/25  21:55:57  mike
8195  * IS_CHILD stuff.
8196  * 
8197  * Revision 1.175  1994/08/23  15:28:03  mike
8198  * Fix peculiarity in med_combine_duplicate_vertices.
8199  * 
8200  * Revision 1.174  1994/08/09  16:06:17  john
8201  * Added the ability to place players.  Made old
8202  * Player variable be ConsoleObject.
8203  * 
8204  * Revision 1.173  1994/08/05  21:18:10  matt
8205  * Allow two doors to be linked together
8206  * 
8207  * Revision 1.172  1994/08/04  19:13:16  matt
8208  * Changed a bunch of vecmat calls to use multiple-function routines, and to
8209  * allow the use of C macros for some functions
8210  * 
8211  * Revision 1.171  1994/07/22  12:37:00  matt
8212  * Cleaned up editor/game interactions some more.
8213  * 
8214  * Revision 1.170  1994/07/22  11:20:08  mike
8215  * Set Lsegments validity.
8216  * 
8217  * Revision 1.169  1994/07/21  19:02:49  mike
8218  * lsegment stuff.
8219  * 
8220  * Revision 1.168  1994/07/21  13:27:17  matt
8221  * Ripped out remants of old demo system, and added demo
8222  * disables object movement and game options from menu.
8223  * 
8224  * Revision 1.167  1994/07/19  20:15:48  matt
8225  * Name for each level now saved in the .SAV file & stored in Current_level_name
8226  * 
8227  * Revision 1.166  1994/07/06  12:42:45  john
8228  * Made generic messages for hostages.
8229  * 
8230  * Revision 1.165  1994/06/24  17:04:29  john
8231  * *** empty log message ***
8232  * 
8233  * Revision 1.164  1994/06/15  15:42:40  mike
8234  * Initialize static_light field in new segments.
8235  * 
8236  * Revision 1.163  1994/06/13  17:49:19  mike
8237  * Fix bug in med_validate_side which was toasting lighting for removable walls.
8238  * 
8239  * Revision 1.162  1994/06/13  10:52:20  mike
8240  * Fix bug in triangulation of sides between connected segments.
8241  * Was assigning SIDE_IS_02 regardless of how triangulated, was
8242  * causing physics bugs.
8243  * 
8244  * Revision 1.161  1994/06/08  18:14:16  mike
8245  * Fix triangulation of sides in hallways (ie, where there is no wall),
8246  * so they get triangulated the same way, so find_new_seg doesn't get
8247  * stuck in an infinite recursion.
8248  * 
8249  * Revision 1.160  1994/06/08  11:44:31  mike
8250  * Fix bug in normals not being opposite on opposite sides of a segment.
8251  * Problem occurred due to difference in handling of remainder in signed divide.
8252  * 
8253  * Revision 1.159  1994/05/31  19:00:15  yuan
8254  * Fixed gamestate restore.
8255  * 
8256  * Revision 1.158  1994/05/30  20:22:36  yuan
8257  * New triggers.
8258  * 
8259  * Revision 1.157  1994/05/26  19:32:51  mike
8260  * Add bfs_parse.
8261  * 
8262  * Revision 1.156  1994/05/23  14:56:46  mike
8263  * make current segment be add segment.,
8264
8265 ------------------------------------------------------------------------
8266 main/editor/seguvs.c:
8267
8268  * Revision 2.1  1995/05/08  10:49:34  mike
8269  * fix lighting bug: oblong segments could be very dark.
8270  * 
8271  * Revision 2.0  1995/02/27  11:36:37  john
8272  * Version 2.0. Ansi-fied.
8273  * 
8274  * Revision 1.84  1994/11/27  23:17:18  matt
8275  * Made changes for new mprintf calling convention
8276  * 
8277  * Revision 1.83  1994/11/17  14:48:02  mike
8278  * validation functions moved from editor to game.
8279  * 
8280  * Revision 1.82  1994/10/15  19:08:26  mike
8281  * Disable exhaustive search mprintfs in find_point_seg during lighting.
8282  * 
8283  * Revision 1.81  1994/08/25  21:55:50  mike
8284  * IS_CHILD stuff.
8285  * 
8286  * Revision 1.80  1994/08/04  19:13:22  matt
8287  * Changed a bunch of vecmat calls to use multiple-function routines, and to
8288  * allow the use of C macros for some functions
8289  * 
8290  * Revision 1.79  1994/08/03  10:31:33  mike
8291  * Texture map propagation without uv assignment.
8292  * 
8293  * Revision 1.78  1994/08/01  13:31:12  matt
8294  * Made fvi() check holes in transparent walls, and changed fvi() calling
8295  * parms to take all input data in query structure.
8296  * 
8297  * Revision 1.77  1994/07/08  14:31:24  matt
8298  * New parms for FVI
8299  * 
8300  * Revision 1.76  1994/06/23  14:01:04  mike
8301  * Fix cache bug which caused some vertices to not get light, mainly
8302  * noticeable at joints which had doors.
8303  * 
8304  * Revision 1.75  1994/06/22  17:33:11  mike
8305  * Make position of light (which is always towards center of segment from
8306  * actual light panel) constant, not dependent on segment size, which fixes
8307  * bug of dark light panels in very large segments.
8308  * 
8309  * Revision 1.74  1994/06/21  18:58:18  mike
8310  * Fix stupid bug in light propagation, was using wrong vector in fvi caching.
8311  * 
8312  * Revision 1.73  1994/06/20  11:20:24  mike
8313  * Fix stupid lighting bug introduced when I went to cached fvi results.
8314  * 
8315  * Revision 1.72  1994/06/19  16:26:37  mike
8316  * Speed up lighting by storing and hashing fvi results.
8317  * 
8318  * Revision 1.71  1994/06/17  16:05:56  mike
8319  * Support optional quick lighting propagation: no find_vector_intersection.
8320  * 
8321  * Revision 1.70  1994/06/15  15:42:30  mike
8322  * Propagate static_light.
8323  * 
8324  * Revision 1.69  1994/06/14  16:59:37  mike
8325  * Fix references to tmap_num2, must strip off orientation bits.
8326  * 
8327  * Revision 1.68  1994/06/09  09:58:58  matt
8328  * Moved find_vector_intersection() from physics.c to new file fvi.c
8329  * 
8330  * 
8331  * Revision 1.67  1994/06/08  18:14:02  mike
8332  * mprintf a dot in light casting.
8333  * 
8334  * Revision 1.66  1994/06/08  14:37:45  mike
8335  * double static light value in going from value (a short) to static_light (a fix).
8336  * 
8337  * Revision 1.65  1994/06/08  14:29:44  matt
8338  * Added static_light field to segment structure, and padded side struct
8339  * to be longword aligned.
8340  * 
8341  * Revision 1.64  1994/06/08  11:45:24  mike
8342  * New, supercool, superslow lighting function.
8343  * 
8344  * Revision 1.63  1994/06/07  09:38:11  mike
8345  * Make lighting function yet better by calling find_vector_intersection.
8346  * 
8347  * Revision 1.62  1994/06/06  13:14:33  mike
8348  * Make illusory walls cast light.
8349  * 
8350  * Revision 1.61  1994/06/05  20:39:47  mike
8351  * Add new distance and dot product based lighting function.
8352  * 
8353  * Revision 1.60  1994/05/31  12:31:18  mike
8354  * fix bugs in lighting, though it's not perfect, will be changing all
8355  * lighting to be distance based.  Bug had to do with not handling one
8356  * of the return values from WALL_IS_DOORWAY, so assuming light couldn't
8357  * be recursively propagated almost all the time.
8358  * 
8359  * Revision 1.59  1994/05/19  23:35:26  mike
8360  * Support uv coordinates in range 0..1.0.
8361  * 
8362  * Revision 1.58  1994/05/19  12:10:21  matt
8363  * Use new vecmat macros and globals
8364  * 
8365  * Revision 1.57  1994/05/04  19:15:53  mike
8366  * Error checking for degenerate segments.
8367  * 
8368  * Revision 1.56  1994/05/03  11:02:34  mike
8369  * Change how default texture map assignment works; now pixels are constant size.
8370  * 
8371  * Revision 1.55  1994/04/28  23:25:26  yuan
8372  * Obliterated warnings.
8373
8374 ------------------------------------------------------------------------
8375 main/editor/seguvs.h:
8376
8377  * Revision 2.0  1995/02/27  11:34:58  john
8378  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8379  * for bitmaps.tbl.
8380  * 
8381  * Revision 1.3  1994/08/03  10:32:28  mike
8382  * Add stretch_uvs_from_curedge.
8383  * 
8384  * Revision 1.2  1994/05/14  18:00:58  matt
8385  * Got rid of externs in source (non-header) files
8386  * 
8387  * Revision 1.1  1994/05/14  17:27:26  matt
8388  * Initial revision
8389
8390 ------------------------------------------------------------------------
8391 main/editor/texpage.c:
8392
8393  * Revision 2.0  1995/02/27  11:34:51  john
8394  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8395  * for bitmaps.tbl.
8396  * 
8397  * Revision 1.14  1995/01/14  19:18:02  john
8398  * First version of object paging.
8399  * 
8400  * Revision 1.13  1994/11/27  23:17:15  matt
8401  * Made changes for new mprintf calling convention
8402  * 
8403  * Revision 1.12  1994/11/23  15:49:00  mike
8404  * fix bug in tmapnum == 0 always getting reassigned.
8405  * 
8406  * Revision 1.11  1994/11/23  12:17:34  mike
8407  * changing texture maps in all mines.
8408  * 
8409  * Revision 1.10  1994/11/19  00:04:42  john
8410  * Changed some shorts to ints.
8411  * 
8412  * Revision 1.9  1994/11/16  17:59:36  john
8413  * Fixed bug with writing to canvas before initing it.
8414  * 
8415  * Revision 1.8  1994/11/16  13:15:21  matt
8416  * Fixed grab bug, and cleaned up code
8417  * 
8418  * Revision 1.7  1994/08/05  12:26:37  matt
8419  * Fixed overplot problem with texture names
8420  * 
8421  * Revision 1.6  1994/04/11  12:01:58  yuan
8422  * Fixed resetting to first texture on page annoyance.
8423  * 
8424  * Revision 1.5  1994/04/01  11:15:53  yuan
8425  * Added objects to objpage. Added buttons for easier tmap scrolling.
8426  * Objects are selected fully from objpage and add object menu or pad.
8427  * 
8428  * Revision 1.4  1994/03/15  16:33:37  yuan
8429  * Fixed bm loader (might have some changes in walls and switches)
8430  * 
8431  * Revision 1.3  1993/12/16  17:25:46  john
8432  * Moved texture and object selection to texpage and objpage
8433  * 
8434  * Revision 1.2  1993/12/16  15:57:39  john
8435  * moved texture selection stuff to texpage.c
8436  * 
8437  * Revision 1.1  1993/12/16  15:06:56  john
8438  * Initial revision
8439
8440 ------------------------------------------------------------------------
8441 main/editor/texture.c:
8442
8443  * Revision 2.0  1995/02/27  11:34:50  john
8444  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
8445  * for bitmaps.tbl.
8446  * 
8447  * Revision 1.13  1994/08/04  19:13:15  matt
8448  * Changed a bunch of vecmat calls to use multiple-function routines, and to
8449  * allow the use of C macros for some functions
8450  * 
8451  * Revision 1.12  1994/08/03  10:31:56  mike
8452  * Texture map propagation without uv assignment.
8453  * 
8454  * Revision 1.11  1994/07/14  19:36:34  yuan
8455  * Tuning texture slides.
8456  * 
8457  * Revision 1.10  1994/07/14  19:29:08  yuan
8458  * Fixed sliding.
8459  * 
8460  * Revision 1.9  1994/07/14  14:43:06  yuan
8461  * Added 3x rotation.
8462  * 
8463  * Revision 1.8  1994/07/14  11:12:42  yuan
8464  * Made sliding 3x more sensitive
8465  * 
8466  * Revision 1.7  1994/07/14  10:49:56  yuan
8467  * Made texture rotation 3x finer
8468  * 
8469  * Revision 1.6  1994/02/14  12:06:00  mike
8470  * change segment data structure.
8471  * 
8472  * Revision 1.5  1993/12/06  13:26:52  mike
8473  * Make rotation and sliding work for triangulated sides.
8474  * 
8475  * Revision 1.4  1993/12/04  17:18:46  mike
8476  * Add tiling functions, set_default.
8477  * 
8478  * Revision 1.3  1993/12/03  18:39:12  unknown
8479  * Add texture map sliding, allow to work on triangulated sides.
8480  * 
8481  * Revision 1.2  1993/11/30  17:06:09  mike
8482  * Texture map functions.
8483  * 
8484  * Revision 1.1  1993/11/29  16:00:57  mike
8485  * Initial revision
8486
8487 ------------------------------------------------------------------------
8488 main/effects.c:
8489
8490  * Revision 1.1  1995/05/16  15:24:25  allender
8491  * Initial revision
8492  *
8493  * Revision 2.0  1995/02/27  11:32:49  john
8494  * New version 2.0, which has no anonymous unions, builds with
8495  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8496  *
8497  * Revision 1.21  1995/02/13  20:35:06  john
8498  * Lintized
8499  *
8500  * Revision 1.20  1994/12/10  16:44:50  matt
8501  * Added debugging code to track down door that turns into rock
8502  *
8503  * Revision 1.19  1994/12/06  16:27:14  matt
8504  * Fixed horrible bug that was referencing segment -1
8505  *
8506  * Revision 1.18  1994/12/02  23:20:51  matt
8507  * Reset bitmaps possibly changed by crit clips
8508  *
8509  * Revision 1.17  1994/11/14  14:00:19  matt
8510  * Fixed stupid bug
8511  *
8512  * Revision 1.16  1994/11/14  12:42:43  matt
8513  * Allow holes in effects list
8514  *
8515  * Revision 1.15  1994/11/08  21:11:52  matt
8516  * Added functions to stop & start effects
8517  *
8518  * Revision 1.14  1994/10/04  18:59:08  matt
8519  * Exploding eclips now play eclip while exploding, then switch to static bm
8520  *
8521  * Revision 1.13  1994/10/04  15:17:42  matt
8522  * Took out references to unused constant
8523  *
8524  * Revision 1.12  1994/09/29  11:00:01  matt
8525  * Made eclips (wall animations) not frame-rate dependent (for now)
8526  *
8527  * Revision 1.11  1994/09/25  00:40:24  matt
8528  * Added the ability to make eclips (monitors, fans) which can be blown up
8529  *
8530  * Revision 1.10  1994/08/14  23:15:14  matt
8531  * Added animating bitmap hostages, and cleaned up vclips a bit
8532  *
8533  * Revision 1.9  1994/08/05  15:56:04  matt
8534  * Cleaned up effects system, and added alternate effects for after mine
8535  * destruction.
8536  *
8537  * Revision 1.8  1994/08/01  23:17:21  matt
8538  * Add support for animating textures on robots
8539  *
8540  * Revision 1.7  1994/05/23  15:10:46  yuan
8541  * Make Eclips read directly...
8542  * No more need for $EFFECTS list.
8543  *
8544  * Revision 1.6  1994/04/06  14:42:44  yuan
8545  * Adding new powerups.
8546  *
8547  * Revision 1.5  1994/03/15  16:31:54  yuan
8548  * Cleaned up bm-loading code.
8549  * (And structures)
8550  *
8551  * Revision 1.4  1994/03/04  17:09:09  yuan
8552  * New door stuff.
8553  *
8554  * Revision 1.3  1994/01/11  11:18:50  yuan
8555  * Fixed frame_count
8556  *
8557  * Revision 1.2  1994/01/11  10:38:55  yuan
8558  * Special effects new implementation
8559  *
8560  * Revision 1.1  1994/01/10  09:45:29  yuan
8561  * Initial revision
8562
8563 ------------------------------------------------------------------------
8564 main/effects.h:
8565
8566  * Revision 1.1  1995/05/16  15:56:08  allender
8567  * Initial revision
8568  *
8569  * Revision 2.0  1995/02/27  11:27:34  john
8570  * New version 2.0, which has no anonymous unions, builds with
8571  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8572  *
8573  * Revision 1.15  1994/11/08  21:12:07  matt
8574  * Added functions to stop & start effects
8575  *
8576  * Revision 1.14  1994/10/13  17:14:11  adam
8577  * MAX_EFFECTS to 60 (ugh)
8578  *
8579  * Revision 1.13  1994/10/05  10:14:34  adam
8580  * MAX_EFFECTS to 50
8581  *
8582  * Revision 1.12  1994/10/04  18:59:09  matt
8583  * Exploding eclips now play eclip while exploding, then switch to static bm
8584  *
8585  * Revision 1.11  1994/10/04  15:17:52  matt
8586  * Took out references to unused constant
8587  *
8588  * Revision 1.10  1994/09/29  14:15:00  matt
8589  * Added sounds for eclips (wall effects)
8590  *
8591  * Revision 1.9  1994/09/25  00:40:24  matt
8592  * Added the ability to make eclips (monitors, fans) which can be blown up
8593  *
8594  * Revision 1.8  1994/08/05  15:55:25  matt
8595  * Cleaned up effects system, and added alternate effects for after mine
8596  * destruction.
8597  *
8598  * Revision 1.7  1994/08/01  23:17:20  matt
8599  * Add support for animating textures on robots
8600  *
8601  * Revision 1.6  1994/05/19  18:13:18  yuan
8602  * MAX_EFFECTS increased to 30
8603  *
8604  * Revision 1.5  1994/03/15  16:32:37  yuan
8605  * Cleaned up bm-loading code.
8606  * (Fixed structures too)
8607  *
8608  * Revision 1.4  1994/03/04  17:09:07  yuan
8609  * New door stuff.
8610  *
8611  * Revision 1.3  1994/01/19  18:22:45  yuan
8612  * Changed number of effects from 10-20
8613  *
8614  * Revision 1.2  1994/01/11  10:39:07  yuan
8615  * Special effects new implementation
8616  *
8617  * Revision 1.1  1994/01/10  10:36:14  yuan
8618  * Initial revision
8619
8620 ------------------------------------------------------------------------
8621 main/endlevel.c:
8622
8623  * Revision 1.5  1995/10/31  10:24:09  allender
8624  * shareware stuff
8625  *
8626  * Revision 1.4  1995/09/14  16:33:54  allender
8627  * fixed function return values for those that didn't
8628  * have them...thanks matt!
8629  *
8630  * Revision 1.3  1995/07/28  15:36:26  allender
8631  * reverse inverse sqrt change
8632  *
8633  * Revision 1.2  1995/07/28  15:17:40  allender
8634  * inverse magnitude fixup
8635  *
8636  * Revision 1.1  1995/05/16  15:24:32  allender
8637  * Initial revision
8638  *
8639  * Revision 2.2  1995/03/21  14:40:14  john
8640  * Ifdef'd out the NETWORK code.
8641  *
8642  * Revision 2.1  1995/03/20  18:15:50  john
8643  * Added code to not store the normals in the segment structure.
8644  *
8645  * Revision 2.0  1995/02/27  11:30:42  john
8646  * New version 2.0, which has no anonymous unions, builds with
8647  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8648  *
8649  * Revision 1.80  1995/02/22  13:24:45  john
8650  * Removed the vecmat anonymous unions.
8651  *
8652  * Revision 1.79  1995/02/11  12:41:54  john
8653  * Added new song method, with FM bank switching..
8654  *
8655  * Revision 1.78  1995/02/08  11:37:41  mike
8656  * Check for failures in call to obj_create.
8657  *
8658  * Revision 1.77  1995/02/05  22:09:49  matt
8659  * Switch out of rear view when starting endlevel sequence
8660  *
8661  * Revision 1.76  1995/01/30  18:08:28  rob
8662  * Add palette fade out before ending level on special missions.
8663  *
8664  * Revision 1.75  1995/01/29  16:19:19  rob
8665  * Fixed endlevel for custom missions.
8666  *
8667  * Revision 1.74  1995/01/26  12:18:10  rob
8668  * Changed calling convention of network_do_frame.
8669  *
8670  * Revision 1.73  1995/01/21  16:50:03  matt
8671  * Made endlevel work with new mission stuff
8672  *
8673  * Revision 1.72  1994/12/20  18:22:51  john
8674  * Added code to support non-looping songs, and put
8675  * it in for endlevel and credits.
8676  *
8677  * Revision 1.71  1994/12/15  12:23:58  matt
8678  * Added check for failure to create camera object
8679  *
8680  * Revision 1.70  1994/12/15  03:05:28  matt
8681  * Added error checking for NULL return from object_create_explosion()
8682  *
8683  * Revision 1.69  1994/12/12  21:41:38  matt
8684  * Don't start endlevel if OF_SHOULD_BE_DEAD is set for player
8685  *
8686  * Revision 1.68  1994/12/12  15:44:54  rob
8687  * Rolled back a change to endlevel_start that caused more bugs than
8688  * it fixed.
8689  *
8690  * Revision 1.67  1994/12/12  12:08:33  rob
8691  * IF a player is dead upon entering the tunnel, make them not dead.  Not perfect solution
8692  * but avoids some last-minute weirdness we want to fix.  This should be revisited in new
8693  * versions if possible!
8694  *
8695  * Revision 1.66  1994/12/11  22:02:13  allender
8696  * made endlevel data loading work with .txb encoded format (made with
8697  * compbit -i level0?.end -o level0?.txb)
8698  *
8699  * Revision 1.65  1994/12/11  20:32:47  matt
8700  * Made camera transition happen 1/3 of the way through exit tunnel
8701  *
8702  * Revision 1.64  1994/12/08  20:56:27  john
8703  * More cfile stuff.
8704  *
8705  * Revision 1.63  1994/12/07  17:00:52  rob
8706  * Trying to fix homing tone warning when in exit tunnel.
8707  *
8708  * Revision 1.62  1994/12/06  13:24:47  matt
8709  * Made exit model come out of bitmaps.tbl
8710  *
8711  * Revision 1.61  1994/12/06  12:06:22  matt
8712  * Fixed/cleaned up satellite (planet/sun) code
8713  *
8714  * Revision 1.60  1994/12/05  13:37:12  adam
8715  * removed slew-mode
8716  *
8717  * Revision 1.59  1994/12/05  12:49:37  matt
8718  * Made satellite a rod (instead of a plane old non-rotating bitmap), and
8719  * made the size settable in the .end file
8720  *
8721  * Revision 1.58  1994/12/04  21:40:00  matt
8722  * Added explosion sounds
8723  *
8724  * Revision 1.57  1994/12/04  18:31:41  matt
8725  * Wasn't coding planet position, causing it to disappear sometimes
8726  *
8727  * Revision 1.56  1994/12/04  14:30:26  john
8728  * Added hooks for music..
8729  *
8730  * Revision 1.55  1994/12/04  13:53:52  matt
8731  * Added code to make camera off-centered during lookback
8732  *
8733  * Revision 1.54  1994/12/04  12:30:18  matt
8734  * Fixed slew for short sequence
8735  *
8736  * Revision 1.53  1994/12/03  19:28:10  matt
8737  * Added alternate model for exit model after mine destruction
8738  *
8739  * Revision 1.52  1994/12/03  00:17:23  matt
8740  * Made endlevel sequence cut off early
8741  * Made exit model and bit explosion always plot last (after all terrain)
8742  *
8743  * Revision 1.51  1994/12/01  20:15:43  yuan
8744  * Localization.
8745  *
8746  * Revision 1.50  1994/11/30  23:27:35  adam
8747  * mucked around carelessly
8748  *
8749  * Revision 1.49  1994/11/28  21:50:37  mike
8750  * optimizations.
8751  *
8752  * Revision 1.48  1994/11/28  00:12:05  allender
8753  * took out demo code that was in at one time to record endlevel sequence.
8754  * We are _not_ recording endlevel sequence
8755  *
8756  * Revision 1.47  1994/11/27  23:35:54  allender
8757  * pause demo recording when starting endlevel sequence.  on demo playback,
8758  * don't do endlevel at all.
8759  *
8760  * Revision 1.46  1994/11/27  23:13:59  matt
8761  * Made changes for new mprintf calling convention
8762  *
8763  * Revision 1.45  1994/11/26  23:17:29  matt
8764  * When camera leaves mine, bank it so it's level with the ground
8765  *
8766  * Revision 1.44  1994/11/23  16:52:13  rob
8767  * Ended netgame endlevel sequence a bit earlier.
8768  *
8769  * Revision 1.43  1994/11/22  19:20:46  rob
8770  * Modem support for secret levels.
8771  *
8772  * Revision 1.42  1994/11/22  12:11:03  rob
8773  * Fixed bug - file handle left open in load_endlevel_data.
8774  *
8775  * Revision 1.41  1994/11/21  17:29:22  matt
8776  * Cleaned up sequencing & game saving for secret levels
8777  *
8778  * Revision 1.40  1994/11/19  15:14:54  mike
8779  * remove unused code and data
8780  *
8781  * Revision 1.39  1994/11/19  12:41:32  matt
8782  * Added system to read endlevel data from file, and to make it work
8783  * with any exit tunnel.
8784  *
8785  * Revision 1.38  1994/11/17  15:02:24  mike
8786  * support new segment validation functions.
8787  *
8788  * Revision 1.37  1994/11/17  13:04:45  allender
8789  * backout out newdemo changes
8790  *
8791  * Revision 1.35  1994/11/16  14:52:33  rob
8792  * Commented out SLEW_ON on Matt's direction.
8793  * Changed something to fix demo recording.
8794  *
8795  * Revision 1.34  1994/11/16  11:49:29  matt
8796  * Added code to rotate terrain to match mine
8797  *
8798  * Revision 1.33  1994/11/14  17:54:54  allender
8799  * on exit sequence during demo recording, force player exited from mine
8800  * packet to all other network players
8801  *
8802  * Revision 1.32  1994/11/10  21:27:42  matt
8803  * Took out printf's
8804  *
8805  * Revision 1.31  1994/11/10  14:02:24  matt
8806  * Hacked in support for player ships with different textures
8807  *
8808  * Revision 1.30  1994/11/09  10:31:33  matt
8809  * Don't create explosions if can't find seg to create them in
8810  *
8811  * Revision 1.29  1994/11/05  17:22:37  john
8812  * Fixed lots of sequencing problems with newdemo stuff.
8813  *
8814  * Revision 1.28  1994/11/03  11:10:39  matt
8815  * Fixed chase angles code
8816  * Maybe other things, too.
8817  *
8818  * Revision 1.27  1994/10/30  20:09:21  matt
8819  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
8820  * go out; made more explosions on walls.
8821  *
8822  * Revision 1.26  1994/10/28  16:37:50  allender
8823  * stop demo recording when endlevel sequence activated
8824  *
8825  * Revision 1.25  1994/10/27  21:15:21  matt
8826  * Added explosions in mine chasing player
8827  *
8828  * Revision 1.24  1994/10/27  01:03:57  matt
8829  * Fixed several small bugs in flythrough
8830  *
8831  * Revision 1.23  1994/10/22  01:32:30  matt
8832  * Don't start endlevel sequence if player dead
8833  *
8834  * Revision 1.22  1994/10/22  00:08:06  matt
8835  * Fixed up problems with bonus & game sequencing
8836  * Player doesn't get credit for hostages unless he gets them out alive
8837
8838 ------------------------------------------------------------------------
8839 main/endlevel.h:
8840
8841  * Revision 1.2  1995/09/14  16:36:34  allender
8842  * fixed function prototype for those functions that didn't
8843  * have them...thanks matt
8844  *
8845  * Revision 1.1  1995/05/16  15:56:16  allender
8846  * Initial revision
8847  *
8848  * Revision 2.0  1995/02/27  11:31:37  john
8849  * New version 2.0, which has no anonymous unions, builds with
8850  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8851  *
8852  * Revision 1.5  1994/12/06  13:24:55  matt
8853  * Made exit model come out of bitmaps.tbl
8854  *
8855  * Revision 1.4  1994/11/19  12:41:35  matt
8856  * Added system to read endlevel data from file, and to make it work
8857  * with any exit tunnel.
8858  *
8859  * Revision 1.3  1994/10/30  20:09:20  matt
8860  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
8861  * go out; made more explosions on walls.
8862  *
8863  * Revision 1.2  1994/08/19  20:09:38  matt
8864  * Added end-of-level cut scene with external scene
8865  *
8866  * Revision 1.1  1994/08/15  19:18:47  matt
8867  * Initial revision
8868
8869 ------------------------------------------------------------------------
8870 main/escort.c:
8871
8872  * Revision 1.1  1995/05/06  23:32:19  mike
8873  * Initial revision
8874
8875 ------------------------------------------------------------------------
8876 main/fireball.c:
8877
8878  * Revision 1.2  1995/10/31  10:23:56  allender
8879  * shareware stuff
8880  *
8881  * Revision 1.1  1995/05/16  15:24:41  allender
8882  * Initial revision
8883  *
8884  * Revision 2.2  1995/03/21  14:39:57  john
8885  * Ifdef'd out the NETWORK code.
8886  *
8887  * Revision 2.1  1995/03/20  18:15:47  john
8888  * Added code to not store the normals in the segment structure.
8889  *
8890  * Revision 2.0  1995/02/27  11:30:34  john
8891  * New version 2.0, which has no anonymous unions, builds with
8892  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8893  *
8894  * Revision 1.200  1995/02/22  13:18:41  allender
8895  * remove anonymous unions from object structure
8896  *
8897  * Revision 1.199  1995/02/14  19:58:32  mike
8898  * comment out "something bad has happened" int3.
8899  *
8900  * Revision 1.198  1995/02/09  13:11:01  mike
8901  * remove an annoying mprintf and Int3().
8902  *
8903  * Revision 1.197  1995/02/08  17:10:14  mike
8904  * don't drop cloaks if one nearby.
8905  *
8906  * Revision 1.196  1995/02/08  13:27:14  rob
8907  * Give keys dropped by robots 0 velocity in coop game.
8908  *
8909  * Revision 1.195  1995/02/08  11:57:40  mike
8910  * determine whether debris object failed to create because buffer was
8911  * exhausted or because limit was hit.
8912  *
8913  * Revision 1.194  1995/02/08  11:37:58  mike
8914  * Check for failures in call to obj_create.
8915  *
8916  * Revision 1.193  1995/02/07  21:09:41  mike
8917  * only replace weapon with energy 1/2 time.
8918  *
8919  * Revision 1.192  1995/01/30  18:21:52  rob
8920  * Replace extra life powerups in multiplayer to invul when
8921  * dropped by robots.
8922  *
8923  * Revision 1.191  1995/01/28  17:40:59  mike
8924  * fix stupidity in converting quad lasers to energy.
8925  *
8926  * Revision 1.190  1995/01/27  15:05:59  rob
8927  * Trying to fix a bug with damaging robots with player badass explosions.
8928  *
8929  * Revision 1.189  1995/01/26  18:59:04  rob
8930  * Powerups were flying too far in robot-cooperative games.
8931  *
8932  * Revision 1.188  1995/01/25  10:53:35  mike
8933  * make badass damage go through grates.
8934  *
8935  * Revision 1.187  1995/01/25  09:37:23  mike
8936  * fix objects containing robots, worked for powerups, bad {} placement.
8937  *
8938  * Revision 1.186  1995/01/23  22:51:20  mike
8939  * drop energy instead of primary weapon if you already have primary weapon.
8940  *
8941  * Revision 1.185  1995/01/20  16:56:37  mike
8942  * Cut damage done by badass weapons.
8943  *
8944  * Revision 1.184  1995/01/19  17:44:57  mike
8945  * damage_force removed, that information coming from strength field.
8946  *
8947  * Revision 1.183  1995/01/16  21:06:54  mike
8948  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
8949  *
8950  * Revision 1.182  1995/01/16  19:24:04  mike
8951  * If a gated-in robot and going to drop energy powerup, don't!
8952  *
8953  * Revision 1.181  1995/01/15  20:48:03  mike
8954  * drop energy in place of quad lasers if player already has quad lasers.
8955  *
8956  * Revision 1.180  1995/01/14  19:32:19  rob
8957  * Fixed an error.
8958  *
8959  * Revision 1.179  1995/01/14  18:50:55  rob
8960  * Make robot egg creation suitable for mutliplayer situations.
8961  *
8962  * Revision 1.178  1995/01/14  14:55:07  rob
8963  * Make weapons/keys/etc never disappear in network mode.
8964
8965 ------------------------------------------------------------------------
8966 main/fireball.h:
8967
8968  * Revision 1.1  1995/05/16  15:56:23  allender
8969  * Initial revision
8970  *
8971  * Revision 2.0  1995/02/27  11:27:03  john
8972  * New version 2.0, which has no anonymous unions, builds with
8973  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8974  *
8975  * Revision 1.13  1995/01/17  12:14:38  john
8976  * Made walls, object explosion vclips load at level start.
8977  *
8978  * Revision 1.12  1995/01/13  15:41:52  rob
8979  * Added prototype for maybe_replace_powerup_with_energy
8980  *
8981  * Revision 1.11  1994/11/17  16:28:36  rob
8982  * Changed maybe_drop_cloak_powerup to maybe_drop_net_powerup (more
8983  * generic and useful)
8984  *
8985  * Revision 1.10  1994/10/12  08:03:42  mike
8986  * Prototype maybe_drop_cloak_powerup.
8987  *
8988  * Revision 1.9  1994/10/11  12:24:39  matt
8989  * Cleaned up/change badass explosion calls
8990  *
8991  * Revision 1.8  1994/09/07  16:00:34  mike
8992  * Add object pointer to parameter list of object_create_badass_explosion.
8993  *
8994  * Revision 1.7  1994/09/02  14:00:39  matt
8995  * Simplified explode_object() & mutliple-stage explosions
8996  *
8997  * Revision 1.6  1994/08/17  16:49:58  john
8998  * Added damaging fireballs, missiles.
8999  *
9000  * Revision 1.5  1994/07/14  22:39:19  matt
9001  * Added exploding doors
9002  *
9003  * Revision 1.4  1994/06/08  10:56:36  matt
9004  * Improved debris: now get submodel size from new POF files; debris now has
9005  * limited life; debris can now be blown up.
9006  *
9007  * Revision 1.3  1994/04/01  13:35:44  matt
9008  * Added multiple-stage explosions
9009  *
9010  * Revision 1.2  1994/02/17  11:33:32  matt
9011  * Changes in object system
9012  *
9013  * Revision 1.1  1994/02/16  22:41:15  matt
9014  * Initial revision
9015
9016 ------------------------------------------------------------------------
9017 main/fuelcen.c:
9018
9019  * Revision 1.2  1995/10/31  10:23:40  allender
9020  * shareware stuff
9021  *
9022  * Revision 1.1  1995/05/16  15:24:50  allender
9023  * Initial revision
9024  *
9025  * Revision 2.3  1995/03/21  14:38:40  john
9026  * Ifdef'd out the NETWORK code.
9027  *
9028  * Revision 2.2  1995/03/06  15:23:09  john
9029  * New screen techniques.
9030  *
9031  * Revision 2.1  1995/02/27  13:13:26  john
9032  * Removed floating point.
9033  *
9034  * Revision 2.0  1995/02/27  11:27:20  john
9035  * New version 2.0, which has no anonymous unions, builds with
9036  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9037  *
9038  * Revision 1.159  1995/02/22  13:48:10  allender
9039  * remove anonymous unions in object structure
9040  *
9041  * Revision 1.158  1995/02/08  11:37:48  mike
9042  * Check for failures in call to obj_create.
9043  *
9044  * Revision 1.157  1995/02/07  20:39:39  mike
9045  * fix toasters in multiplayer
9046  *
9047  *
9048  * Revision 1.156  1995/02/02  18:40:10  john
9049  * Fixed bug with full screen cockpit flashing non-white.
9050  *
9051  * Revision 1.155  1995/01/28  15:27:22  yuan
9052  * Make sure fuelcen nums are valid.
9053  *
9054  * Revision 1.154  1995/01/03  14:26:23  rob
9055  * Better ifdef for robot centers.
9056  *
9057  * Revision 1.153  1995/01/03  11:27:49  rob
9058  * Added include of fuelcen.c
9059  *
9060  * Revision 1.152  1995/01/03  09:47:22  john
9061  * Some ifdef SHAREWARE lines.
9062  *
9063  * Revision 1.151  1995/01/02  21:02:07  rob
9064  * added matcen support for coop/multirobot.
9065  *
9066  * Revision 1.150  1994/12/15  18:31:22  mike
9067  * fix confusing precedence problems.
9068  *
9069  * Revision 1.149  1994/12/15  13:04:22  mike
9070  * Replace Players[Player_num].time_total references with GameTime.
9071  *
9072  * Revision 1.148  1994/12/15  03:05:18  matt
9073  * Added error checking for NULL return from object_create_explosion()
9074  *
9075  * Revision 1.147  1994/12/13  19:49:12  rob
9076  * Made the fuelcen noise quieter.
9077  *
9078  * Revision 1.146  1994/12/13  12:03:18  john
9079  * Made the warning sirens not start until after "desccruction
9080  * secquence activated voice".
9081  *
9082  * Revision 1.145  1994/12/12  17:18:30  mike
9083  * make warning siren louder.
9084  *
9085  * Revision 1.144  1994/12/11  23:18:04  john
9086  * Added -nomusic.
9087  * Added RealFrameTime.
9088  * Put in a pause when sound initialization error.
9089  * Made controlcen countdown and framerate use RealFrameTime.
9090  *
9091  * Revision 1.143  1994/12/11  14:10:16  mike
9092  * louder sounds.
9093  *
9094  * Revision 1.142  1994/12/06  11:33:19  yuan
9095  * Fixed bug with fueling when above 100.
9096  *
9097  * Revision 1.141  1994/12/05  23:37:14  matt
9098  * Took out calls to warning() function
9099  *
9100  * Revision 1.140  1994/12/05  23:19:18  yuan
9101  * Fixed fuel center refuelers..
9102  *
9103  * Revision 1.139  1994/12/03  12:48:12  mike
9104  * diminish rocking due to control center destruction.
9105  *
9106  * Revision 1.138  1994/12/02  23:30:32  mike
9107  * fix bumpiness after toasting control center.
9108  *
9109  * Revision 1.137  1994/12/02  22:48:14  mike
9110  * rock the ship after toasting the control center!
9111  *
9112  * Revision 1.136  1994/12/02  17:12:11  rob
9113  * Fixed countdown sounds.
9114  *
9115  * Revision 1.135  1994/11/29  20:59:43  rob
9116  * Don't run out of fuel in net games (don't want to sync it between machines)
9117  *
9118  * Revision 1.134  1994/11/29  19:10:57  john
9119  * Took out debugging mprintf.
9120  *
9121  * Revision 1.133  1994/11/29  13:19:40  john
9122  * Made voice for "destruction actived in t-"
9123  * be at 12.75 secs.
9124  *
9125  * Revision 1.132  1994/11/29  12:19:46  john
9126  * MAde the "Mine desctruction will commence"
9127  * voice play at 12.5 secs.
9128  *
9129  * Revision 1.131  1994/11/29  12:12:54  adam
9130  * *** empty log message ***
9131  *
9132  * Revision 1.130  1994/11/28  21:04:26  rob
9133  * Added code to cast noise when player refuels.
9134  *
9135  * Revision 1.129  1994/11/27  23:15:04  matt
9136  * Made changes for new mprintf calling convention
9137  *
9138  * Revision 1.128  1994/11/21  16:27:51  mike
9139  * debug code for morphing.
9140  *
9141  * Revision 1.127  1994/11/21  12:33:50  matt
9142  * For control center explosions, use small fireball, not pseudo-random vclip
9143  *
9144  * Revision 1.126  1994/11/20  22:12:15  mike
9145  * Fix bug in initializing materialization centers.
9146  *
9147  * Revision 1.125  1994/11/19  15:18:22  mike
9148  * rip out unused code and data.
9149  *
9150  * Revision 1.124  1994/11/08  12:18:59  mike
9151  * Initialize Fuelcen_seconds_left.
9152  *
9153  * Revision 1.123  1994/10/30  14:12:33  mike
9154  * rip out repair center stuff
9155  *
9156  * Revision 1.122  1994/10/28  14:42:45  john
9157  * Added sound volumes to all sound calls.
9158  *
9159  * Revision 1.121  1994/10/16  12:44:02  mike
9160  * Make time to exit mine after control center destruction diff level dependent.
9161  *
9162  * Revision 1.120  1994/10/09  22:03:26  mike
9163  * Adapt to new create_n_segment_path parameters.
9164  *
9165  * Revision 1.119  1994/10/06  14:52:42  mike
9166  * Remove last of ability to damage fuel centers.
9167  *
9168  * Revision 1.118  1994/10/06  14:08:45  matt
9169  * Made morph flash effect get orientation from segment
9170  *
9171  * Revision 1.117  1994/10/05  16:09:03  mike
9172  * Put debugging code into matcen/fuelcen synchronization problem.
9173  *
9174  * Revision 1.116  1994/10/04  15:32:41  john
9175  * Took out the old PLAY_SOUND??? code and replaced it
9176  * with direct calls into digi_link_??? so that all sounds
9177  * can be made 3d.
9178  *
9179  * Revision 1.115  1994/10/03  23:37:57  mike
9180  * Clean up this mess of confusion to the point where maybe matcens actually work.
9181  *
9182  * Revision 1.114  1994/10/03  13:34:40  matt
9183  * Added new (and hopefully better) game sequencing functions
9184  *
9185  * Revision 1.113  1994/09/30  14:41:57  matt
9186  * Fixed bug as per Mike's instructions
9187  *
9188  * Revision 1.112  1994/09/30  00:37:33  mike
9189  * Balance materialization centers.
9190  *
9191  * Revision 1.111  1994/09/28  23:12:52  matt
9192  * Macroized palette flash system
9193  *
9194  * Revision 1.110  1994/09/27  15:42:31  mike
9195  * Add names of Specials.
9196  *
9197  * Revision 1.109  1994/09/27  00:02:23  mike
9198  * Yet more materialization center stuff.
9199  *
9200  * Revision 1.108  1994/09/26  11:26:23  mike
9201  * Balance materialization centers.
9202  *
9203  * Revision 1.107  1994/09/25  23:40:47  matt
9204  * Changed the object load & save code to read/write the structure fields one
9205  * at a time (rather than the whole structure at once).  This mean that the
9206  * object structure can be changed without breaking the load/save functions.
9207  * As a result of this change, the local_object data can be and has been
9208  * incorporated into the object array.  Also, timeleft is now a property
9209  * of all objects, and the object structure has been otherwise cleaned up.
9210  *
9211  * Revision 1.106  1994/09/25  15:55:58  mike
9212  * Balance materialization centers, make them emit light, make them re-triggerable after awhile.
9213  *
9214  * Revision 1.105  1994/09/24  17:42:33  mike
9215  * Making materialization centers be activated by triggers and balancing them.
9216  *
9217  * Revision 1.104  1994/09/24  14:16:06  mike
9218  * Support new network constants.
9219  *
9220  * Revision 1.103  1994/09/20  19:14:40  john
9221  * Massaged the sound system; used a better formula for determining
9222  * which l/r balance, also, put in Mike's stuff that searches for a connection
9223  * between the 2 sounds' segments, stopping for closed doors, etc.
9224  *
9225  * Revision 1.102  1994/09/17  01:40:51  matt
9226  * Added status bar/sizable window mode, and in the process revamped the
9227  * whole cockpit mode system.
9228  *
9229  * Revision 1.101  1994/08/31  20:57:25  matt
9230  * Cleaned up endlevel/death code
9231  *
9232  * Revision 1.100  1994/08/30  17:54:20  mike
9233  * Slow down rate of creation of objects by materialization centers.
9234  *
9235  * Revision 1.99  1994/08/29  11:47:01  john
9236  * Added warning if no control centers in mine.
9237
9238 ------------------------------------------------------------------------
9239 main/fuelcen.h:
9240
9241  * Revision 1.1  1995/05/16  15:56:31  allender
9242  * Initial revision
9243  *
9244  * Revision 2.0  1995/02/27  11:28:43  john
9245  * New version 2.0, which has no anonymous unions, builds with
9246  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9247  *
9248  * Revision 1.26  1995/01/26  12:19:16  rob
9249  * Added externs of things needed for multiplayer.
9250  *
9251  * Revision 1.25  1994/10/30  14:11:10  mike
9252  * rip out repair center stuff.
9253  *
9254  * Revision 1.24  1994/10/03  23:36:36  mike
9255  * Add segnum and fuelcen_num (renaming dest_seg and *path) in matcen_info struct.
9256  *
9257  * Revision 1.23  1994/09/30  00:37:44  mike
9258  * Change FuelCenter struct.
9259  *
9260  * Revision 1.22  1994/09/27  15:42:49  mike
9261  * Kill some obsolete matcen constants, Prototype Special_names.
9262  *
9263  * Revision 1.21  1994/09/27  00:04:30  mike
9264  * Moved FuelCenter struct here from fuelcen.c
9265  *
9266  * Revision 1.20  1994/09/25  15:55:37  mike
9267  * Prototype function disable_matcens.
9268  *
9269  * Revision 1.19  1994/09/24  17:41:34  mike
9270  * Prototype trigger_matcen.
9271  *
9272  * Revision 1.18  1994/08/03  17:52:19  matt
9273  * Tidied up repair centers a bit
9274  *
9275  * Revision 1.17  1994/08/02  12:16:01  mike
9276  * *** empty log message ***
9277  *
9278  * Revision 1.16  1994/08/01  11:04:03  yuan
9279  * New materialization centers.
9280  *
9281  * Revision 1.15  1994/07/21  19:02:15  mike
9282  * break repair centers.
9283  *
9284  * Revision 1.14  1994/07/14  11:25:22  john
9285  * Made control centers destroy better; made automap use Tab key.
9286  *
9287  * Revision 1.13  1994/07/13  10:45:33  john
9288  * Made control center object switch when dead.
9289  *
9290  * Revision 1.12  1994/07/09  17:36:44  mike
9291  * Add extern for find_connected_repair_seg.
9292  *
9293  * Revision 1.11  1994/06/15  19:00:32  john
9294  * Show timer in on top of 3d with mine destroyed...
9295  *
9296  * Revision 1.10  1994/05/31  16:49:46  john
9297  * Begin to add robot materialization centers.
9298  *
9299  * Revision 1.9  1994/05/30  20:22:03  yuan
9300  * New triggers.
9301  *
9302  * Revision 1.8  1994/05/05  16:41:14  matt
9303  * Cleaned up repair center code, and moved some from object.c to fuelcen.c
9304  *
9305  * Revision 1.7  1994/04/21  20:41:21  yuan
9306  * Added extern.
9307  *
9308  * Revision 1.6  1994/04/21  20:28:32  john
9309  * Added flag for Yuan to tell when a fuel center is destroyed.
9310  *
9311  * Revision 1.5  1994/04/14  17:00:59  john
9312  * Made repair cen's work properly; added reset_all_fuelcens.
9313  *
9314  * Revision 1.4  1994/04/12  20:28:04  john
9315  * Added control center.
9316  *
9317  * Revision 1.3  1994/04/08  15:37:10  john
9318  * Added repair centers.
9319  *
9320  * Revision 1.2  1994/04/06  19:10:38  john
9321  * NEw version.
9322  *
9323  *
9324  * Revision 1.1  1994/04/06  12:39:02  john
9325  * Initial revision
9326
9327 ------------------------------------------------------------------------
9328 main/fvi.c:
9329
9330  * Revision 1.7  1995/10/21  23:52:18  allender
9331  * #ifdef'ed out stack debug stuff
9332  *
9333  * Revision 1.6  1995/10/10  12:07:42  allender
9334  * add forgotten ;
9335  *
9336  * Revision 1.5  1995/10/10  11:47:27  allender
9337  * put in stack space check
9338  *
9339  * Revision 1.4  1995/08/23  21:34:08  allender
9340  * fix mcc compiler warning
9341  *
9342  * Revision 1.3  1995/08/14  14:35:18  allender
9343  * changed transparency to 0
9344  *
9345  * Revision 1.2  1995/07/05  16:50:51  allender
9346  * transparency/kitchen change
9347  *
9348  * Revision 1.1  1995/05/16  15:24:59  allender
9349  * Initial revision
9350  *
9351  * Revision 2.3  1995/03/24  14:49:04  john
9352  * Added cheat for player to go thru walls.
9353  *
9354  * Revision 2.2  1995/03/21  17:58:32  john
9355  * Fixed bug with normals..
9356  *
9357  *
9358  * Revision 2.1  1995/03/20  18:15:37  john
9359  * Added code to not store the normals in the segment structure.
9360  *
9361  * Revision 2.0  1995/02/27  11:27:41  john
9362  * New version 2.0, which has no anonymous unions, builds with
9363  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9364  *
9365  * Revision 1.49  1995/02/22  14:45:47  allender
9366  * remove anonymous unions from object structure
9367  *
9368  * Revision 1.48  1995/02/22  13:24:50  john
9369  * Removed the vecmat anonymous unions.
9370  *
9371  * Revision 1.47  1995/02/07  16:17:26  matt
9372  * Disabled all robot-robot collisions except those involving two green
9373  * guys.  Used to do collisions if either robot was green guy.
9374  *
9375  * Revision 1.46  1995/02/02  14:07:53  matt
9376  * Fixed confusion about which segment you are touching when you're
9377  * touching a wall.  This manifested itself in spurious lava burns.
9378  *
9379  * Revision 1.45  1995/02/02  13:45:53  matt
9380  * Made a bunch of lint-inspired changes
9381  *
9382  * Revision 1.44  1995/01/24  12:10:17  matt
9383  * Fudged collisions for player/player, and player weapon/other player in
9384  * coop games.
9385  *
9386  * Revision 1.43  1995/01/14  19:16:45  john
9387  * First version of new bitmap paging code.
9388  *
9389  * Revision 1.42  1994/12/15  12:22:40  matt
9390  * Small change which may or may not help
9391  *
9392  * Revision 1.41  1994/12/14  11:45:51  matt
9393  * Fixed (hopefully) little bug with invalid segnum
9394  *
9395  * Revision 1.40  1994/12/13  17:12:01  matt
9396  * Increased edge tolerance a bunch more
9397  *
9398  * Revision 1.39  1994/12/13  14:37:59  matt
9399  * Fixed another stupid little bug
9400  *
9401  * Revision 1.38  1994/12/13  13:25:44  matt
9402  * Increased tolerance massively to avoid catching on corners
9403  *
9404  * Revision 1.37  1994/12/13  12:02:20  matt
9405  * Fixed small bug
9406  *
9407  * Revision 1.36  1994/12/13  11:17:35  matt
9408  * Lots of changes to hopefully fix objects leaving the mine.  Note that
9409  * this code should be considered somewhat experimental - one problem I
9410  * know about is that you can get stuck on edges more easily than before.
9411  * There may be other problems I don't know about yet.
9412  *
9413  * Revision 1.35  1994/12/12  01:20:57  matt
9414  * Added hack in object-object collisions that treats claw guys as
9415  * if they have 3/4 of their actual radius.
9416  *
9417  * Revision 1.34  1994/12/04  22:48:39  matt
9418  * Physics & FVI now only build seglist for player objects, and they
9419  * responsilby deal with buffer full conditions
9420  *
9421  * Revision 1.33  1994/12/04  22:07:05  matt
9422  * Added better handing of buffer full condition
9423  *
9424  * Revision 1.32  1994/12/01  21:06:33  matt
9425  * Several important changes:
9426  *  (1) Checking against triangulated sides has been standardized a bit
9427  *  (2) Code has been added to de-triangulate some sides
9428  *  (3) BIG ONE: the tolerance for checking a point against a plane has
9429  *      been drastically relaxed
9430  *
9431  *
9432  * Revision 1.31  1994/11/27  23:15:03  matt
9433  * Made changes for new mprintf calling convention
9434  *
9435  * Revision 1.30  1994/11/19  15:20:30  mike
9436  * rip out unused code and data
9437  *
9438  * Revision 1.29  1994/11/16  12:18:17  mike
9439  * hack for green_guy:green_guy collision detection.
9440  *
9441  * Revision 1.28  1994/11/10  13:08:54  matt
9442  * Added support for new run-length-encoded bitmaps
9443  *
9444  * Revision 1.27  1994/10/31  12:27:51  matt
9445  * Added new function object_intersects_wall()
9446  *
9447  * Revision 1.26  1994/10/20  13:59:27  matt
9448  * Added assert
9449  *
9450  * Revision 1.25  1994/10/09  23:51:09  matt
9451  * Made find_hitpoint_uv() work with triangulated sides
9452  *
9453  * Revision 1.24  1994/09/25  00:39:29  matt
9454  * Took out mprintf's
9455  *
9456  * Revision 1.23  1994/09/25  00:37:53  matt
9457  * Made the 'find the point in the bitmap where something hit' system
9458  * publicly accessible.
9459  *
9460  * Revision 1.22  1994/09/21  16:58:22  matt
9461  * Fixed bug in trans wall check that was checking against verically
9462  * flipped bitmap (i.e., the y coord was negative when checking).
9463  *
9464  * Revision 1.21  1994/09/02  11:31:40  matt
9465  * Fixed object/object collisions, so you can't fly through robots anymore.
9466  * Cleaned up object damage system.
9467  *
9468  * Revision 1.20  1994/08/26  09:42:03  matt
9469  * Increased the size of a buffer
9470  *
9471  * Revision 1.19  1994/08/11  18:57:53  mike
9472  * Convert shorts to ints for optimization.
9473  *
9474  * Revision 1.18  1994/08/08  21:38:24  matt
9475  * Put in small optimization
9476  *
9477  * Revision 1.17  1994/08/08  12:21:52  yuan
9478  * Fixed assert
9479  *
9480  * Revision 1.16  1994/08/08  11:47:04  matt
9481  * Cleaned up fvi and physics a little
9482  *
9483  * Revision 1.15  1994/08/04  00:21:04  matt
9484  * Cleaned up fvi & physics error handling; put in code to make sure objects
9485  * are in correct segment; simplified segment finding for objects and points
9486  *
9487  * Revision 1.14  1994/08/02  19:04:26  matt
9488  * Cleaned up vertex list functions
9489  *
9490  * Revision 1.13  1994/08/02  09:56:28  matt
9491  * Put in check for bad value find_plane_line_intersection()
9492  *
9493  * Revision 1.12  1994/08/01  17:27:26  matt
9494  * Added support for triangulated walls in trans point check
9495  *
9496  * Revision 1.11  1994/08/01  13:30:40  matt
9497  * Made fvi() check holes in transparent walls, and changed fvi() calling
9498  * parms to take all input data in query structure.
9499  *
9500  * Revision 1.10  1994/07/13  21:47:17  matt
9501  * FVI() and physics now keep lists of segments passed through which the
9502  * trigger code uses.
9503  *
9504  * Revision 1.9  1994/07/09  21:21:40  matt
9505  * Fixed, hopefull, bugs in sphere-to-vector intersection code
9506  *
9507  * Revision 1.8  1994/07/08  14:26:42  matt
9508  * Non-needed powerups don't get picked up now; this required changing FVI to
9509  * take a list of ingore objects rather than just one ignore object.
9510  *
9511  * Revision 1.7  1994/07/06  20:02:37  matt
9512  * Made change to match gameseg that uses lowest point number as reference
9513  * point when checking against a plane
9514  *
9515  * Revision 1.6  1994/06/29  15:43:58  matt
9516  * When computing intersection of vector and sphere, use the radii of both
9517  * objects.
9518  *
9519  * Revision 1.5  1994/06/14  15:57:58  matt
9520  * Took out asserts, and added other hacks, pending real bug fixes
9521  *
9522  * Revision 1.4  1994/06/13  23:10:08  matt
9523  * Fixed problems with triangulated sides
9524  *
9525  * Revision 1.3  1994/06/09  12:11:14  matt
9526  * Fixed confusing use of two variables, hit_objnum & fvi_hit_object, to
9527  * keep the same information in different ways.
9528  *
9529  * Revision 1.2  1994/06/09  09:58:38  matt
9530  * Moved find_vector_intersection() from physics.c to new file fvi.c
9531  *
9532  * Revision 1.1  1994/06/09  09:25:57  matt
9533  * Initial revision
9534
9535 ------------------------------------------------------------------------
9536 main/fvi.h:
9537
9538  * Revision 1.2  1995/08/23  21:34:29  allender
9539  * fix mcc compiler warning
9540  *
9541  * Revision 1.1  1995/05/16  15:56:38  allender
9542  * Initial revision
9543  *
9544  * Revision 2.1  1995/03/20  18:15:58  john
9545  * Added code to not store the normals in the segment structure.
9546  *
9547  * Revision 2.0  1995/02/27  11:32:02  john
9548  * New version 2.0, which has no anonymous unions, builds with
9549  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9550  *
9551  * Revision 1.10  1995/02/02  14:07:58  matt
9552  * Fixed confusion about which segment you are touching when you're
9553  * touching a wall.  This manifested itself in spurious lava burns.
9554  *
9555  * Revision 1.9  1994/12/04  22:48:04  matt
9556  * Physics & FVI now only build seglist for player objects, and they
9557  * responsilby deal with buffer full conditions
9558  *
9559  * Revision 1.8  1994/10/31  12:28:01  matt
9560  * Added new function object_intersects_wall()
9561  *
9562  * Revision 1.7  1994/10/10  13:10:00  matt
9563  * Increased max_fvi_segs
9564  *
9565  * Revision 1.6  1994/09/25  00:38:29  matt
9566  * Made the 'find the point in the bitmap where something hit' system
9567  * publicly accessible.
9568  *
9569  * Revision 1.5  1994/08/01  13:30:35  matt
9570  * Made fvi() check holes in transparent walls, and changed fvi() calling
9571  * parms to take all input data in query structure.
9572  *
9573  * Revision 1.4  1994/07/13  21:47:59  matt
9574  * FVI() and physics now keep lists of segments passed through which the
9575  * trigger code uses.
9576  *
9577  * Revision 1.3  1994/07/08  14:27:26  matt
9578  * Non-needed powerups don't get picked up now; this required changing FVI to
9579  * take a list of ingore objects rather than just one ignore object.
9580  *
9581  * Revision 1.2  1994/06/09  09:58:39  matt
9582  * Moved find_vector_intersection() from physics.c to new file fvi.c
9583  *
9584  * Revision 1.1  1994/06/09  09:26:14  matt
9585  * Initial revision
9586
9587 ------------------------------------------------------------------------
9588 main/game.c:
9589
9590  * Revision 1.1  1995/12/05  16:01:09  allender
9591  * Initial revision
9592  *
9593  * Revision 1.38  1995/11/13  13:02:35  allender
9594  * put up HUD message when player starts tournament
9595  *
9596  * Revision 1.37  1995/11/13  09:21:05  allender
9597  * ved and shorted tournament mode messages
9598  *
9599  * Revision 1.36  1995/11/09  17:27:00  allender
9600  * took out cheats during demo playback
9601  *
9602  * Revision 1.35  1995/11/07  17:05:41  allender
9603  * move registered cheats
9604  *
9605  * Revision 1.34  1995/11/03  12:55:45  allender
9606  * shareware changes
9607  *
9608  * Revision 1.33  1995/10/29  20:15:00  allender
9609  * took out frame rate cheat.  Pause for at least a second because
9610  * of cmd-P problem
9611  *
9612  * Revision 1.32  1995/10/26  14:11:26  allender
9613  * fix up message box stuff to align correctly
9614  *
9615  * Revision 1.31  1995/10/24  18:09:41  allender
9616  * ixed cockpit weirdness -- don't update cockpit when do_appl_quit
9617  * is called -- screen saved in mevent.c
9618  *
9619  * Revision 1.30  1995/10/21  23:39:10  allender
9620  * ruise marking indicator
9621  *
9622  * Revision 1.29  1995/10/21  22:52:27  allender
9623  * bald guy cheat -- print screen stuff
9624  *
9625  * Revision 1.28  1995/10/20  00:54:28  allender
9626  * new help menus and redbook checking in outer game loop
9627  *
9628  * Revision 1.27  1995/10/17  15:34:19  allender
9629  * pixel double is now default mode
9630  *
9631  * Revision 1.26  1995/10/12  17:34:44  allender
9632  * bigger message box -- command key equivs for function keys
9633  *
9634  * Revision 1.25  1995/10/11  12:17:14  allender
9635  * removed event loop processing
9636  *
9637  * Revision 1.24  1995/10/11  00:58:47  allender
9638  * removed debugging code
9639  *
9640  * Revision 1.23  1995/10/10  11:50:32  allender
9641  * fixed boxed message to align on 8 byte boundry,
9642  * and some debug code
9643  *
9644  * Revision 1.22  1995/09/24  10:51:26  allender
9645  * cannot go to finder in network..added cmd-q for quit
9646  *
9647  * Revision 1.21  1995/09/22  15:05:18  allender
9648  * *more* hud and font type stuff (messages)
9649  *
9650  * Revision 1.20  1995/09/22  14:39:57  allender
9651  * ved framerate counter up
9652  *
9653  * Revision 1.19  1995/09/18  17:01:28  allender
9654  * start of compatibility stuff
9655  *
9656  * Revision 1.18  1995/09/15  15:53:13  allender
9657  * better handling of PICT screen shots
9658  *
9659  * Revision 1.17  1995/09/14  15:27:41  allender
9660  * fixed function type on message_box routiens
9661  *
9662  * Revision 1.16  1995/09/13  11:37:47  allender
9663  * put in call to dump PICT file instead of PCX
9664  *
9665  * Revision 1.15  1995/09/08  17:13:28  allender
9666  * put back in ibitblt.h and start of PICT picture dump
9667  *
9668  * Revision 1.14  1995/09/07  10:20:58  allender
9669  * make cockpit mode default
9670  *
9671  * Revision 1.13  1995/09/07  10:17:34  allender
9672  * added command key equivalents for function keys
9673  *
9674  * Revision 1.12  1995/09/04  11:36:47  allender
9675  * fixed pixel double mode to have correct number of rendered
9676  * lines
9677  *
9678  * Revision 1.11  1995/09/01  15:47:07  allender
9679  * cap frame rate at 60 fps
9680  *
9681  * Revision 1.10  1995/08/26  16:25:59  allender
9682  * whole buncha' stuff!!!!
9683  *
9684  * Revision 1.9  1995/08/01  16:04:47  allender
9685  * put in ctrl_esc sequence to go to menubar
9686  *
9687  * Revision 1.8  1995/07/28  14:15:11  allender
9688  * added FRAME cheat to display frame rate
9689  *
9690  * Revision 1.7  1995/07/17  08:54:19  allender
9691  * *** empty log message ***
9692  *
9693  * Revision 1.6  1995/07/12  12:54:06  allender
9694  * removed some debug keys
9695  *
9696  * Revision 1.5  1995/07/05  16:44:35  allender
9697  * changed some debug keys
9698  *
9699  * Revision 1.4  1995/06/23  10:24:57  allender
9700  * added scanline doubling routine
9701  *
9702  * Revision 1.3  1995/06/13  13:08:26  allender
9703  * added special debug key to move window into upper left corner.
9704  * also added debug key to put game in 640x480 mode
9705  *
9706  * Revision 1.2  1995/06/12  11:10:31  allender
9707  * added DEL_SHIFT_M to move window to corner of screen
9708  *
9709  * Revision 1.1  1995/05/16  15:25:08  allender
9710  * Initial revision
9711  *
9712  * Revision 2.36  1996/01/05  16:52:05  john
9713  * Improved 3d stuff.
9714  *
9715  * Revision 2.35  1995/10/09  22:17:10  john
9716  * Took out the page flipping in set_screen_mode, which shouldn't
9717  * be there.  This was hosing the modex stuff.
9718  *
9719  * Revision 2.34  1995/10/09  19:46:34  john
9720  * Fixed bug with modex paging with lcdbios.
9721  *
9722  * Revision 2.33  1995/10/08  11:46:09  john
9723  * Fixed bug with 2d offset in interlaced mode in low res.
9724  * Made LCDBIOS with pageflipping using VESA set start
9725  * Address function.  X=CRTC offset, Y=0.
9726  *
9727  * Revision 2.32  1995/10/07  13:20:51  john
9728  * Added new modes for LCDBIOS, also added support for -JoyNice,
9729  * and added Shift+F1-F4 to controls various stereoscopic params.
9730  *
9731  * Revision 2.31  1995/05/31  14:34:43  unknown
9732  * fixed warnings.
9733  *
9734  * Revision 2.30  1995/05/08  11:23:45  john
9735  * Made 3dmax work like Kasan wants it to.
9736  *
9737  * Revision 2.29  1995/04/06  13:47:39  yuan
9738  * Restored rear view to original.
9739  *
9740  * Revision 2.28  1995/04/06  12:13:07  john
9741  * Fixed some bugs with 3dmax.
9742  *
9743  * Revision 2.27  1995/04/05  13:18:18  mike
9744  * decrease energy usage on fusion cannon
9745  *
9746  * Revision 2.26  1995/03/30  16:36:32  mike
9747  * text localization.
9748  *
9749  * Revision 2.25  1995/03/27  16:45:26  john
9750  * Fixed some cheat bugs.  Added astral cheat.
9751  *
9752  * Revision 2.24  1995/03/27  15:37:11  mike
9753  * boost fusion cannon for non-multiplayer modes.
9754  *
9755  * Revision 2.23  1995/03/24  17:48:04  john
9756  * Fixed bug with menus and 320x100.
9757  *
9758  * Revision 2.22  1995/03/24  15:34:02  mike
9759  * cheats.
9760  *
9761  * Revision 2.21  1995/03/24  13:11:39  john
9762  * Added save game during briefing screens.
9763  *
9764  * Revision 2.20  1995/03/21  14:40:50  john
9765  * Ifdef'd out the NETWORK code.
9766  *
9767  * Revision 2.19  1995/03/16  22:07:16  john
9768  * Made so only for screen can be used for anything other
9769  * than mode 13.
9770  *
9771  * Revision 2.18  1995/03/16  21:45:35  john
9772  * Made all paged modes have incompatible menus!
9773  *
9774  * Revision 2.17  1995/03/16  18:30:35  john
9775  * Made wider than 320 screens not have
9776  * a status bar mode.
9777  *
9778  * Revision 2.16  1995/03/16  10:53:34  john
9779  * Move VFX center to Shift+Z instead of Enter because
9780  * it conflicted with toggling HUD on/off.
9781  *
9782  * Revision 2.15  1995/03/16  10:18:33  john
9783  * Fixed bug with VFX mode not working. also made warning
9784  * when it can't set VESA mode.
9785  *
9786  * Revision 2.14  1995/03/14  16:22:39  john
9787  * Added cdrom alternate directory stuff.
9788  *
9789  * Revision 2.13  1995/03/14  12:14:17  john
9790  * Made VR helmets have 4 resolutions to choose from.
9791  *
9792  * Revision 2.12  1995/03/10  13:47:33  john
9793  * Added head tracking sensitivity.
9794  *
9795  * Revision 2.11  1995/03/10  13:13:47  john
9796  * Added code to show T-xx on iglasses.
9797  *
9798  * Revision 2.10  1995/03/09  18:07:29  john
9799  * Fixed bug with iglasses tracking not "centering" right.
9800  * Made VFX have bright headlight lighting.
9801  *
9802  * Revision 2.9  1995/03/09  11:48:02  john
9803  * Added HUD for VR helmets.
9804  *
9805  * Revision 2.8  1995/03/07  15:12:53  john
9806  * Fixed VFX,3dmax support.
9807  *
9808  * Revision 2.7  1995/03/07  11:35:03  john
9809  * Fixed bug with cockpit in rear view.
9810  *
9811  * Revision 2.6  1995/03/06  18:40:17  john
9812  * Added some ifdef EDITOR stuff.
9813  *
9814  * Revision 2.5  1995/03/06  18:31:21  john
9815  * Fixed bug with nmenu popping up on editor screen.
9816  *
9817  * Revision 2.4  1995/03/06  17:28:33  john
9818  * Fixed but with cockpit toggling wrong.
9819  *
9820  * Revision 2.3  1995/03/06  16:08:10  mike
9821  * Fix compile errors if building without editor.
9822  *
9823  * Revision 2.2  1995/03/06  15:24:10  john
9824  * New screen techniques.
9825  *
9826  * Revision 2.1  1995/02/27  13:41:03  john
9827  * Removed floating point from frame rate calculations.
9828  *
9829  * Revision 2.0  1995/02/27  11:31:54  john
9830  * New version 2.0, which has no anonymous unions, builds with
9831  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9832  *
9833  * Revision 1.770  1995/02/22  12:45:15  allender
9834  * remove anonymous unions from object structure
9835  *
9836  * Revision 1.769  1995/02/15  10:06:25  allender
9837  * make pause pause game during demo playback
9838  *
9839  * Revision 1.768  1995/02/13  20:35:11  john
9840  * Lintized
9841  *
9842  * Revision 1.767  1995/02/13  19:40:29  allender
9843  * added place to demo record restoration from rear view in place that
9844  * I forgot before
9845  *
9846  * Revision 1.766  1995/02/13  10:29:27  john
9847  * Fixed bug with cheats not restoreing across save games.
9848  *
9849  * Revision 1.765  1995/02/11  22:54:33  john
9850  * Made loading for pig not show up for demos.
9851  *
9852  * Revision 1.764  1995/02/11  17:30:08  allender
9853  * ifndef NDEBUG around strip frame stuff
9854  *
9855  * Revision 1.763  1995/02/11  17:13:01  rob
9856  * Took out modem.c code fille stuff.
9857  *
9858  * Revision 1.762  1995/02/11  16:36:47  allender
9859  * debug key to strip frames from end of demo
9860  *
9861  * Revision 1.761  1995/02/11  14:29:16  john
9862  * Turned off cheats when going into game.
9863  *
9864  * Revision 1.760  1995/02/11  13:46:54  mike
9865  * fix cheats.
9866  *
9867  * Revision 1.759  1995/02/11  12:36:09  matt
9868  * Cleaned up cheats
9869  *
9870  * Revision 1.758  1995/02/11  12:27:04  mike
9871  * fix path-to-exit cheat.
9872  *
9873  * Revision 1.757  1995/02/11  01:56:24  mike
9874  * robots don't fire cheat.
9875  *
9876  * Revision 1.756  1995/02/10  16:38:40  mike
9877  * illuminate path to exit cheat.
9878  *
9879  * Revision 1.755  1995/02/10  16:19:40  mike
9880  * new show-path-to-exit system, still buggy, compiled out.
9881  *
9882  * Revision 1.754  1995/02/10  15:54:46  matt
9883  * Added new cheats
9884  *
9885  * Revision 1.753  1995/02/09  12:25:42  matt
9886  * Made mem_fill() test routines not be called if RELEASE
9887  *
9888  * Revision 1.752  1995/02/09  08:49:32  mike
9889  * change fill opcode value to 0xcc, int 3 value.
9890  *
9891  *
9892  * Revision 1.751  1995/02/09  02:59:26  mike
9893  * check code for 00066xxx bugs.
9894  *
9895  * Revision 1.750  1995/02/08  17:10:02  mike
9896  * add, but don't call, debug code.
9897  *
9898  * Revision 1.749  1995/02/07  11:07:27  john
9899  * Added hooks for confirm on game state restore.
9900  *
9901  * Revision 1.748  1995/02/06  15:52:45  mike
9902  * add mini megawow powerup for giving reasonable weapons.
9903  *
9904  * Revision 1.747  1995/02/06  12:53:35  allender
9905  * force endlevel_sequence to 0 to fix weird bug
9906  *
9907  * Revision 1.746  1995/02/04  10:03:30  mike
9908  * Fly to exit cheat.
9909  *
9910  * Revision 1.745  1995/02/02  15:57:52  john
9911  * Added turbo mode cheat.
9912  *
9913  * Revision 1.744  1995/02/02  14:43:39  john
9914  * Uppped frametime limit to 150 Hz.
9915  *
9916  * Revision 1.743  1995/02/02  13:37:16  mike
9917  * move T-?? message down in certain modes.
9918  *
9919  * Revision 1.742  1995/02/02  01:26:59  john
9920  * Took out no key repeating.
9921  *
9922  * Revision 1.741  1995/01/29  21:36:44  mike
9923  * make fusion cannon not make pitching slow.
9924  *
9925  * Revision 1.740  1995/01/28  15:57:57  john
9926  * Made joystick calibration be only when wrong detected in
9927  * menu or joystick axis changed.
9928  *
9929  * Revision 1.739  1995/01/28  15:21:03  yuan
9930  * Added X-tra life cheat.
9931  *
9932  * Revision 1.738  1995/01/27  14:08:31  rob
9933  * Fixed a bug.
9934  *
9935  * Revision 1.737  1995/01/27  14:04:59  rob
9936  * Its not my fault, Mark told me to do it!
9937  *
9938  * Revision 1.736  1995/01/27  13:12:18  rob
9939  * Added charging noises to play across net.
9940  *
9941  * Revision 1.735  1995/01/27  11:48:28  allender
9942  * check for newdemo_state to be paused and stop recording.  We might be
9943  * in between levels
9944  *
9945  * Revision 1.734  1995/01/26  22:11:41  mike
9946  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
9947  *
9948  * Revision 1.733  1995/01/26  17:03:04  mike
9949  * make fusion cannon have more chrome, make fusion, mega rock you!
9950  *
9951  * Revision 1.732  1995/01/25  14:37:25  john
9952  * Made joystick only prompt for calibration once...
9953  *
9954  * Revision 1.731  1995/01/24  15:49:14  john
9955  * Made typeing in long net messages wrap on
9956  * small screen sizes.
9957  *
9958  * Revision 1.730  1995/01/24  15:23:42  mike
9959  * network message tweaking.
9960  *
9961  * Revision 1.729  1995/01/24  12:00:47  john
9962  * Fixed bug with defing macro passing keys to controls.
9963  *
9964  * Revision 1.728  1995/01/24  11:53:35  john
9965  * Added better macro defining code.
9966  *
9967  * Revision 1.727  1995/01/23  22:17:15  john
9968  * Fixed bug with not clearing key buffer when leaving f8.
9969  *
9970  * Revision 1.726  1995/01/23  22:07:09  john
9971  * Added flush to game inputs during F8.
9972
9973 ------------------------------------------------------------------------
9974 main/game.h:
9975
9976  * Revision 1.3  1995/09/14  13:44:34  allender
9977  * fixed function prototypes to have void return value to satify
9978  * moto compiler
9979  *
9980  * Revision 1.2  1995/08/17  09:25:05  allender
9981  * externed Scanline_double variable
9982  *
9983  * Revision 1.1  1995/05/16  15:56:46  allender
9984  * Initial revision
9985  *
9986  * Revision 2.1  1995/03/06  15:23:22  john
9987  * New screen techniques.
9988  *
9989  * Revision 2.0  1995/02/27  11:28:21  john
9990  * New version 2.0, which has no anonymous unions, builds with
9991  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9992  *
9993  * Revision 1.79  1995/02/13  10:37:17  john
9994  * Saved Buggin' cheat mode to save file.
9995  *
9996  * Revision 1.78  1995/02/01  16:34:12  john
9997  * Linted.
9998  *
9999  * Revision 1.77  1995/01/29  21:37:14  mike
10000  * initialize variables on game load so you don't drain your energy when you fire.
10001  *
10002  * Revision 1.76  1995/01/26  22:11:36  mike
10003  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
10004  *
10005  * Revision 1.75  1995/01/26  16:45:31  mike
10006  * Add autofire fusion cannon stuff.
10007  *
10008  * Revision 1.74  1994/12/11  23:18:06  john
10009  * Added -nomusic.
10010  * Added RealFrameTime.
10011  * Put in a pause when sound initialization error.
10012  * Made controlcen countdown and framerate use RealFrameTime.
10013  *
10014  * Revision 1.73  1994/12/09  00:41:24  mike
10015  * fix hang in automap print screen
10016  *
10017  * Revision 1.72  1994/12/04  13:47:00  mike
10018  * enhance custom detail level support.
10019  *
10020  * Revision 1.71  1994/12/02  15:05:44  matt
10021  * Added new "official" cheats
10022  *
10023  * Revision 1.70  1994/11/28  18:14:09  rob
10024  * Added game_mode flag for team games.
10025  *
10026  * Revision 1.69  1994/11/15  16:51:13  matt
10027  * Made rear view only switch to rear cockpit if cockpit on in front view
10028  *
10029  * Revision 1.68  1994/11/04  16:26:10  john
10030  * Fixed bug with letterbox mode game after you finish a game.
10031  *
10032  * Revision 1.67  1994/11/02  11:59:48  john
10033  * Moved menu out of game into inferno main loop.
10034  *
10035  * Revision 1.66  1994/10/26  23:02:19  matt
10036  * Made palette flash saturate negative values
10037  *
10038  * Revision 1.65  1994/10/26  15:21:05  mike
10039  * Detail level stuff.  Make Render_depth public.
10040  *
10041  * Revision 1.64  1994/10/19  00:13:01  matt
10042  * Added prototypes
10043  *
10044  * Revision 1.63  1994/10/09  14:54:39  matt
10045  * Made player cockpit state & window size save/restore with saved games & automap
10046  *
10047  * Revision 1.62  1994/10/08  19:56:32  matt
10048  * Added prototype
10049  *
10050  * Revision 1.61  1994/10/07  22:19:32  mike
10051  * Increase number of difficulty levels from 4 to 5.
10052  *
10053  * Revision 1.60  1994/10/06  14:14:11  matt
10054  * Added new function to reset time (to prevent big FrameTime) at start of level
10055  *
10056  * Revision 1.59  1994/10/05  17:08:43  matt
10057  * Changed order of cockpit bitmaps, since there's no longer a full-screen cockpit
10058  *
10059  * Revision 1.58  1994/10/03  23:44:13  matt
10060  * Save & restore palette effect around menus & pause message
10061  *
10062  * Revision 1.57  1994/09/29  17:42:12  matt
10063  * Cleaned up game_mode a little
10064  *
10065  * Revision 1.56  1994/09/28  23:12:01  matt
10066  * Macroized palette flash system
10067  *
10068  * Revision 1.55  1994/09/24  16:56:13  rob
10069  * Added new fields for the Game_mode bitvector for modem play.
10070  *
10071  * Revision 1.54  1994/09/24  14:16:20  mike
10072  * Added new game mode constants.
10073  *
10074  * Revision 1.53  1994/09/22  19:00:57  mike
10075  * Move NDL from robot.h to here.
10076  *
10077  * Revision 1.52  1994/09/22  10:46:51  mike
10078  * Add difficulty levels.
10079  *
10080  * Revision 1.51  1994/09/17  01:39:52  matt
10081  * Added status bar/sizable window mode, and in the process revamped the
10082  * whole cockpit mode system.
10083  *
10084  * Revision 1.50  1994/09/15  21:23:10  matt
10085  * Changed system to keep track of whether & what cockpit is up
10086  *
10087  * Revision 1.49  1994/09/15  16:11:33  john
10088  * Added support for VFX1 head tracking. Fixed bug with memory over-
10089  * write when using stereo mode.
10090  *
10091  * Revision 1.48  1994/09/13  16:40:10  mike
10092  * Prototype Global_missile_firing_count.
10093  *
10094  * Revision 1.47  1994/09/13  11:19:05  mike
10095  * Add Next_missile_fire_time.
10096  *
10097  * Revision 1.46  1994/09/12  09:52:50  john
10098  * Made global flush function that flushes keyboard,mouse, and joystick.
10099  *
10100  * Revision 1.45  1994/09/03  15:24:14  mike
10101  * Make global Global_laser_firing_count.
10102  *
10103  * Revision 1.44  1994/08/31  19:26:57  mike
10104  * Prototypes for Next_laser_fire_time, Laser_delay_time.
10105  *
10106  * Revision 1.43  1994/08/18  10:47:22  john
10107  * Cleaned up game sequencing and player death stuff
10108  * in preparation for making the player explode into
10109  * pieces when dead.
10110  *
10111  * Revision 1.42  1994/08/11  18:03:53  matt
10112  * Added prototype
10113  *
10114  * Revision 1.41  1994/06/29  20:41:38  matt
10115  * Added new pause mode; cleaned up countdown & game startup code
10116  *
10117  * Revision 1.40  1994/06/24  17:03:49  john
10118  * Added VFX support. Also took all game sequencing stuff like
10119  * EndGame out and put it into gameseq.c
10120  *
10121  * Revision 1.39  1994/06/20  15:01:08  yuan
10122  * Added death when mine blows up...
10123  * Continues onto next level.
10124  *
10125  * Revision 1.38  1994/06/17  18:07:20  matt
10126  * Moved some vars out of ifdef
10127  *
10128  * Revision 1.37  1994/06/15  11:09:22  yuan
10129  * Moved gauge_message to mono screen for now.
10130  *
10131  * Revision 1.36  1994/05/30  20:22:11  yuan
10132  * New triggers.
10133  *
10134  * Revision 1.35  1994/05/27  10:32:48  yuan
10135  * New dialog boxes (Walls and Triggers) added.
10136  *
10137  *
10138  * Revision 1.34  1994/05/20  11:56:45  matt
10139  * Cleaned up find_vector_intersection() interface
10140  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
10141  *
10142  * Revision 1.33  1994/05/19  21:45:21  matt
10143  * Removed unused prototypes
10144  *
10145  * Revision 1.32  1994/05/19  18:53:17  yuan
10146  * Changing player structure...
10147  *
10148  * Revision 1.31  1994/05/16  16:38:35  yuan
10149  * Fixed palette add so it doesn't show up in the menu.
10150  *
10151  * Revision 1.30  1994/05/16  09:28:17  matt
10152  * Renamed init_player() to be init_player_stats(), added new funtion
10153  * init_player_object()
10154  *
10155  * Revision 1.29  1994/05/14  17:14:57  matt
10156  * Got rid of externs in source (non-header) files
10157
10158 ------------------------------------------------------------------------
10159 main/gamefont.c:
10160
10161  * Revision 1.2  1995/08/18  10:23:25  allender
10162  * remove refernce to big font -- add PC small font for pixel
10163  * doubling display
10164  *
10165  * Revision 1.1  1995/05/16  15:25:22  allender
10166  * Initial revision
10167  *
10168  * Revision 2.0  1995/02/27  11:30:14  john
10169  * New version 2.0, which has no anonymous unions, builds with
10170  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10171  *
10172  * Revision 1.8  1994/11/18  16:41:39  adam
10173  * trimmed some meat
10174  *
10175  * Revision 1.7  1994/11/17  13:07:11  adam
10176  * removed unused font
10177  *
10178  * Revision 1.6  1994/11/03  21:36:12  john
10179  * Added code for credit fonts.
10180  *
10181  * Revision 1.5  1994/08/17  20:20:02  matt
10182  * Took out alternate-color versions of font3, since this is a mono font
10183  *
10184  * Revision 1.4  1994/08/12  12:03:44  adam
10185  * tweaked fonts.
10186  *
10187  * Revision 1.3  1994/08/11  12:43:40  adam
10188  * changed font filenames
10189  *
10190  * Revision 1.2  1994/08/10  19:57:15  john
10191  * Changed font stuff; Took out old menu; messed up lots of
10192  * other stuff like game sequencing messages, etc.
10193  *
10194  * Revision 1.1  1994/08/10  17:20:09  john
10195  * Initial revision
10196
10197 ------------------------------------------------------------------------
10198 main/gamefont.h:
10199
10200  * Revision 1.2  1995/08/18  10:23:54  allender
10201  * removed large font -- added PC small font
10202  *
10203  * Revision 1.1  1995/05/16  15:56:55  allender
10204  * Initial revision
10205  *
10206  * Revision 2.0  1995/02/27  11:31:09  john
10207  * New version 2.0, which has no anonymous unions, builds with
10208  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10209  *
10210  * Revision 1.7  1994/11/18  16:41:28  adam
10211  * trimmed meat
10212  *
10213  * Revision 1.6  1994/11/17  13:07:00  adam
10214  * removed unused font
10215  *
10216  * Revision 1.5  1994/11/03  21:36:02  john
10217  * Added code for credit fonts.
10218  *
10219  * Revision 1.4  1994/08/17  20:20:25  matt
10220  * Took out alternate-color versions of font3, since this is a mono font
10221  *
10222  * Revision 1.3  1994/08/11  12:44:32  adam
10223  * killed a #define
10224  *
10225  * Revision 1.2  1994/08/10  19:57:16  john
10226  * Changed font stuff; Took out old menu; messed up lots of
10227  * other stuff like game sequencing messages, etc.
10228  *
10229  * Revision 1.1  1994/08/10  17:20:22  john
10230  * Initial revision
10231
10232 ------------------------------------------------------------------------
10233 main/gamemine.c:
10234
10235  * Revision 1.2  1995/10/31  10:15:58  allender
10236  * code for shareware levels
10237  *
10238  * Revision 1.1  1995/05/16  15:25:29  allender
10239  * Initial revision
10240  *
10241  * Revision 2.2  1995/03/06  15:23:14  john
10242  * New screen techniques.
10243  *
10244  * Revision 2.1  1995/02/27  13:13:37  john
10245  * Removed floating point.
10246  *
10247  * Revision 2.0  1995/02/27  11:27:45  john
10248  * New version 2.0, which has no anonymous unions, builds with
10249  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10250  *
10251  * Revision 1.70  1995/02/13  20:35:09  john
10252  * Lintized
10253  *
10254  * Revision 1.69  1995/02/07  17:12:03  rob
10255  * Added ifdef's for Editor.
10256  *
10257  * Revision 1.68  1995/02/07  16:51:48  mike
10258  * fix gray rock josh problem.
10259  *
10260  * Revision 1.67  1995/02/01  15:46:26  yuan
10261  * Fixed matcen_nums.
10262  *
10263  * Revision 1.66  1995/01/19  15:19:28  mike
10264  * new super-compressed registered file format.
10265  *
10266  * Revision 1.65  1994/12/10  16:44:59  matt
10267  * Added debugging code to track down door that turns into rock
10268  *
10269  * Revision 1.64  1994/12/10  14:58:24  yuan
10270  * *** empty log message ***
10271  *
10272  * Revision 1.63  1994/12/08  17:19:10  yuan
10273  * Cfiling stuff.
10274  *
10275  * Revision 1.62  1994/12/07  14:05:33  yuan
10276  * Fixed wall assert problem... Bashed highest_segment
10277  * _index before WALL_IS_DOORWAY check.
10278  *
10279  * Revision 1.61  1994/11/27  23:14:52  matt
10280  * Made changes for new mprintf calling convention
10281  *
10282  * Revision 1.60  1994/11/27  18:05:20  matt
10283  * Compile out LVL reader when editor compiled out
10284  *
10285  * Revision 1.59  1994/11/26  22:51:45  matt
10286  * Removed editor-only fields from segment structure when editor is compiled
10287  * out, and padded segment structure to even multiple of 4 bytes.
10288  *
10289  * Revision 1.58  1994/11/26  21:48:02  matt
10290  * Fixed saturation in short light value
10291  *
10292  * Revision 1.57  1994/11/20  22:11:49  mike
10293  * comment out an apparently unnecessary call to fuelcen_reset().
10294  *
10295  * Revision 1.56  1994/11/18  21:56:42  john
10296  * Added a better, leaner pig format.
10297  *
10298  * Revision 1.55  1994/11/17  20:09:18  john
10299  * Added new compiled level format.
10300  *
10301  * Revision 1.54  1994/11/17  15:40:17  mike
10302  * Comment out mprintf which was causing important information to scroll away.
10303  *
10304  * Revision 1.53  1994/11/17  14:56:37  mike
10305  * moved segment validation functions from editor to main.
10306  *
10307  * Revision 1.52  1994/11/17  11:39:35  matt
10308  * Ripped out code to load old mines
10309  *
10310  * Revision 1.51  1994/11/14  20:47:53  john
10311  * Attempted to strip out all the code in the game
10312  * directory that uses any ui code.
10313  *
10314  * Revision 1.50  1994/11/14  16:05:38  matt
10315  * Fixed, maybe, again, errors when can't find texture during remap
10316  *
10317  * Revision 1.49  1994/11/14  14:34:03  matt
10318  * Fixed up handling when textures can't be found during remap
10319  *
10320  * Revision 1.48  1994/11/14  13:01:55  matt
10321  * Added Int3() when can't find texture
10322  *
10323  * Revision 1.47  1994/10/30  14:12:21  mike
10324  * rip out local segments stuff.
10325  *
10326  * Revision 1.46  1994/10/27  19:43:07  john
10327  * Disable the piglet option.
10328  *
10329  * Revision 1.45  1994/10/27  18:51:42  john
10330  * Added -piglet option that only loads needed textures for a
10331  * mine.  Only saved ~1MB, and code still doesn't free textures
10332  * before you load a new mine.
10333  *
10334  * Revision 1.44  1994/10/20  12:47:22  matt
10335  * Replace old save files (MIN/SAV/HOT) with new LVL files
10336  *
10337  * Revision 1.43  1994/10/19  16:46:40  matt
10338  * Made tmap overrides for robots remap texture numbers
10339  *
10340  * Revision 1.42  1994/10/03  23:37:01  mike
10341  * Adapt to changed fuelcen_activate parameters.
10342  *
10343  * Revision 1.41  1994/09/23  22:14:49  matt
10344  * Took out obsolete structure fields
10345  *
10346  * Revision 1.40  1994/08/01  11:04:11  yuan
10347  * New materialization centers.
10348  *
10349  * Revision 1.39  1994/07/21  19:01:47  mike
10350  * Call Lsegment stuff.
10351
10352 ------------------------------------------------------------------------
10353 main/gamemine.h:
10354
10355  * Revision 1.1  1995/05/16  15:57:02  allender
10356  * Initial revision
10357  *
10358  * Revision 2.0  1995/02/27  11:28:50  john
10359  * New version 2.0, which has no anonymous unions, builds with
10360  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10361  *
10362  * Revision 1.15  1994/11/17  11:39:34  matt
10363  * Ripped out code to load old mines
10364  *
10365  * Revision 1.14  1994/10/19  16:46:40  matt
10366  * Made tmap overrides for robots remap texture numbers
10367  *
10368  * Revision 1.13  1994/09/23  22:14:37  matt
10369  * Took out obsolete structure fields
10370  *
10371  * Revision 1.12  1994/07/22  12:36:32  matt
10372  * Cleaned up editor/game interactions some more.
10373  *
10374  * Revision 1.11  1994/06/01  11:21:37  yuan
10375  * Added controlcentertriggers to the gamesave.
10376  *
10377  * Revision 1.10  1994/05/10  12:14:26  yuan
10378  * Game save/load... Demo levels 1-5 added...
10379  * High scores fixed...
10380  *
10381  * Revision 1.9  1994/05/04  18:25:05  yuan
10382  * Working on gamesave.
10383  *
10384  * Revision 1.8  1994/05/03  15:53:27  yuan
10385  * Readded structure field groups for backward compatibility...
10386  *
10387  * Revision 1.7  1994/05/03  11:36:26  yuan
10388  * Stabilizing gamesave stuff.
10389  *
10390  * Revision 1.6  1994/04/28  11:01:32  yuan
10391  * Added objects in structure.
10392  *
10393  * Revision 1.5  1994/04/06  18:30:03  john
10394  * Added Refueling segments.
10395  *
10396  * Revision 1.4  1994/03/17  18:06:53  yuan
10397  * Removed switch code... Now we just have Walls, Triggers, and Links...
10398  *
10399  * Revision 1.3  1994/03/01  18:12:24  yuan
10400  * Wallswitches, triggers, and more!
10401  *
10402  * Revision 1.2  1994/02/10  15:36:01  matt
10403  * Various changes to make editor compile out.
10404  *
10405  * Revision 1.1  1994/02/09  17:11:45  matt
10406  * Initial revision
10407
10408 ------------------------------------------------------------------------
10409 main/gamesave.c:
10410
10411  * Revision 1.3  1996/02/21  13:59:17  allender
10412  * check Data folder when can't open a level file from a hog
10413  *
10414  * Revision 1.2  1995/10/31  10:23:23  allender
10415  * shareware stuff
10416  *
10417  * Revision 1.1  1995/05/16  15:25:37  allender
10418  * Initial revision
10419  *
10420  * Revision 2.2  1995/04/23  14:53:12  john
10421  * Made some mine structures read in with no structure packing problems.
10422  *
10423  * Revision 2.1  1995/03/20  18:15:43  john
10424  * Added code to not store the normals in the segment structure.
10425  *
10426  * Revision 2.0  1995/02/27  11:29:50  john
10427  * New version 2.0, which has no anonymous unions, builds with
10428  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10429  *
10430  * Revision 1.207  1995/02/23  10:17:36  allender
10431  * fixed parameter mismatch with compute_segment_center
10432  *
10433  * Revision 1.206  1995/02/22  14:51:17  allender
10434  * fixed some things that I missed
10435  *
10436  * Revision 1.205  1995/02/22  13:31:38  allender
10437  * remove anonymous unions from object structure
10438  *
10439  * Revision 1.204  1995/02/01  20:58:08  john
10440  * Made editor check hog.
10441  *
10442  * Revision 1.203  1995/01/28  17:40:34  mike
10443  * correct level names (use rdl, sdl) for dumpmine stuff.
10444  *
10445  * Revision 1.202  1995/01/25  20:03:46  matt
10446  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
10447  *
10448  * Revision 1.201  1995/01/20  16:56:53  mike
10449  * remove some mprintfs.
10450  *
10451  * Revision 1.200  1995/01/15  19:42:13  matt
10452  * Ripped out hostage faces for registered version
10453  *
10454  * Revision 1.199  1995/01/05  16:59:09  yuan
10455  * Make it so if editor is loaded, don't get error from typo
10456  * in filename.
10457  *
10458  * Revision 1.198  1994/12/19  12:49:46  mike
10459  * Change fgets to cfgets.  fgets was getting a pointer mismatch warning.
10460  *
10461  * Revision 1.197  1994/12/12  01:20:03  matt
10462  * Took out object size hack for green claw guys
10463  *
10464  * Revision 1.196  1994/12/11  13:19:37  matt
10465  * Restored calls to fix_object_segs() when debugging is turned off, since
10466  * it's not a big routine, and could fix some possibly bad problems.
10467  *
10468  * Revision 1.195  1994/12/10  16:17:24  mike
10469  * fix editor bug that was converting transparent walls into rock.
10470  *
10471  * Revision 1.194  1994/12/09  14:59:27  matt
10472  * Added system to attach a fireball to another object for rendering purposes,
10473  * so the fireball always renders on top of (after) the object.
10474  *
10475  * Revision 1.193  1994/12/08  17:19:02  yuan
10476  * Cfiling stuff.
10477  *
10478  * Revision 1.192  1994/12/02  20:01:05  matt
10479  * Always give vulcan cannon powerup same amount of ammo, regardless of
10480  * how much it was saved with
10481  *
10482  * Revision 1.191  1994/11/30  17:45:57  yuan
10483  * Saving files now creates RDL/SDLs instead of CDLs.
10484  *
10485  * Revision 1.190  1994/11/30  17:22:14  matt
10486  * Ripped out hostage faces in shareware version
10487  *
10488  * Revision 1.189  1994/11/28  00:09:30  allender
10489  * commented out call to newdemo_record_start_demo in load_level...what is
10490  * this doing here anyway?????
10491  *
10492  * Revision 1.188  1994/11/27  23:13:48  matt
10493  * Made changes for new mprintf calling convention
10494  *
10495  * Revision 1.187  1994/11/27  18:06:20  matt
10496  * Cleaned up LVL/CDL file loading
10497  *
10498  * Revision 1.186  1994/11/25  22:46:29  matt
10499  * Allow ESC out of compiled/normal menu (esc=compiled).
10500  *
10501  * Revision 1.185  1994/11/23  12:18:35  mike
10502  * move level names here...a more logical place than dumpmine.
10503  *
10504  * Revision 1.184  1994/11/21  20:29:19  matt
10505  * If hostage info is bad, fix it.
10506  *
10507  * Revision 1.183  1994/11/21  20:26:07  matt
10508  * Fixed bug, I hope
10509  *
10510  * Revision 1.182  1994/11/21  20:20:37  matt
10511  * Fixed stupid mistake
10512  *
10513  * Revision 1.181  1994/11/21  20:18:40  matt
10514  * Fixed (hopefully) totally bogus writing of hostage data
10515  *
10516  * Revision 1.180  1994/11/20  14:11:56  matt
10517  * Gracefully handle two hostages having same id
10518  *
10519  * Revision 1.179  1994/11/19  23:55:05  mike
10520  * remove Assert, put in comment for Matt.
10521  *
10522  * Revision 1.178  1994/11/19  19:53:24  matt
10523  * Added code to full support different hostage head clip & message for
10524  * each hostage.
10525  *
10526  * Revision 1.177  1994/11/19  15:15:21  mike
10527  * remove unused code and data
10528  *
10529  * Revision 1.176  1994/11/19  10:28:28  matt
10530  * Took out write routines when editor compiled out
10531  *
10532  * Revision 1.175  1994/11/17  20:38:25  john
10533  * Took out warning.
10534  *
10535  * Revision 1.174  1994/11/17  20:36:34  john
10536  * Made it so that saving a mine will write the .cdl even
10537  * if .lvl gets error.
10538  *
10539  * Revision 1.173  1994/11/17  20:26:19  john
10540  * Made the game load whichever of .cdl or .lvl exists,
10541  * and if they both exist, prompt the user for which one.
10542  *
10543  * Revision 1.172  1994/11/17  20:11:20  john
10544  * Fixed warning.
10545  *
10546  * Revision 1.171  1994/11/17  20:09:26  john
10547  * Added new compiled level format.
10548  *
10549  * Revision 1.170  1994/11/17  14:57:21  mike
10550  * moved segment validation functions from editor to main.
10551  *
10552  * Revision 1.169  1994/11/17  11:39:21  matt
10553  * Ripped out code to load old mines
10554  *
10555  * Revision 1.168  1994/11/16  11:24:53  matt
10556  * Made attack-type robots have smaller radius, so they get closer to player
10557  *
10558  * Revision 1.167  1994/11/15  21:42:47  mike
10559  * better error messages.
10560  *
10561  * Revision 1.166  1994/11/15  15:30:41  matt
10562  * Save ptr to name of level being loaded
10563  *
10564  * Revision 1.165  1994/11/14  20:47:46  john
10565  * Attempted to strip out all the code in the game
10566  * directory that uses any ui code.
10567  *
10568  * Revision 1.164  1994/11/14  14:34:23  matt
10569  * Fixed up handling when textures can't be found during remap
10570  *
10571  * Revision 1.163  1994/11/10  14:02:49  matt
10572  * Hacked in support for player ships with different textures
10573  *
10574  * Revision 1.162  1994/11/06  14:38:17  mike
10575  * Remove an apparently unnecessary mprintf.
10576  *
10577  * Revision 1.161  1994/10/30  14:11:28  mike
10578  * ripout local segments stuff.
10579  *
10580  * Revision 1.160  1994/10/28  12:10:41  matt
10581  * Check that was supposed to happen only when editor was in was happening
10582  * only when editor was out.
10583  *
10584  * Revision 1.159  1994/10/27  11:25:32  matt
10585  * Only do connectivity error check when editor in
10586  *
10587  * Revision 1.158  1994/10/27  10:54:00  matt
10588  * Made connectivity error checking put up warning if errors found
10589  *
10590  * Revision 1.157  1994/10/25  10:50:54  matt
10591  * Vulcan cannon powerups now contain ammo count
10592  *
10593  * Revision 1.156  1994/10/23  02:10:43  matt
10594  * Got rid of obsolete hostage_info stuff
10595  *
10596  * Revision 1.155  1994/10/22  18:57:26  matt
10597  * Added call to check_segment_connections()
10598  *
10599  * Revision 1.154  1994/10/21  12:19:23  matt
10600  * Clear transient objects when saving (& loading) games
10601  *
10602  * Revision 1.153  1994/10/21  11:25:10  mike
10603  * Use new constant IMMORTAL_TIME.
10604  *
10605  * Revision 1.152  1994/10/20  12:46:59  matt
10606  * Replace old save files (MIN/SAV/HOT) with new LVL files
10607  *
10608  * Revision 1.151  1994/10/19  19:26:32  matt
10609  * Fixed stupid bug
10610  *
10611  * Revision 1.150  1994/10/19  16:46:21  matt
10612  * Made tmap overrides for robots remap texture numbers
10613  *
10614  * Revision 1.149  1994/10/18  08:50:27  yuan
10615  * Fixed correct variable this time.
10616  *
10617  * Revision 1.148  1994/10/18  08:45:02  yuan
10618  * Oops. forgot load function.
10619  *
10620  * Revision 1.147  1994/10/18  08:42:10  yuan
10621  * Avoid the int3.
10622  *
10623  * Revision 1.146  1994/10/17  21:34:57  matt
10624  * Added support for new Control Center/Main Reactor
10625  *
10626  * Revision 1.145  1994/10/15  19:06:34  mike
10627  * Fix bug, maybe, having to do with something or other, ...
10628  *
10629  * Revision 1.144  1994/10/12  21:07:33  matt
10630  * Killed unused field in object structure
10631  *
10632  * Revision 1.143  1994/10/06  14:52:55  mike
10633  * Put check in to detect possibly bogus walls in last segment which leaked through an earlier check
10634  * due to misuse of Highest_segment_index.
10635  *
10636  * Revision 1.142  1994/10/05  22:12:44  mike
10637  * Put in cleanup for matcen/fuelcen links.
10638  *
10639  * Revision 1.141  1994/10/03  11:30:05  matt
10640  * Make sure player in a valid segment before saving
10641  *
10642  * Revision 1.140  1994/09/28  11:14:41  mike
10643  * Better error messaging on bogus mines: Only bring up dialog box if a "real" (level??.*) level.
10644  *
10645  * Revision 1.139  1994/09/28  09:22:58  mike
10646  * Comment out a mprintf.
10647  *
10648  * Revision 1.138  1994/09/27  17:08:36  mike
10649  * Message boxes when you load bogus mines.
10650  *
10651  * Revision 1.137  1994/09/27  15:43:45  mike
10652  * Move the dump stuff to dumpmine.
10653  *
10654  * Revision 1.136  1994/09/27  00:02:31  mike
10655  * Dump text files (".txm") when loading a mine, showing all kinds of useful mine info.
10656  *
10657  * Revision 1.135  1994/09/26  11:30:41  matt
10658  * Took out code which loaded bogus player structure
10659  *
10660  * Revision 1.134  1994/09/26  11:18:44  john
10661  * Fixed some conflicts with newseg.
10662  *
10663  * Revision 1.133  1994/09/26  10:56:58  matt
10664  * Fixed inconsistancies in lifeleft for immortal objects
10665  *
10666  * Revision 1.132  1994/09/25  23:41:10  matt
10667  * Changed the object load & save code to read/write the structure fields one
10668  * at a time (rather than the whole structure at once).  This mean that the
10669  * object structure can be changed without breaking the load/save functions.
10670  * As a result of this change, the local_object data can be and has been
10671  * incorporated into the object array.  Also, timeleft is now a property
10672  * of all objects, and the object structure has been otherwise cleaned up.
10673
10674 ------------------------------------------------------------------------
10675 main/gamesave.h:
10676
10677  * Revision 1.1  1995/05/16  15:57:10  allender
10678  * Initial revision
10679  *
10680  * Revision 2.0  1995/02/27  11:30:25  john
10681  * New version 2.0, which has no anonymous unions, builds with
10682  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10683  *
10684  * Revision 1.11  1994/11/23  12:19:32  mike
10685  * detail level menu.
10686  *
10687  * Revision 1.10  1994/10/20  12:47:30  matt
10688  * Replace old save files (MIN/SAV/HOT) with new LVL files
10689  *
10690  * Revision 1.9  1994/09/27  17:08:47  mike
10691  * Message boxes when you load bogus mines.
10692  *
10693  * Revision 1.8  1994/09/27  15:43:05  mike
10694  * Prototype write_game_text.
10695  *
10696  * Revision 1.7  1994/09/14  15:46:39  matt
10697  * Added function load_mine_only()
10698  *
10699  * Revision 1.6  1994/07/22  12:36:28  matt
10700  * Cleaned up editor/game interactions some more.
10701  *
10702  * Revision 1.5  1994/07/20  13:38:14  matt
10703  * Added get_level_name() prototype
10704  *
10705  * Revision 1.4  1994/06/20  22:19:41  john
10706  * Added Gamesave_num_org_robots.
10707  *
10708  * Revision 1.3  1994/06/14  11:32:49  john
10709  * Made Newdemo record & restore the current mine.
10710  *
10711  * Revision 1.2  1994/05/14  17:16:25  matt
10712  * Got rid of externs in source (non-header) files
10713  *
10714  * Revision 1.1  1994/05/14  16:01:26  matt
10715  * Initial revision
10716
10717 ------------------------------------------------------------------------
10718 main/gameseg.c:
10719
10720  * Revision 1.9  1995/11/08  16:26:04  allender
10721  * minor bug fix in find_connected_distance
10722  *
10723  * Revision 1.8  1995/10/12  17:36:55  allender
10724  * made trace_segs only recurse 100 times max
10725  *
10726  * Revision 1.7  1995/10/11  18:29:01  allender
10727  * removed Int3 from trace_segs
10728  *
10729  * Revision 1.6  1995/10/11  14:13:54  allender
10730  * put in stack check code into trace-segs
10731  *
10732  * Revision 1.5  1995/09/23  09:40:25  allender
10733  * put in casts in extract_shortpos to try and solve shortpos problem
10734  * with appletalk
10735  *
10736  * Revision 1.4  1995/09/20  14:26:50  allender
10737  * added flag to swap bytes on extract shortpot
10738  *
10739  * Revision 1.3  1995/08/12  12:01:27  allender
10740  * added flag to create_shortpos to swap bytes
10741  *
10742  * Revision 1.2  1995/06/06  10:42:07  allender
10743  * made shortpos routines swap bytes when extracting and making shortpos structures
10744  *
10745  * Revision 1.1  1995/05/16  15:25:46  allender
10746  * Initial revision
10747  *
10748  * Revision 2.2  1995/03/20  18:15:39  john
10749  * Added code to not store the normals in the segment structure.
10750  *
10751  * Revision 2.1  1995/03/08  12:11:39  allender
10752  * fix shortpos reading/writing
10753  *
10754  * Revision 2.0  1995/02/27  11:29:21  john
10755  * New version 2.0, which has no anonymous unions, builds with
10756  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10757  *
10758  * Revision 1.78  1995/02/22  13:52:22  allender
10759  * remove anonymous unions from object structure
10760  *
10761  * Revision 1.77  1995/02/22  13:24:47  john
10762  * Removed the vecmat anonymous unions.
10763  *
10764  * Revision 1.76  1995/02/13  20:35:01  john
10765  * Lintized
10766  *
10767  * Revision 1.75  1995/02/09  13:10:51  mike
10768  * remove an annoying mprintf.
10769  *
10770  * Revision 1.74  1995/02/05  17:49:28  rob
10771  * Added assert to gameseg.c.
10772  *
10773  * Revision 1.73  1995/02/02  00:49:26  mike
10774  * new automap segment-depth functionality.
10775  *
10776  * Revision 1.72  1995/01/16  21:06:51  mike
10777  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
10778  *
10779  * Revision 1.71  1994/12/21  19:54:32  matt
10780  * Added error checking
10781  *
10782  * Revision 1.70  1994/12/11  21:34:09  matt
10783  * Changed assert() to int3()
10784  *
10785  * Revision 1.69  1994/12/01  21:04:37  matt
10786  * Several important changes:
10787  *  (1) Checking against triangulated sides has been standardized a bit
10788  *  (2) Code has been added to de-triangulate some sides
10789  *  (3) BIG ONE: the tolerance for checking a point against a plane has
10790  *      been drastically relaxed
10791  *
10792  *
10793  * Revision 1.67  1994/11/27  23:12:21  matt
10794  * Made changes for new mprintf calling convention
10795  *
10796  * Revision 1.66  1994/11/26  22:51:40  matt
10797  * Removed editor-only fields from segment structure when editor is compiled
10798  * out, and padded segment structure to even multiple of 4 bytes.
10799  *
10800  * Revision 1.65  1994/11/22  16:55:38  mike
10801  * use memset in place of loop to clear array.
10802  *
10803  * Revision 1.64  1994/11/19  15:20:37  mike
10804  * rip out unused code and data
10805  *
10806  * Revision 1.63  1994/11/18  18:31:48  matt
10807  * Fixed code again (and maybe for real)
10808  *
10809  * Revision 1.62  1994/11/18  16:54:24  matt
10810  * Fixed extract_orient_from_segment()
10811  *
10812  * Revision 1.61  1994/11/17  14:56:50  mike
10813  * moved segment validation functions from editor to main.
10814  *
10815  * Revision 1.60  1994/11/16  23:38:53  mike
10816  * new improved boss teleportation behavior.
10817  *
10818  * Revision 1.59  1994/10/30  14:12:46  mike
10819  * rip out local segments stuff.
10820  *
10821  * Revision 1.58  1994/10/27  10:53:39  matt
10822  * Made connectivity error checking put up warning if errors found
10823  *
10824  * Revision 1.57  1994/10/25  21:19:26  mike
10825  * debugging code.
10826  *
10827  * Revision 1.56  1994/10/25  11:26:09  mike
10828  * *** empty log message ***
10829  *
10830  * Revision 1.55  1994/10/22  22:36:08  matt
10831  * Improved error finding routine
10832  *
10833  * Revision 1.54  1994/10/22  18:56:51  matt
10834  * Fixed obscure bug in segment trace code
10835  * Added error find routine, check_segment_connections()
10836  *
10837  * Revision 1.53  1994/10/17  14:05:19  matt
10838  * Don't give recursion assert if doing lighting
10839  *
10840  * Revision 1.52  1994/10/15  19:03:48  mike
10841  * Don't do exhaustive search in smooth lighting.
10842  *
10843  * Revision 1.51  1994/10/12  09:46:44  mike
10844  * Add debug code for trapping exhaustive searches.
10845  *
10846  * Revision 1.50  1994/10/11  20:50:41  matt
10847  * Made find_point_seg() take -1 as segnum, meaning to search all segments
10848  *
10849  * Revision 1.49  1994/10/11  17:40:31  matt
10850  * Fixed bug that caused segment trace to only go through sides you can fly through
10851  *
10852  * Revision 1.48  1994/10/10  14:48:16  matt
10853  * Fixed mistake that caused odd pauses and occasional int3's
10854  *
10855  * Revision 1.47  1994/10/09  23:50:41  matt
10856  * Made find_hitpoint_uv() work with triangulated sides
10857  *
10858  * Revision 1.46  1994/10/08  23:06:52  matt
10859  * trace_segs() didn't know about external walls
10860  *
10861  * Revision 1.45  1994/10/07  22:18:57  mike
10862  * Put in asserts to trap bad segnums.
10863  *
10864  * Revision 1.44  1994/10/06  14:08:07  matt
10865  * Added new function, extract_orient_from_segment()
10866  *
10867  * Revision 1.43  1994/10/04  16:24:11  mike
10868  * Set global Connected_segment_distance for debug reasons for aipath.c.
10869  *
10870  * Revision 1.42  1994/10/04  09:18:42  mike
10871  * Comment out a variable definition, preventing a warning message.
10872  *
10873  * Revision 1.41  1994/10/03  23:43:42  mike
10874  * Put in a warning for overrunning point_segs buffer.
10875  *
10876  * Revision 1.40  1994/10/03  20:55:43  rob
10877  * Added velocity to shortpos.
10878  *
10879  * Revision 1.39  1994/09/27  11:46:06  rob
10880  * re-fixed that same bug (ugh).
10881  *
10882  * Revision 1.38  1994/09/27  10:10:51  rob
10883  * Fixed bug in extract_shortpos (obj_relink added).
10884  *
10885  * Revision 1.37  1994/09/25  23:41:02  matt
10886  * Changed the object load & save code to read/write the structure fields one
10887  * at a time (rather than the whole structure at once).  This mean that the
10888  * object structure can be changed without breaking the load/save functions.
10889  * As a result of this change, the local_object data can be and has been
10890  * incorporated into the object array.  Also, timeleft is now a property
10891  * of all objects, and the object structure has been otherwise cleaned up.
10892  *
10893  * Revision 1.36  1994/09/22  19:03:05  mike
10894  * Add shortpos manipulation functions create_shortpos and extract_shortpos.
10895  *
10896  * Revision 1.35  1994/09/19  21:21:16  mike
10897  * Minor optimization to find_connected_distance.
10898  *
10899  * Revision 1.34  1994/09/19  21:05:25  mike
10900  * Write function find_connected_distance,
10901  * returns distance between two points as travellable through the mine.
10902  *
10903  * Revision 1.33  1994/08/30  15:07:15  matt
10904  * Changed find_point_seg() to deal with some infinite recursion problems.
10905  *
10906  * Revision 1.32  1994/08/11  18:58:32  mike
10907  * Use ints in place of shorts for optimization.
10908  *
10909  * Revision 1.31  1994/08/04  00:20:09  matt
10910  * Cleaned up fvi & physics error handling; put in code to make sure objects
10911  * are in correct segment; simplified segment finding for objects and points
10912  *
10913  * Revision 1.30  1994/08/03  16:46:12  mike
10914  * not much...
10915  *
10916  * Revision 1.29  1994/08/02  20:41:31  matt
10917  * Fixed bug in get_side_verts()
10918  *
10919  * Revision 1.28  1994/08/02  19:04:25  matt
10920  * Cleaned up vertex list functions
10921  *
10922  * Revision 1.27  1994/08/01  10:39:44  matt
10923  * find_new_seg() now will look through any kind of wall but a totally solid one
10924  *
10925  * Revision 1.26  1994/07/28  19:15:59  matt
10926  * Fixed yet another bug in get_seg_masks()
10927
10928 ------------------------------------------------------------------------
10929 main/gameseg.h:
10930
10931  * Revision 1.1  1995/05/16  15:57:18  allender
10932  * Initial revision
10933  *
10934  * Revision 2.0  1995/02/27  11:31:20  john
10935  * New version 2.0, which has no anonymous unions, builds with
10936  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10937  *
10938  * Revision 1.24  1995/02/01  16:34:03  john
10939  * Linted.
10940  *
10941  * Revision 1.23  1995/01/16  21:06:36  mike
10942  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
10943  *
10944  * Revision 1.22  1994/11/23  12:18:59  mike
10945  * prototype for level names.
10946  *
10947  * Revision 1.21  1994/11/17  14:56:59  mike
10948  * moved segment validation functions from editor to main.
10949  *
10950  * Revision 1.20  1994/11/16  23:38:46  mike
10951  * new improved boss teleportation behavior.
10952  *
10953  * Revision 1.19  1994/10/30  14:12:14  mike
10954  * rip out local segments stuff.
10955  *
10956  * Revision 1.18  1994/10/09  23:51:07  matt
10957  * Made find_hitpoint_uv() work with triangulated sides
10958  *
10959  * Revision 1.17  1994/10/06  14:08:22  matt
10960  * Added new function, extract_orient_from_segment()
10961  *
10962  * Revision 1.16  1994/09/19  21:05:52  mike
10963  * Prototype for find_connected_distance.
10964  *
10965  * Revision 1.15  1994/08/11  18:58:45  mike
10966  * Change shorts to ints.
10967  *
10968  * Revision 1.14  1994/08/04  00:21:09  matt
10969  * Cleaned up fvi & physics error handling; put in code to make sure objects
10970  * are in correct segment; simplified segment finding for objects and points
10971  *
10972  * Revision 1.13  1994/08/02  19:04:25  matt
10973  * Cleaned up vertex list functions
10974  *
10975  * Revision 1.12  1994/07/21  19:01:53  mike
10976  * lsegment stuff.
10977  *
10978  * Revision 1.11  1994/07/07  09:31:13  matt
10979  * Added comments
10980  *
10981  * Revision 1.10  1994/06/14  12:21:20  matt
10982  * Added new function, find_point_seg()
10983  *
10984  * Revision 1.9  1994/05/29  23:17:38  matt
10985  * Move find_object_seg() from physics.c to gameseg.c
10986  * Killed unused find_point_seg()
10987  *
10988  * Revision 1.8  1994/05/20  11:56:57  matt
10989  * Cleaned up find_vector_intersection() interface
10990  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
10991  *
10992  * Revision 1.7  1994/03/17  18:07:38  yuan
10993  * Removed switch code... Now we just have Walls, Triggers, and Links...
10994  *
10995  * Revision 1.6  1994/02/22  18:14:44  yuan
10996  * Added new wall system
10997  *
10998  * Revision 1.5  1994/02/17  11:33:22  matt
10999  * Changes in object system
11000  *
11001  * Revision 1.4  1994/02/16  13:48:33  mike
11002  * enable editor to compile out.
11003  *
11004  * Revision 1.3  1994/02/14  12:05:07  mike
11005  * change segment data structure.
11006  *
11007  * Revision 1.2  1994/02/10  16:07:20  mike
11008  * separate editor from game based on EDITOR flag.
11009  *
11010  * Revision 1.1  1994/02/09  15:45:38  mike
11011  * Initial revision
11012
11013 ------------------------------------------------------------------------
11014 main/gameseq.c:
11015
11016  * Revision 1.1  1995/12/05  16:02:05  allender
11017  * Initial revision
11018  *
11019  * Revision 1.14  1995/11/03  12:55:30  allender
11020  * shareware changes
11021  *
11022  * Revision 1.13  1995/10/31  10:23:07  allender
11023  * shareware stuff
11024  *
11025  * Revision 1.12  1995/10/18  18:25:02  allender
11026  * call auto_select_weapon after initing ammo since that may
11027  * change the secondary weapon status
11028  *
11029  * Revision 1.11  1995/10/17  13:17:11  allender
11030  * added closebox when entering pilot name
11031  *
11032  * Revision 1.10  1995/09/24  10:56:59  allender
11033  * new players must be looked for in Players directory
11034  *
11035  * Revision 1.9  1995/09/18  08:08:08  allender
11036  * remove netgame binding if at endgame
11037  *
11038  * Revision 1.8  1995/09/14  14:13:01  allender
11039  * initplayerobject have void return
11040  *
11041  * Revision 1.7  1995/08/31  12:54:42  allender
11042  * try and fix bug
11043  *
11044  * Revision 1.6  1995/08/26  16:25:40  allender
11045  * put return values on needed functions
11046  *
11047  * Revision 1.5  1995/08/14  09:26:28  allender
11048  * added byteswap header files
11049  *
11050  * Revision 1.4  1995/08/01  13:57:42  allender
11051  * macified player file stuff -- players stored in seperate folder
11052  *
11053  * Revision 1.3  1995/06/08  12:54:37  allender
11054  * new function for calculating a segment based checksum since the old way
11055  * is byte order dependent
11056  *
11057  * Revision 1.2  1995/06/02  07:42:10  allender
11058  * removed duplicate extern for network_endlevel_poll2
11059  *
11060  * Revision 1.1  1995/05/16  15:25:56  allender
11061  * Initial revision
11062  *
11063  * Revision 2.10  1995/12/19  15:48:25  john
11064  * Made screen reset when loading new level.
11065  *
11066  * Revision 2.9  1995/07/07  16:47:52  john
11067  * Fixed bug with reactor time..
11068  *
11069  * Revision 2.8  1995/06/15  12:14:18  john
11070  * Made end game, win game and title sequences all go
11071  * on after 5 minutes automatically.
11072  *
11073  * Revision 2.7  1995/05/26  16:16:25  john
11074  * Split SATURN into define's for requiring cd, using cd, etc.
11075  * Also started adding all the Rockwell stuff.
11076  *
11077  * Revision 2.6  1995/03/24  13:11:20  john
11078  * Added save game during briefing screens.
11079  *
11080  * Revision 2.5  1995/03/23  17:56:20  allender
11081  * added code to record old laser level and weapons when player gets
11082  * new ship
11083  *
11084  * Revision 2.4  1995/03/21  08:39:14  john
11085  * Ifdef'd out the NETWORK code.
11086  *
11087  * Revision 2.3  1995/03/15  14:33:33  john
11088  * Added code to force the Descent CD-rom in the drive.
11089  *
11090  * Revision 2.2  1995/03/06  16:47:26  mike
11091  * destination saturn
11092  *
11093  * Revision 2.1  1995/03/06  15:23:23  john
11094  * New screen techniques.
11095  *
11096  * Revision 2.0  1995/02/27  11:28:53  john
11097  * New version 2.0, which has no anonymous unions, builds with
11098  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11099  *
11100  * Revision 1.310  1995/02/14  10:48:09  mike
11101  * zero bonus if you are a cheater.
11102  *
11103  * Revision 1.309  1995/02/11  19:17:08  rob
11104  * Fixed bug in laser fire rate after demo playback.
11105  *
11106  * Revision 1.308  1995/02/11  14:34:08  rob
11107  * Added include of netmisc.c
11108  *
11109  * Revision 1.307  1995/02/11  14:29:04  rob
11110  * Fixes for invul. controlcen.
11111  *
11112  * Revision 1.306  1995/02/11  13:47:00  mike
11113  * fix cheats.
11114  *
11115  * Revision 1.305  1995/02/11  13:10:52  rob
11116  * Fixed end of anarchy mission problems.
11117  *
11118  * Revision 1.304  1995/02/11  12:46:12  mike
11119  * initialize Robot_firing_enabled, part of AHIMSA cheat.
11120  *
11121  * Revision 1.303  1995/02/11  12:42:03  john
11122  * Added new song method, with FM bank switching..
11123  *
11124  * Revision 1.302  1995/02/10  17:39:29  matt
11125  * Changed secret exit message to be centered
11126  *
11127  * Revision 1.301  1995/02/10  16:17:33  mike
11128  * init Last_level_path_shown.
11129  *
11130  * Revision 1.300  1995/02/09  22:18:22  john
11131  * Took out between level saves.
11132  *
11133  * Revision 1.299  1995/02/09  12:11:42  rob
11134  * Get rid of high scores thing for multiplayer games.
11135  *
11136  * Revision 1.298  1995/02/08  20:34:24  rob
11137  * Took briefing screens back OUT of coop games (per Interplay request)
11138  *
11139  * Revision 1.297  1995/02/08  19:20:09  rob
11140  * Moved checksum calc.
11141  *
11142  * Revision 1.296  1995/02/05  14:39:24  rob
11143  * Changed object mapping to be more efficient.
11144  *
11145  * Revision 1.295  1995/02/02  19:05:38  john
11146  * Made end level menu for 27 not overwrite descent title..
11147  *
11148  * Revision 1.294  1995/02/02  16:36:42  adam
11149  * *** empty log message ***
11150  *
11151  * Revision 1.293  1995/02/02  15:58:02  john
11152  * Added turbo mode cheat.
11153  *
11154  * Revision 1.292  1995/02/02  15:29:34  matt
11155  * Changed & localized secret level text
11156  *
11157  * Revision 1.291  1995/02/02  10:50:03  adam
11158  * messed with secret level message
11159  *
11160  * Revision 1.290  1995/02/02  01:20:28  adam
11161  * changed endgame song temporarily.
11162  *
11163  * Revision 1.289  1995/02/01  23:19:43  rob
11164  * Fixed up endlevel stuff for multiplayer.
11165  * Put in palette fades around areas that didn't have them before.
11166  *
11167  * Revision 1.288  1995/02/01  17:12:34  mike
11168  * Make score come after endgame screens.
11169  *
11170  * Revision 1.287  1995/01/30  18:34:30  rob
11171  * Put briefing screens back into coop games.
11172  *
11173  * Revision 1.286  1995/01/27  13:07:59  rob
11174  * Removed erroneous warning message.
11175  *
11176  * Revision 1.285  1995/01/27  11:47:43  rob
11177  * Removed new secret level menu from multiplayer games.
11178  *
11179  * Revision 1.284  1995/01/26  22:11:11  mike
11180  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
11181  *
11182  * Revision 1.283  1995/01/26  16:55:13  rob
11183  * Removed ship bonus from cooperative endgame.
11184  *
11185  * Revision 1.282  1995/01/26  16:45:24  mike
11186  * Add autofire fusion cannon stuff.
11187  *
11188  * Revision 1.281  1995/01/26  14:44:44  rob
11189  * Removed unnecessary #ifdefs around mprintfs.
11190  * Changed NumNetPlayerPositions to be independant of MaxNumNetPlayers to
11191  * accomodate 4-player robo-archy games with 8 start positions.
11192  *
11193  * Revision 1.280  1995/01/26  12:19:01  rob
11194  * Changed network_do_frame call.
11195  *
11196  * Revision 1.279  1995/01/26  00:35:03  matt
11197  * Changed numbering convention for HMP files for levels
11198  *
11199  * Revision 1.278  1995/01/25  16:07:59  matt
11200  * Added message (prototype) when going to secret level
11201  *
11202  * Revision 1.277  1995/01/22  18:57:23  matt
11203  * Made player highest level work with missions
11204  *
11205  * Revision 1.276  1995/01/21  23:13:08  matt
11206  * Made high scores with (not work, really) with loaded missions
11207  * Don't give player high score when quit game
11208  *
11209  * Revision 1.275  1995/01/21  17:17:39  john
11210  * *** empty log message ***
11211  *
11212  * Revision 1.274  1995/01/21  17:15:38  john
11213  * Added include for state.h
11214  *
11215  * Revision 1.273  1995/01/21  16:21:14  matt
11216  * Fixed bugs in secret level sequencing
11217  *
11218  * Revision 1.272  1995/01/20  22:47:29  matt
11219  * Mission system implemented, though imcompletely
11220  *
11221  * Revision 1.271  1995/01/19  17:00:48  john
11222  * Made save game work between levels.
11223  *
11224  * Revision 1.270  1995/01/17  17:49:10  rob
11225  * Added key syncing for coop.
11226  *
11227  * Revision 1.269  1995/01/17  14:27:37  john
11228  * y
11229  *
11230  * Revision 1.268  1995/01/17  13:36:33  john
11231  * Moved pig loading into StartNewLevelSub.
11232  *
11233  * Revision 1.267  1995/01/16  16:53:55  john
11234  * Added code to save cheat state during save game.
11235  *
11236  * Revision 1.266  1995/01/15  19:42:10  matt
11237  * Ripped out hostage faces for registered version
11238  *
11239  * Revision 1.265  1995/01/15  16:55:06  john
11240  * Improved mine texture parsing.
11241  *
11242  * Revision 1.264  1995/01/15  11:56:24  john
11243  * Working version of paging.
11244  *
11245  * Revision 1.263  1995/01/14  19:16:40  john
11246  * First version of new bitmap paging code.
11247  *
11248  * Revision 1.262  1995/01/13  17:38:58  yuan
11249  * Removed Int3() for number players check.
11250  *
11251  * Revision 1.261  1995/01/12  12:09:52  yuan
11252  * Added coop object capability.
11253  *
11254  * Revision 1.260  1995/01/05  17:16:08  yuan
11255  * Removed Int3s.
11256  *
11257  * Revision 1.259  1995/01/05  11:34:29  john
11258  * Took out endlevel save stuff for registered.
11259  *
11260  * Revision 1.258  1995/01/04  19:00:16  rob
11261  * Added some debugging for two bugs.
11262  *
11263  * Revision 1.257  1995/01/04  13:18:18  john
11264  * Added cool 6 game save.
11265  *
11266  * Revision 1.256  1995/01/04  08:46:18  rob
11267  * JOHN CHECKED IN FOR ROB !!!
11268  *
11269  * Revision 1.255  1995/01/02  20:07:35  rob
11270  * Added score syncing.
11271  * Get rid of endlevel score for coop games (put it back in elsewhere)
11272  *
11273  * Revision 1.254  1995/01/02  16:17:43  mike
11274  * init super boss.
11275  *
11276  * Revision 1.253  1994/12/21  21:08:47  rob
11277  * fixed a bug in coop player ship positions.
11278  *
11279  * Revision 1.252  1994/12/21  12:57:08  rob
11280  * Handle additional player ships in mines.
11281
11282 ------------------------------------------------------------------------
11283 main/gameseq.h:
11284
11285  * Revision 1.4  1995/10/31  10:22:55  allender
11286  * shareware stuff
11287  *
11288  * Revision 1.3  1995/09/14  14:13:14  allender
11289  * initplayerobject have void return
11290  *
11291  * Revision 1.2  1995/08/24  15:36:17  allender
11292  * fixed prototypes warnings
11293  *
11294  * Revision 1.1  1995/05/16  15:57:26  allender
11295  * Initial revision
11296  *
11297  * Revision 2.0  1995/02/27  11:32:03  john
11298  * New version 2.0, which has no anonymous unions, builds with
11299  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11300  *
11301  * Revision 1.41  1995/02/07  10:51:54  rob
11302  * fix typo.
11303  *
11304  * Revision 1.40  1995/02/06  20:10:16  rob
11305  * Extern'ed DoEndLevelScoreGlitz.
11306  *
11307  * Revision 1.39  1995/02/01  16:34:13  john
11308  * Linted.
11309  *
11310  * Revision 1.38  1995/01/27  11:15:03  rob
11311  * Added extern for player position vars.
11312  *
11313  * Revision 1.37  1995/01/20  22:47:38  matt
11314  * Mission system implemented, though imcompletely
11315  *
11316  * Revision 1.36  1995/01/17  13:36:08  john
11317  * Moved pig loading into StartNewLevelSub.
11318  *
11319  * Revision 1.35  1995/01/04  12:21:28  john
11320  * *** empty log message ***
11321  *
11322  * Revision 1.34  1995/01/04  12:20:47  john
11323  * Declearations to work better with game state save.
11324  *
11325  *
11326  * Revision 1.33  1994/12/08  09:46:35  matt
11327  * Made level name len a multiple of 4 for alignment
11328  *
11329  * Revision 1.32  1994/11/29  16:33:29  rob
11330  * Added new defines for last_secret_level based on shareware or not shareware.
11331  *
11332  * Revision 1.31  1994/11/26  15:30:20  matt
11333  * Allow escape out of change pilot menu
11334  *
11335  * Revision 1.30  1994/11/21  17:29:38  matt
11336  * Cleaned up sequencing & game saving for secret levels
11337  *
11338  * Revision 1.29  1994/11/21  15:55:03  matt
11339  * Corrected LAST_LEVEL
11340  *
11341  * Revision 1.28  1994/11/20  22:12:43  mike
11342  * set LAST_LEVEL based on SHAREWARE.
11343  *
11344  * Revision 1.27  1994/11/09  10:55:51  matt
11345  * Cleaned up initialization for editor -> game transitions
11346  *
11347  * Revision 1.26  1994/11/08  17:50:48  rob
11348  * ADded prototype for StartNewLEvel.
11349  *
11350  *
11351  * Revision 1.25  1994/11/07  17:50:57  rob
11352  * Added extern prototype for init_player_stats_level called for
11353  * network games.
11354  *
11355  * Revision 1.24  1994/10/25  15:40:03  yuan
11356  * *** empty log message ***
11357  *
11358  * Revision 1.23  1994/10/22  00:08:52  matt
11359  * Fixed up problems with bonus & game sequencing
11360  * Player doesn't get credit for hostages unless he gets them out alive
11361  *
11362  * Revision 1.22  1994/10/18  18:57:08  matt
11363  * Added main menu option to enter new player name
11364  *
11365  * Revision 1.21  1994/10/07  23:37:32  matt
11366  * Added prototype
11367  *
11368  * Revision 1.20  1994/10/07  16:02:53  matt
11369  * Loading saved game no longer clears players weapons & other stats
11370  *
11371  * Revision 1.19  1994/10/06  14:12:46  matt
11372  * Added flash effect when player appears
11373  *
11374  * Revision 1.18  1994/10/03  13:34:44  matt
11375  * Added new (and hopefully better) game sequencing functions
11376  *
11377  * Revision 1.17  1994/09/30  15:19:53  matt
11378  * Added new game sequencing functions, but left them disabled for now.
11379  *
11380  * Revision 1.16  1994/09/28  17:24:34  matt
11381  * Added first draft of game save/load system
11382  *
11383  * Revision 1.15  1994/09/27  12:29:42  matt
11384  * Changed level naming
11385  *
11386  * Revision 1.14  1994/09/02  11:53:55  mike
11387  * Rename init_player_stats to init_player_stats_game.
11388  *
11389  * Revision 1.13  1994/08/31  20:57:34  matt
11390  * Cleaned up endlevel/death code
11391  *
11392  * Revision 1.12  1994/08/23  18:45:06  yuan
11393  * Added level 10 capability.. (LEDGES)
11394  *
11395  * Revision 1.11  1994/08/18  10:47:38  john
11396  * Cleaned up game sequencing and player death stuff
11397  * in preparation for making the player explode into
11398  * pieces when dead.
11399  *
11400  * Revision 1.10  1994/08/15  15:24:45  john
11401  * Made players know who killed them; Disabled cheat menu
11402  * during net player; fixed bug with not being able to turn
11403  * of invulnerability; Made going into edit/starting new leve
11404  * l drop you out of a net game; made death dialog box.
11405  *
11406  * Revision 1.9  1994/08/13  12:20:56  john
11407  * Made the networking uise the Players array.
11408  *
11409  * Revision 1.8  1994/07/22  12:36:24  matt
11410  * Cleaned up editor/game interactions some more.
11411  *
11412  * Revision 1.7  1994/07/19  20:15:33  matt
11413  * Name for each level now saved in the .SAV file & stored in Current_level_name
11414  *
11415  * Revision 1.6  1994/07/02  13:49:33  matt
11416  * Cleaned up includes
11417  *
11418  * Revision 1.5  1994/07/02  13:09:52  matt
11419  * Moved player stats struct from gameseq.h to player.h
11420  *
11421  * Revision 1.4  1994/07/01  16:35:35  yuan
11422  * Added key system
11423  *
11424  * Revision 1.3  1994/06/26  14:07:35  matt
11425  * Added prototypes
11426  *
11427  * Revision 1.2  1994/06/24  17:03:56  john
11428  * Added VFX support. Also took all game sequencing stuff like
11429  * EndGame out and put it into gameseq.c
11430  *
11431  * Revision 1.1  1994/06/24  14:13:53  john
11432  * Initial revision
11433
11434 ------------------------------------------------------------------------
11435 main/gauges.c:
11436
11437  * Revision 1.15  1995/10/31  10:22:37  allender
11438  * shareware stuff
11439  *
11440  * Revision 1.14  1995/10/26  14:11:05  allender
11441  * do copy of weapon boxes in cockpit correctly
11442  *
11443  * Revision 1.13  1995/10/21  22:54:56  allender
11444  * fixed up player names on hud
11445  *
11446  * Revision 1.12  1995/10/12  17:39:27  allender
11447  * fixed status bar lives display
11448  *
11449  * Revision 1.11  1995/09/22  15:21:46  allender
11450  * fixed hud problems (reticle and kill lists) for
11451  * non pixel doubled mode
11452  *
11453  * Revision 1.10  1995/09/13  11:38:47  allender
11454  * show KB left in heap instead of piggy cache
11455  *
11456  * Revision 1.9  1995/09/04  15:52:28  allender
11457  * fix vulcan ammo count to update without overwritting itself
11458  *
11459  * Revision 1.8  1995/08/31  14:11:20  allender
11460  * worked on hud kill list for non pixel doubled mode
11461  *
11462  * Revision 1.7  1995/08/24  16:05:05  allender
11463  * more gauge placement -- still not done!
11464  *
11465  * Revision 1.6  1995/08/18  15:44:56  allender
11466  * put in PC gauges for keys, lives, and reticle when pixel doubling
11467  *
11468  * Revision 1.5  1995/08/18  10:24:47  allender
11469  * added proper support for cockpit mode -- still needs
11470  *
11471  * Revision 1.4  1995/07/26  16:56:34  allender
11472  * more gauge stuff for status bar.  still problem
11473  * with ship
11474  *
11475  * Revision 1.3  1995/07/17  08:55:57  allender
11476  * fix up for large status bar.  Still needs some work though
11477  *
11478  * Revision 1.2  1995/06/20  09:54:29  allender
11479  * stopgap measure to get status bar "working" until real mac
11480  * status bar gets added
11481  *
11482  * Revision 1.1  1995/05/16  15:26:05  allender
11483  * Initial revision
11484  *
11485  * Revision 2.7  1995/12/19  16:18:33  john
11486  * Made weapon info align with canvas width, not 315.
11487  *
11488  * Revision 2.6  1995/03/21  14:39:25  john
11489  * Ifdef'd out the NETWORK code.
11490  *
11491  * Revision 2.5  1995/03/14  12:31:25  john
11492  * Prevent negative shields from printing.
11493  *
11494  * Revision 2.4  1995/03/10  12:57:58  allender
11495  * move rear view text up four pixels up when playing back demo
11496  *
11497  * Revision 2.3  1995/03/09  11:47:51  john
11498  * Added HUD for VR helmets.
11499  *
11500  * Revision 2.2  1995/03/06  15:23:26  john
11501  * New screen techniques.
11502  *
11503  * Revision 2.1  1995/02/27  13:13:45  john
11504  * Removed floating point.
11505  *
11506  * Revision 2.0  1995/02/27  11:29:06  john
11507  * New version 2.0, which has no anonymous unions, builds with
11508  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11509  *
11510  * Revision 1.203  1995/02/11  01:56:45  mike
11511  * move up weapons text on fullscreen hud, missiles was offscreen.
11512  *
11513  * Revision 1.202  1995/02/09  13:23:34  rob
11514  * Added reticle names in demo playback.
11515  *
11516  * Revision 1.201  1995/02/08  19:20:46  rob
11517  * Show cloaked teammates on H
11518  * UD.  Get rid of show ID's in anarchy option.
11519  *
11520  * Revision 1.200  1995/02/07  21:09:00  mike
11521  * add flashing to invulnerability and cloak on fullscreen.
11522  *
11523  * Revision 1.199  1995/02/02  21:55:57  matt
11524  * Added new colored key icons for fullscreen
11525  *
11526  * Revision 1.198  1995/01/30  17:17:07  rob
11527  * Fixed teammate names on hud.
11528  *
11529  * Revision 1.197  1995/01/28  17:40:49  mike
11530  * fix gauge fontcolor.
11531  *
11532  * Revision 1.196  1995/01/27  17:03:14  mike
11533  * fix placement of weapon info in multiplayer fullscreen, as per AP request.
11534  *
11535  * Revision 1.195  1995/01/27  11:51:23  rob
11536  * Put deaths tally into cooperative mode
11537  *
11538  * Revision 1.194  1995/01/27  11:43:24  adam
11539  * fiddled with key display
11540  *
11541  * Revision 1.193  1995/01/25  23:38:35  mike
11542  * fix keys on fullscreen.
11543  *
11544  * Revision 1.192  1995/01/24  22:03:28  mike
11545  * Lotsa hud stuff, put a lot of messages up.
11546  *
11547  * Revision 1.191  1995/01/23  16:47:21  rob
11548  * Fixed problem with playing extra life noise in coop.
11549  *
11550  * Revision 1.190  1995/01/22  16:00:46  mike
11551  * remove unneeded string.
11552  *
11553  * Revision 1.189  1995/01/22  15:58:22  mike
11554  * localization
11555  *
11556  * Revision 1.188  1995/01/20  17:19:45  rob
11557  * Fixing colors of hud kill list players.
11558  *
11559  * Revision 1.187  1995/01/20  09:19:18  allender
11560  * record player flags when in CM_FULL_SCREEN
11561  *
11562  * Revision 1.186  1995/01/19  16:29:09  allender
11563  * made demo recording of weapon change be in this file for shareware only
11564  *
11565  * Revision 1.185  1995/01/19  15:00:33  allender
11566  * code to record shield, energy, and ammo in fullscreen
11567  *
11568  * Revision 1.184  1995/01/19  13:43:13  matt
11569  * Fixed "cheater" message on HUD
11570  *
11571  * Revision 1.183  1995/01/18  16:11:58  mike
11572  * Don't show added scores of 0.
11573  *
11574  * Revision 1.182  1995/01/17  17:42:39  allender
11575  * do ammo counts in demo recording
11576  *
11577  * Revision 1.181  1995/01/16  17:26:25  rob
11578  * Fixed problem with coloration of team kill list.
11579  *
11580  * Revision 1.180  1995/01/16  17:22:39  john
11581  * Made so that KB and framerate don't collide.
11582  *
11583  * Revision 1.179  1995/01/16  14:58:31  matt
11584  * Changed score_added display to print "Cheater!" when cheats enabled
11585  *
11586  * Revision 1.178  1995/01/15  19:42:07  matt
11587  * Ripped out hostage faces for registered version
11588  *
11589  * Revision 1.177  1995/01/15  19:25:07  mike
11590  * show vulcan ammo and secondary ammo in fullscreen view.
11591  *
11592  * Revision 1.176  1995/01/15  13:16:12  john
11593  * Made so that paging always happens, lowmem just loads less.
11594  * Also, make KB load print to hud.
11595  *
11596  * Revision 1.175  1995/01/14  19:17:32  john
11597  * First version of piggy paging.
11598  *
11599  * Revision 1.174  1995/01/05  21:25:23  rob
11600  * Re-did some changes lost due to RCS weirdness.
11601  *
11602  * Revision 1.173  1995/01/05  12:22:34  rob
11603  * Don't show player names for cloaked players.
11604  *
11605  * Revision 1.172  1995/01/04  17:14:50  allender
11606  * make init_gauges work properly on demo playback
11607  *
11608  * Revision 1.171  1995/01/04  15:04:42  allender
11609  * new demo calls for registered version
11610  *
11611  * Revision 1.167  1995/01/03  13:03:57  allender
11612  * pass score points instead of total points.   Added ifdef for
11613  * multi_send_score
11614  *
11615  * Revision 1.166  1995/01/03  11:45:02  allender
11616  * add hook to record player score
11617  *
11618  * Revision 1.165  1995/01/03  11:25:19  allender
11619  * remove newdemo stuff around score display
11620  *
11621  * Revision 1.163  1995/01/02  21:03:53  rob
11622  * Fixing up the hud-score-list for coop games.
11623  *
11624  * Revision 1.162  1994/12/31  20:54:40  rob
11625  * Added coop mode HUD score list.
11626  * Added more generic system for player names on HUD.
11627  *
11628  * Revision 1.161  1994/12/30  20:13:01  rob
11629  * Ifdef reticle names on shareware.
11630  * Added robot reticle naming.
11631  *
11632  * Revision 1.160  1994/12/29  17:53:51  mike
11633  * move up energy/shield in fullscreen to get out of way of kill list.
11634  *
11635  * Revision 1.159  1994/12/29  16:44:05  mike
11636  * add energy and shield showing.
11637  *
11638  * Revision 1.158  1994/12/28  16:34:29  mike
11639  * make warning beep go away on Player_is_dead.
11640  *
11641  * Revision 1.157  1994/12/28  10:00:43  allender
11642  * change in init_gauges to for multiplayer demo playbacks
11643  *
11644  * Revision 1.156  1994/12/27  11:06:46  allender
11645  * removed some previous code to for demo playback stuff
11646  *
11647  * Revision 1.155  1994/12/23  14:23:06  john
11648  * Added floating reticle for VR helments.
11649  *
11650  * Revision 1.154  1994/12/21  12:56:41  allender
11651  * on multiplayer demo playback, show kills and deaths
11652  *
11653  * Revision 1.153  1994/12/19  20:28:42  rob
11654  * Get rid of kill list in coop games.
11655  *
11656  * Revision 1.152  1994/12/14  18:06:44  matt
11657  * Removed compile warnings
11658  *
11659  * Revision 1.151  1994/12/14  15:21:28  rob
11660  * Made gauges align in status_bar net game.
11661  *
11662  * Revision 1.150  1994/12/12  17:20:33  matt
11663  * Don't get bonus points when cheating
11664  *
11665  * Revision 1.149  1994/12/12  16:47:00  matt
11666  * When cheating, get no score.  Change level cheat to prompt for and
11667  * jump to new level.
11668  *
11669  * Revision 1.148  1994/12/12  12:05:45  rob
11670  * Grey out players who are disconnected.
11671  *
11672  * Revision 1.147  1994/12/09  16:19:48  yuan
11673  * kill matrix stuff.
11674  *
11675  * Revision 1.146  1994/12/09  16:12:34  rob
11676  * Fixed up the status bar kills gauges for net play.
11677  *
11678  * Revision 1.145  1994/12/09  01:55:34  rob
11679  * Added kills list to HUD/status bar.
11680  * Added something for Mark.
11681  *
11682  * Revision 1.144  1994/12/08  21:03:30  allender
11683  * pass old player flags to record_player_flags
11684  *
11685  * Revision 1.143  1994/12/07  22:49:33  mike
11686  * no homing missile warning during endlevel sequence.
11687  *
11688  * Revision 1.142  1994/12/06  13:55:31  matt
11689  * Use new rounding func, f2ir()
11690  *
11691  * Revision 1.141  1994/12/03  19:03:37  matt
11692  * Fixed vulcan ammo HUD message
11693  *
11694  * Revision 1.140  1994/12/03  18:43:18  matt
11695  * Fixed (hopefully) claok gauge
11696  *
11697  * Revision 1.139  1994/12/03  14:26:21  yuan
11698  * Fixed dumb bug
11699  *
11700  * Revision 1.138  1994/12/03  14:17:30  yuan
11701  * Localization 320
11702
11703 ------------------------------------------------------------------------
11704 main/gauges.h:
11705
11706  * Revision 1.3  1995/08/23  21:37:13  allender
11707  * fix mcc compiler warmings
11708  *
11709  * Revision 1.2  1995/08/18  15:45:24  allender
11710  * upped max gauges
11711  *
11712  * Revision 1.1  1995/05/16  15:57:34  allender
11713  * Initial revision
11714  *
11715  * Revision 2.0  1995/02/27  11:28:45  john
11716  * New version 2.0, which has no anonymous unions, builds with
11717  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11718  *
11719  * Revision 1.27  1994/12/14  18:06:39  matt
11720  * Added prototype
11721  *
11722  * Revision 1.26  1994/12/09  16:19:52  yuan
11723  * kill matrix stuff.
11724  *
11725  * Revision 1.25  1994/10/25  11:07:34  mike
11726  * Prototype play_homing_warning.
11727  *
11728  * Revision 1.24  1994/10/24  16:34:39  mike
11729  * Increase MAX_GAUGE_BMS from 56 to 80...
11730  *
11731  * Revision 1.23  1994/10/21  20:43:47  mike
11732  * Prototype add_bonus_points_to_score.
11733  *
11734  * Revision 1.22  1994/10/14  15:56:33  mike
11735  * Prototype update_laser_weapon_info.
11736  *
11737  * Revision 1.21  1994/10/13  15:17:26  mike
11738  * Remove afterburner references.
11739  *
11740  * Revision 1.20  1994/10/05  17:09:46  matt
11741  * Added functional reticle
11742  *
11743  * Revision 1.19  1994/10/04  21:41:29  matt
11744  * Added cloaked player gauge effect, and different ship bitmap for each player
11745  *
11746  * Revision 1.18  1994/09/26  13:29:40  matt
11747  * Added extra life each 100,000 points, and show icons on HUD for num lives
11748  *
11749  * Revision 1.17  1994/09/20  11:56:08  matt
11750  * Added prototype
11751  *
11752  * Revision 1.16  1994/09/20  00:11:03  matt
11753  * Finished gauges for Status Bar, including hostage video display.
11754  *
11755  * Revision 1.15  1994/09/17  23:57:18  matt
11756  * Got some, but not all, off the status bar gauges working
11757  *
11758  * Revision 1.14  1994/09/16  13:08:46  mike
11759  * Prototype say_afterburner_status.
11760  *
11761  * Revision 1.13  1994/09/14  16:27:03  mike
11762  * Prototype player_dead_message();
11763  *
11764  *
11765  * Revision 1.12  1994/07/20  17:34:43  yuan
11766  * Some minor bug fixes and new key gauges...
11767  *
11768  * Revision 1.11  1994/07/14  14:46:02  yuan
11769  * Added score effect.
11770  *
11771  * Revision 1.10  1994/07/12  16:22:00  yuan
11772  * Increased number of maximum gauges.
11773  *
11774  * Revision 1.9  1994/07/11  20:10:36  yuan
11775  * Numerical gauges.
11776  *
11777  * Revision 1.8  1994/07/10  18:01:28  yuan
11778  * Added new gauges.
11779  *
11780  * Revision 1.7  1994/06/21  15:08:22  john
11781  * Made demo record HUD message and cleaned up the HUD code.
11782  *
11783  * Revision 1.6  1994/06/21  12:40:46  yuan
11784  * Fixing HUD message.
11785  *
11786  * Revision 1.5  1994/06/21  12:11:56  yuan
11787  * Fixed up menus and added HUDisplay messages.
11788  *
11789  * Revision 1.4  1994/04/28  21:34:24  mike
11790  * prototype check_erase_gauge
11791  *
11792  * Revision 1.3  1994/04/06  14:42:46  yuan
11793  * Adding new powerups.
11794  *
11795  * Revision 1.2  1993/12/05  22:48:58  matt
11796  * Reworked include files in an attempt to cut down on build times
11797  *
11798  * Revision 1.1  1993/12/05  21:07:55  matt
11799  * Initial revision
11800
11801 ------------------------------------------------------------------------
11802 main/hostage.c:
11803
11804  * Revision 1.1  1995/05/16  15:26:24  allender
11805  * Initial revision
11806  *
11807  * Revision 2.0  1995/02/27  11:28:36  john
11808  * New version 2.0, which has no anonymous unions, builds with
11809  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11810  *
11811  * Revision 1.65  1995/02/22  13:45:54  allender
11812  * remove anonymous unions from object structure
11813  *
11814  * Revision 1.64  1995/02/13  20:34:57  john
11815  * Lintized
11816  *
11817  * Revision 1.63  1995/01/15  19:41:48  matt
11818  * Ripped out hostage faces for registered version
11819  *
11820  * Revision 1.62  1995/01/14  19:16:53  john
11821  * First version of new bitmap paging code.
11822  *
11823  * Revision 1.61  1994/12/19  16:35:09  john
11824  * Made hoastage playback end when ship dies.
11825  *
11826  * Revision 1.60  1994/12/06  16:30:41  yuan
11827  * Localization
11828  *
11829  * Revision 1.59  1994/11/30  17:32:46  matt
11830  * Put hostage_face_clip array back in so editor would work
11831  *
11832  * Revision 1.58  1994/11/30  17:22:13  matt
11833  * Ripped out hostage faces in shareware version
11834  *
11835  * Revision 1.57  1994/11/30  16:11:25  matt
11836  * Use correct constant for hostage voice
11837  *
11838  * Revision 1.56  1994/11/27  23:15:19  matt
11839  * Made changes for new mprintf calling convention
11840  *
11841  * Revision 1.55  1994/11/19  19:53:44  matt
11842  * Added code to full support different hostage head clip & message for
11843  * each hostage.
11844  *
11845  * Revision 1.54  1994/11/19  16:35:15  matt
11846  * Got rid of unused code, & made an array smaller
11847  *
11848  * Revision 1.53  1994/11/14  12:42:03  matt
11849  * Increased palette flash when hostage rescued
11850  *
11851  * Revision 1.52  1994/10/28  14:43:09  john
11852  * Added sound volumes to all sound calls.
11853  *
11854  * Revision 1.51  1994/10/23  02:10:57  matt
11855  * Got rid of obsolete hostage_info stuff
11856  *
11857  * Revision 1.50  1994/10/22  00:08:44  matt
11858  * Fixed up problems with bonus & game sequencing
11859  * Player doesn't get credit for hostages unless he gets them out alive
11860  *
11861  * Revision 1.49  1994/10/20  22:52:49  matt
11862  * Fixed compiler warnings
11863  *
11864  * Revision 1.48  1994/10/20  21:25:44  matt
11865  * Took out silly scale down/scale up code for hostage anim
11866  *
11867  * Revision 1.47  1994/10/20  12:47:28  matt
11868  * Replace old save files (MIN/SAV/HOT) with new LVL files
11869  *
11870  * Revision 1.46  1994/10/04  15:33:33  john
11871  * Took out the old PLAY_SOUND??? code and replaced it
11872  * with direct calls into digi_link_??? so that all sounds
11873  * can be made 3d.
11874  *
11875  * Revision 1.45  1994/09/28  23:10:46  matt
11876  * Made hostage rescue do palette flash
11877  *
11878  * Revision 1.44  1994/09/20  00:11:00  matt
11879  * Finished gauges for Status Bar, including hostage video display.
11880  *
11881  * Revision 1.43  1994/09/15  21:24:19  matt
11882  * Changed system to keep track of whether & what cockpit is up
11883  * Made hostage clip not queue when no cockpit
11884  *
11885  *
11886  * Revision 1.42  1994/08/25  13:45:19  matt
11887  * Made hostage vclips queue
11888  *
11889  * Revision 1.41  1994/08/14  23:15:06  matt
11890  * Added animating bitmap hostages, and cleaned up vclips a bit
11891  *
11892  * Revision 1.40  1994/08/12  22:41:11  john
11893  * Took away Player_stats; add Players array.
11894  *
11895  * Revision 1.39  1994/07/14  22:06:35  john
11896  * Fix radar/hostage vclip conflict.
11897  *
11898  * Revision 1.38  1994/07/12  18:40:21  yuan
11899  * Tweaked location of radar and hostage screen...
11900  * Still needs work.
11901  *
11902  *
11903  * Revision 1.37  1994/07/07  09:52:17  john
11904  * Moved hostage screen.
11905  *
11906  * Revision 1.36  1994/07/06  15:23:52  john
11907  * Revamped hostage sound.
11908  *
11909  * Revision 1.35  1994/07/06  15:14:54  john
11910  * Added hostage sound effect picking.
11911  *
11912  * Revision 1.34  1994/07/06  13:25:33  john
11913  * Added compress hostages functions.
11914  *
11915  * Revision 1.33  1994/07/06  12:52:59  john
11916  * Fixed compiler warnings.
11917  *
11918  * Revision 1.32  1994/07/06  12:43:50  john
11919  * Made generic messages for hostages.
11920  *
11921  * Revision 1.31  1994/07/06  10:55:07  john
11922  * New structures for hostages.
11923  *
11924  * Revision 1.30  1994/07/05  12:49:09  john
11925  * Put functionality of New Hostage spec into code.
11926  *
11927  * Revision 1.29  1994/07/02  13:08:47  matt
11928  * Increment stats when hostage rescued
11929  *
11930  * Revision 1.28  1994/07/01  18:07:46  john
11931  * y
11932  *
11933  * Revision 1.27  1994/07/01  18:07:03  john
11934  * *** empty log message ***
11935  *
11936  * Revision 1.26  1994/07/01  17:55:26  john
11937  * First version of not-working hostage system.
11938  *
11939  * Revision 1.25  1994/06/27  15:53:21  john
11940  * #define'd out the newdemo stuff
11941  *
11942  *
11943  * Revision 1.24  1994/06/20  16:08:52  john
11944  * Added volume control; made doors 3d sounds.
11945  *
11946  * Revision 1.23  1994/06/16  10:15:32  yuan
11947  * Fixed location of face.
11948  *
11949  * Revision 1.22  1994/06/15  15:05:33  john
11950  * *** empty log message ***
11951  *
11952  * Revision 1.21  1994/06/14  21:15:20  matt
11953  * Made rod objects draw lighted or not depending on a parameter, so the
11954  * materialization effect no longer darkens.
11955  *
11956  * Revision 1.20  1994/06/08  18:16:26  john
11957  * Bunch of new stuff that basically takes constants out of the code
11958  * and puts them into bitmaps.tbl.
11959  *
11960  * Revision 1.19  1994/06/02  19:30:08  matt
11961  * Moved texture-mapped rod drawing stuff (used for hostage & now for the
11962  * materialization center) to object.c
11963
11964 ------------------------------------------------------------------------
11965 main/hostage.h:
11966
11967  * Revision 1.1  1995/05/16  15:57:57  allender
11968  * Initial revision
11969  *
11970  * Revision 2.0  1995/02/27  11:27:50  john
11971  * New version 2.0, which has no anonymous unions, builds with
11972  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11973  *
11974  * Revision 1.23  1995/01/15  19:42:06  matt
11975  * Ripped out hostage faces for registered version
11976  *
11977  * Revision 1.22  1994/12/19  16:35:07  john
11978  * Made hoastage playback end when ship dies.
11979  *
11980  * Revision 1.21  1994/11/30  17:22:12  matt
11981  * Ripped out hostage faces in shareware version
11982  *
11983  * Revision 1.20  1994/11/19  19:53:43  matt
11984  * Added code to full support different hostage head clip & message for
11985  * each hostage.
11986  *
11987  * Revision 1.19  1994/11/19  16:35:28  matt
11988  * Got rid of unused code, & made an array smaller
11989  *
11990  * Revision 1.18  1994/10/23  02:10:57  matt
11991  * Got rid of obsolete hostage_info stuff
11992  *
11993  * Revision 1.17  1994/09/20  00:10:37  matt
11994  * Finished gauges for Status Bar, including hostage video display.
11995  *
11996  * Revision 1.16  1994/09/01  10:41:24  matt
11997  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
11998  * correctly if width & height of bitmap are different.
11999  *
12000  * Revision 1.15  1994/08/14  23:15:14  matt
12001  * Added animating bitmap hostages, and cleaned up vclips a bit
12002  *
12003  * Revision 1.14  1994/07/14  22:06:51  john
12004  * Fix radar/hostage vclip conflict.
12005  *
12006  * Revision 1.13  1994/07/14  22:05:41  john
12007  * Made radar display not conflict with hostage
12008  * vclip talking.
12009  *
12010  * Revision 1.12  1994/07/06  13:41:46  matt
12011  * Added support for bitmap hostages
12012  *
12013  * Revision 1.11  1994/07/06  12:43:36  john
12014  * Made generic messages for hostages.
12015  *
12016  * Revision 1.10  1994/07/06  10:55:09  john
12017  * New structures for hostages.
12018  *
12019  * Revision 1.9  1994/07/05  12:48:47  john
12020  * Put functionality of New Hostage spec into code.
12021  *
12022  * Revision 1.8  1994/07/01  17:55:14  john
12023  * First version of not-working hostage system.
12024  *
12025  * Revision 1.7  1994/06/15  14:57:10  john
12026  * Added triggers to demo recording.
12027  *
12028  * Revision 1.6  1994/06/08  18:15:49  john
12029  * Bunch of new stuff that basically takes constants out of the code
12030  * and puts them into bitmaps.tbl.
12031  *
12032  * Revision 1.5  1994/05/02  12:43:06  yuan
12033  * Fixed warnings.
12034  *
12035  * Revision 1.4  1994/04/06  14:42:46  yuan
12036  * Adding new powerups.
12037  *
12038  * Revision 1.3  1994/04/01  11:15:14  yuan
12039  * Added multiple bitmap functionality to all objects...
12040  * (hostages, powerups, lasers, etc.)
12041  * Hostages and powerups are implemented in the object system,
12042  * just need to finish function call to "affect" player.
12043  *
12044  * Revision 1.2  1994/03/31  12:04:35  matt
12045  * Added prototypes for 2 funcs
12046  *
12047  * Revision 1.1  1994/03/31  11:39:24  matt
12048  * Initial revision
12049
12050 ------------------------------------------------------------------------
12051 main/hud.c:
12052
12053  * Revision 1.4  1995/08/24  16:03:09  allender
12054  * fix up message placement
12055  *
12056  * Revision 1.3  1995/08/18  10:25:21  allender
12057  * added support for pixel doubling using PC game font
12058  *
12059  * Revision 1.2  1995/08/12  11:33:22  allender
12060  * removed #ifdef NEWDEMO -- always in
12061  *
12062  * Revision 1.1  1995/05/16  15:26:32  allender
12063  * Initial revision
12064  *
12065  * Revision 2.2  1995/03/30  16:36:40  mike
12066  * text localization.
12067  *
12068  * Revision 2.1  1995/03/06  15:23:50  john
12069  * New screen techniques.
12070  *
12071  * Revision 2.0  1995/02/27  11:30:41  john
12072  * New version 2.0, which has no anonymous unions, builds with
12073  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12074  *
12075  * Revision 1.27  1995/01/23  16:51:30  mike
12076  * Show hud messages on 3d if window in three largest sizes.
12077  *
12078  * Revision 1.26  1995/01/17  17:42:45  rob
12079  * Made message timeout for HUD messages longer.
12080  *
12081  * Revision 1.25  1995/01/04  11:39:03  rob
12082  * Made HUD text get out of the way of large HUD messages.
12083  *
12084  * Revision 1.24  1995/01/01  14:20:32  rob
12085  * longer timer for hud messages.
12086  *
12087  *
12088  * Revision 1.23  1994/12/15  13:04:34  mike
12089  * Replace Players[Player_num].time_total references with GameTime.
12090  *
12091  * Revision 1.22  1994/12/13  12:55:12  mike
12092  * move press any key to continue message when you are dead to bottom of window.
12093  *
12094  * Revision 1.21  1994/12/07  17:08:01  rob
12095  * removed unnecessary debug info.
12096  *
12097  * Revision 1.20  1994/12/07  16:24:16  john
12098  * Took out code that kept track of messages differently for different
12099  * screen modes... I made it so they just draw differently depending on screen mode.
12100  *
12101  * Revision 1.19  1994/12/07  15:42:57  rob
12102  * Added a bunch of debug stuff to look for HUD message problems in net games...
12103  *
12104  * Revision 1.18  1994/12/06  16:30:35  yuan
12105  * Localization
12106  *
12107  * Revision 1.17  1994/12/05  00:32:36  mike
12108  * fix randomness of color on status bar hud messages.
12109  *
12110  * Revision 1.16  1994/11/19  17:05:53  rob
12111  * Moved dead_player_message down to avoid overwriting HUD messages.
12112  *
12113  * Revision 1.15  1994/11/18  23:37:56  john
12114  * Changed some shorts to ints.
12115  *
12116  * Revision 1.14  1994/11/12  16:38:25  mike
12117  * clear some annoying debug messages.
12118  *
12119  * Revision 1.13  1994/11/11  15:36:39  mike
12120  * write hud messages on background if 3d window small enough
12121  *
12122  * Revision 1.12  1994/10/20  09:49:31  mike
12123  * Reduce number of messages.
12124  *
12125  * Revision 1.11  1994/10/17  10:49:15  john
12126  * Took out some warnings.
12127  *
12128  * Revision 1.10  1994/10/17  10:45:13  john
12129  * Made the player able to abort death by pressing any button or key.
12130  *
12131  * Revision 1.9  1994/10/13  15:17:33  mike
12132  * Remove afterburner references.
12133  *
12134  * Revision 1.8  1994/10/11  12:06:32  mike
12135  * Only show message advertising death sequence abort after player exploded.
12136  *
12137  * Revision 1.7  1994/10/10  17:21:53  john
12138  * Made so instead of saying too many messages, it scrolls off the
12139  * oldest message.
12140  *
12141  * Revision 1.6  1994/10/07  23:05:39  john
12142  * Fixed bug with HUD not drawing stuff sometimes...
12143  * ( I had a circular buffer that I was stepping thru
12144  * to draw text that went: for (i=first;i<last;i++)...
12145  * duh!! last could be less than first.)
12146  * /
12147  *
12148  * Revision 1.5  1994/09/16  13:08:20  mike
12149  * Arcade stuff, afterburner stuff.
12150  *
12151  * Revision 1.4  1994/09/14  16:26:57  mike
12152  * player_dead_message.
12153  *
12154  * Revision 1.3  1994/08/18  16:35:45  john
12155  * Made gauges messages stay up a bit longer.
12156  *
12157  * Revision 1.2  1994/08/18  12:10:21  john
12158  * Made HUD messages scroll.
12159  *
12160  * Revision 1.1  1994/08/18  11:22:09  john
12161  * Initial revision
12162
12163 ------------------------------------------------------------------------
12164 main/inferno.c:
12165
12166  * Revision 1.1  1995/12/05  15:57:49  allender
12167  * Initial revision
12168  *
12169  * Revision 1.19  1995/11/07  17:03:12  allender
12170  * added splash screen for descent contest
12171  *
12172  * Revision 1.18  1995/10/31  10:22:22  allender
12173  * shareware stuff
12174  *
12175  * Revision 1.17  1995/10/18  01:53:07  allender
12176  * mouse click to leave do not distribute screen
12177  *
12178  * Revision 1.16  1995/10/17  12:00:12  allender
12179  * mouse click gets past endgame screen
12180  *
12181  * Revision 1.15  1995/10/12  17:40:12  allender
12182  * read config file after digi initialized
12183  *
12184  * Revision 1.14  1995/10/05  10:38:22  allender
12185  * changed key_getch at exit to be key_inkey and moved
12186  * mouse init until after macintosh windowing init call
12187  *
12188  * Revision 1.13  1995/09/18  17:01:04  allender
12189  * put gr_init call before render buffer stuff
12190  *
12191  * Revision 1.12  1995/08/31  15:50:53  allender
12192  * call init for appletalk, and change name of intro screens
12193  *
12194  * Revision 1.11  1995/08/26  16:26:19  allender
12195  * whole bunch 'o stuff!!
12196  *
12197  * Revision 1.10  1995/07/12  21:48:18  allender
12198  * removed Int3 from beginning of program
12199  *
12200  * Revision 1.9  1995/07/05  16:45:48  allender
12201  * removed hide_cursor call
12202  *
12203  * Revision 1.8  1995/06/20  16:44:57  allender
12204  * game now renders in 640x480 at all times.  Changed code
12205  * to call game_init_render_buffers with right params
12206  *
12207  * Revision 1.7  1995/06/13  13:07:55  allender
12208  * change macintosh initialzation.  Mac windows now init'ed through gr_init.
12209  *
12210  * Revision 1.6  1995/06/08  16:36:53  allender
12211  * "ifdef" profile include
12212  *
12213  * Revision 1.5  1995/06/07  08:08:18  allender
12214  * dont' make memory info show at end of program
12215  *
12216  * Revision 1.4  1995/06/02  07:47:40  allender
12217  * removed network initialzation for now
12218  *
12219  * Revision 1.3  1995/05/26  06:54:52  allender
12220  * put digi_init after timer and key stuff since I was testing stuff
12221  * that needed the keyboard handler installed
12222  *
12223  * Revision 1.2  1995/05/19  11:28:09  allender
12224  * removed printf
12225  *
12226  * Revision 1.1  1995/05/16  15:26:39  allender
12227  * Initial revision
12228  *
12229  * Revision 2.36  1996/01/05  16:52:16  john
12230  * Improved 3d stuff.
12231  *
12232  * Revision 2.35  1995/10/07  13:20:06  john
12233  * Added new modes for LCDBIOS, also added support for -JoyNice,
12234  * and added Shift+F1-F4 to controls various stereoscopic params.
12235  *
12236  * Revision 2.34  1995/06/26  11:30:57  john
12237  * Made registration/copyright screen go away after 5 minutes.
12238  *
12239  * Revision 2.33  1995/05/31  14:26:55  unknown
12240  * Fixed ugly spacing.
12241  *
12242  * Revision 2.32  1995/05/26  16:15:28  john
12243  * Split SATURN into define's for requiring cd, using cd, etc.
12244  * Also started adding all the Rockwell stuff.
12245  *
12246  * Revision 2.31  1995/05/11  13:30:01  john
12247  * Changed 3dbios detection to work like Didde Kim wanted it to.
12248  *
12249  * Revision 2.30  1995/05/08  13:53:50  john
12250  * Added code to read vipport environemnt variable.
12251  *
12252  * Revision 2.29  1995/05/08  11:26:18  john
12253  * Reversed eyes in 3dmax mode.
12254  *
12255  * Revision 2.28  1995/05/08  11:24:06  john
12256  * Made 3dmax work like Kasan wants it to.
12257  *
12258  * Revision 2.27  1995/04/23  16:06:25  john
12259  * Moved rinvul into modem/null modem menu.
12260  *
12261  * Revision 2.26  1995/04/12  13:39:26  john
12262  * Fixed bug with -lowmem not working.
12263  *
12264  * Revision 2.25  1995/04/09  14:43:00  john
12265  * Made Dynamic sockets not print Msockets for help.
12266  *
12267  * Revision 2.24  1995/04/07  16:11:33  john
12268  * Fixed problem with VFX display when using setup.
12269  *
12270  * Revision 2.23  1995/04/06  15:40:51  john
12271  * Synced VFX with setup #'s.
12272  *
12273  * Revision 2.22  1995/04/06  12:12:53  john
12274  * Fixed some bugs with 3dmax.
12275  *
12276  * Revision 2.21  1995/03/30  16:36:51  mike
12277  * text localization.
12278  *
12279  * Revision 2.20  1995/03/29  15:33:52  john
12280  * Added code to parse descent.net file.
12281  *
12282  * Revision 2.19  1995/03/28  20:08:21  john
12283  * Took away alternate server thing.
12284  *
12285  * Revision 2.18  1995/03/27  09:43:08  john
12286  * Added VR Settings in config file.
12287  *
12288  * Revision 2.17  1995/03/23  19:02:21  john
12289  * Added descent.net file use.
12290  *
12291  * Revision 2.16  1995/03/23  12:25:11  john
12292  * Moved IPX stuff into BIOS lib.
12293  *
12294  * Revision 2.15  1995/03/21  16:52:34  john
12295  * Added 320x100.
12296  *
12297  * Revision 2.14  1995/03/21  14:40:33  john
12298  * Ifdef'd out the NETWORK code.
12299  *
12300  * Revision 2.13  1995/03/16  23:13:35  john
12301  * Fixed bug with piggy paging in bitmap not checking for disk
12302  * error, hence bogifying textures if you pull the CD out.
12303  *
12304  * Revision 2.12  1995/03/16  21:45:22  john
12305  * Made all paged modes have incompatible menus!
12306  *
12307  * Revision 2.11  1995/03/15  15:19:34  john
12308  * Took out code that changes to exe dir.
12309  *
12310  * Revision 2.10  1995/03/15  14:33:37  john
12311  * Added code to force the Descent CD-rom in the drive.
12312  *
12313  * Revision 2.9  1995/03/15  11:41:27  john
12314  * Better Saturn CD-ROM support.
12315  *
12316  * Revision 2.8  1995/03/14  18:24:46  john
12317  * Force Destination Saturn to use CD-ROM drive.
12318  *
12319  * Revision 2.7  1995/03/14  16:22:35  john
12320  * Added cdrom alternate directory stuff.
12321  *
12322  * Revision 2.6  1995/03/13  15:17:19  john
12323  * Added alternate hogfile directory.
12324  *
12325  * Revision 2.5  1995/03/10  13:05:35  john
12326  * Added code so that palette is correct for VFX1 helmets.
12327  *
12328  * Revision 2.4  1995/03/07  15:12:43  john
12329  * Fixed VFX,3dmax support.
12330  *
12331  * Revision 2.3  1995/03/07  14:19:35  mike
12332  * More destination saturn stuff.
12333  *
12334  * Revision 2.2  1995/03/06  16:47:34  mike
12335  * destination saturn
12336  *
12337  * Revision 2.1  1995/03/06  15:24:06  john
12338  * New screen techniques.
12339  *
12340  * Revision 2.0  1995/02/27  11:31:29  john
12341  * New version 2.0, which has no anonymous unions, builds with
12342  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12343  *
12344  * Revision 1.295  1995/02/23  12:02:14  john
12345  * Made mono  windows smaller.
12346  *
12347  * Revision 1.294  1995/02/16  17:35:00  john
12348  * Added code to allow dynamic socket changing.
12349  *
12350  * Revision 1.293  1995/02/14  19:29:29  john
12351  * Locked down critical error handler.
12352  *
12353  * Revision 1.292  1995/02/14  15:29:20  john
12354  * Added CR-LF to last line of menu help text.
12355  *
12356  * Revision 1.291  1995/02/14  11:39:01  john
12357  * Added polled/bios joystick readers.
12358  *
12359  * Revision 1.290  1995/02/13  20:35:03  john
12360  * Lintized
12361  *
12362  * Revision 1.289  1995/02/11  16:20:02  john
12363  * Added code to make the default mission be the one last played.
12364  *
12365  * Revision 1.288  1995/02/11  15:54:13  rob
12366  * changed cinvul to rinvul.
12367  *
12368  * Revision 1.287  1995/02/11  14:48:43  rob
12369  * Added max of 314 seconds to control invul. times
12370  *
12371  * Revision 1.286  1995/02/11  12:42:01  john
12372  * Added new song method, with FM bank switching..
12373  *
12374  * Revision 1.285  1995/02/11  11:36:11  rob
12375  * Added cinvul option.
12376  *
12377  * Revision 1.284  1995/02/10  16:07:45  matt
12378  * Took 'registered' out of printed info at startup
12379  *
12380  * Revision 1.283  1995/02/09  22:00:59  john
12381  * Added i-glasses tracking.
12382  *
12383  * Revision 1.282  1995/02/02  11:11:27  john
12384  * Added -nocyberman switch.
12385  *
12386  * Revision 1.281  1995/02/01  16:35:14  john
12387  * Linted.
12388  *
12389  * Revision 1.280  1995/01/31  02:04:25  matt
12390  * Fixed up cmdline help
12391  *
12392  * Revision 1.279  1995/01/30  16:25:55  john
12393  * Put back in graphical screen at program end.
12394  *
12395  * Revision 1.278  1995/01/28  17:05:50  matt
12396  * Changed imbedded copyright to use comma instead of hyphen
12397  *
12398  * Revision 1.277  1995/01/28  15:57:26  john
12399  * Made joystick calibration be only when wrong detected in
12400  * menu or joystick axis changed.
12401  *
12402  * Revision 1.276  1995/01/25  14:37:49  john
12403  * Made joystick only prompt for calibration once...
12404  *
12405  * Revision 1.275  1995/01/24  18:21:00  john
12406  * Added Adam's text warning.
12407  *
12408  * Revision 1.274  1995/01/22  15:57:20  john
12409  * Took out code that printed warning out as game exited.
12410  *
12411  * Revision 1.273  1995/01/22  13:31:35  matt
12412  * Added load of mission 0, so there's always a default mission
12413  *
12414  * Revision 1.272  1995/01/19  17:00:41  john
12415  * Made save game work between levels.
12416  *
12417  * Revision 1.271  1995/01/18  11:47:57  adam
12418  * changed copyright notice
12419  *
12420  * Revision 1.270  1995/01/15  13:42:42  john
12421  * Moved low_mem cutoff higher.
12422  *
12423  * Revision 1.269  1995/01/12  18:53:50  john
12424  * Put ifdef EDITOR around the code that checked for
12425  * a 800x600 mode, because this trashed some people's
12426  * computers (maybe) causing the mem allocation error in
12427  * mouse.c that many users reported.
12428  *
12429  * Revision 1.268  1995/01/12  11:41:42  john
12430  * Added external control reading.
12431  *
12432  * Revision 1.267  1995/01/06  10:26:55  john
12433  * Added -nodoscheck command line switch.
12434  *
12435  * Revision 1.266  1995/01/05  16:59:30  yuan
12436  * Don't show orderform in editor version.
12437  *
12438  * Revision 1.265  1994/12/28  15:33:51  john
12439  * Added -slowjoy option.
12440  *
12441  * Revision 1.264  1994/12/15  16:44:15  matt
12442  * Added trademark notice
12443  *
12444  * Revision 1.263  1994/12/14  20:13:59  john
12445  * Reduced physical mem requments to 2 MB.
12446  *
12447  * Revision 1.262  1994/12/14  19:06:17  john
12448  * Lowered physical memory requments to 2 MB.
12449  *
12450  * Revision 1.261  1994/12/14  09:41:29  allender
12451  * change to drive and directory (if needed) of command line invocation
12452  * so descent can be started from anywhere
12453  *
12454  * Revision 1.260  1994/12/13  19:08:59  john
12455  * Updated memory requirements.
12456  *
12457  * Revision 1.259  1994/12/13  17:30:33  john
12458  * Made the timer rate be changed right after initializing it.
12459  *
12460  * Revision 1.258  1994/12/13  02:46:25  matt
12461  * Added imbedded copyright
12462  *
12463  * Revision 1.257  1994/12/13  02:06:46  john
12464  * Added code to check stack used by descent... initial
12465  * check showed stack used 35k/50k, so we decided it wasn't
12466  * worth pursuing any more.
12467  *
12468  * Revision 1.256  1994/12/11  23:17:54  john
12469  * Added -nomusic.
12470  * Added RealFrameTime.
12471  * Put in a pause when sound initialization error.
12472  * Made controlcen countdown and framerate use RealFrameTime.
12473  *
12474  * Revision 1.255  1994/12/10  00:56:51  matt
12475  * Added -nomusic to command-line help
12476  *
12477  * Revision 1.254  1994/12/08  11:55:11  john
12478  * Took out low memory print.
12479  *
12480  * Revision 1.253  1994/12/08  11:51:00  john
12481  * Made strcpy only copy corect number of chars,.
12482  *
12483  * Revision 1.252  1994/12/08  00:38:29  matt
12484  * Cleaned up banner messages
12485  *
12486  * Revision 1.251  1994/12/07  19:14:52  matt
12487  * Cleaned up command-line options and command-line help message
12488  *
12489  * Revision 1.250  1994/12/06  19:33:28  john
12490  * Fixed text of message to make more sense.
12491  *
12492  * Revision 1.249  1994/12/06  16:30:55  john
12493  * Neatend mem message,..
12494  *
12495  * Revision 1.248  1994/12/06  16:17:35  john
12496  * Added better mem checking/printing.
12497  *
12498  * Revision 1.247  1994/12/06  14:14:37  john
12499  * Added code to set low mem based on memory.
12500  *
12501  * Revision 1.246  1994/12/05  12:29:09  allender
12502  * removed ifdefs around -norun option
12503  *
12504  * Revision 1.245  1994/12/05  00:03:30  matt
12505  * Added -norun option to exit after writing pig
12506  *
12507  * Revision 1.244  1994/12/04  14:47:01  john
12508  * MAde the intro and menu be the same song.
12509  *
12510  * Revision 1.243  1994/12/04  14:36:42  john
12511  * Added menu music.
12512  *
12513  * Revision 1.242  1994/12/02  13:50:17  yuan
12514  * Localization.
12515  *
12516  * Revision 1.241  1994/12/01  17:28:30  adam
12517  * added end-shareware stuff
12518  *
12519  * Revision 1.240  1994/11/30  12:10:57  adam
12520  * added support for PCX titles/brief screens
12521  *
12522  * Revision 1.239  1994/11/29  15:47:33  matt
12523  * Moved error_init to start of game, so error message prints last
12524  *
12525  * Revision 1.238  1994/11/29  14:19:22  jasen
12526  * reduced dos mem requirments.
12527  *
12528  * Revision 1.237  1994/11/29  03:46:35  john
12529  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
12530  * command line arg.
12531  *
12532  * Revision 1.236  1994/11/29  02:50:18  john
12533  * Increased the amount a joystick has to be off before
12534  * asking if they want to recalibrate their joystick.
12535  *
12536  * Revision 1.235  1994/11/29  02:01:29  john
12537  * Corrected some of the Descent command line help items.
12538  *
12539  * Revision 1.234  1994/11/29  01:39:56  john
12540  * Fixed minor bug with vfx_light help not wrapping correctly.
12541  *
12542  * Revision 1.233  1994/11/28  21:34:17  john
12543  * Reduced dos mem rqment to 70k.
12544  *
12545  * Revision 1.232  1994/11/28  21:20:38  john
12546  * First version with memory checking.
12547  *
12548  * Revision 1.231  1994/11/28  20:06:21  rob
12549  * Removed old serial param command line options.
12550  * Added -noserial and -nonetwork to help listing.
12551  *
12552  * Revision 1.230  1994/11/27  23:15:24  matt
12553  * Made changes for new mprintf calling convention
12554  *
12555  * Revision 1.229  1994/11/27  20:50:51  matt
12556  * Don't set mem stuff if no debug
12557  *
12558  * Revision 1.228  1994/11/27  18:46:21  matt
12559  * Cleaned up command-line switches a little
12560  *
12561  * Revision 1.227  1994/11/21  17:48:00  matt
12562  * Added text to specifiy whether shareware or registered version
12563  *
12564  * Revision 1.226  1994/11/21  14:44:20  john
12565  * Fixed some bugs with setting volumes even when -nosound was used. Duh!
12566  *
12567  * Revision 1.225  1994/11/21  13:53:42  matt
12568  * Took out dos extender copyright
12569  *
12570  * Revision 1.224  1994/11/21  09:46:54  john
12571  * Added -showmeminfo parameter.
12572  *
12573  * Revision 1.223  1994/11/20  22:12:05  mike
12574  * Make some stuff dependent on SHAREWARE.
12575  *
12576  * Revision 1.222  1994/11/20  21:14:09  john
12577  * Changed -serial to -noserial.  MAde a 1 sec delay
12578  * before leaving title screen.  Clear keyboard buffer
12579  * before asking for player name.
12580  *
12581  * Revision 1.221  1994/11/19  15:20:20  mike
12582  * rip out unused code and data
12583  *
12584  * Revision 1.220  1994/11/17  19:14:29  adam
12585  * prevented order screen from coming up when -notitles is used
12586  *
12587  * Revision 1.219  1994/11/16  11:34:39  john
12588  * Added -nottitle switch.
12589  *
12590  * Revision 1.218  1994/11/16  10:05:53  john
12591  * Added verbose messages.
12592  *
12593  * Revision 1.217  1994/11/15  20:12:34  john
12594  * Added back in inferno and parallax screens.
12595  *
12596  * Revision 1.216  1994/11/15  18:35:30  john
12597  * Added verbose setting.
12598  *
12599  * Revision 1.215  1994/11/15  17:47:44  john
12600  * Added ordering info screen.
12601  *
12602  * Revision 1.214  1994/11/15  08:57:44  john
12603  * Added MS-DOS version checking and -nonetwork option.
12604  *
12605  * Revision 1.213  1994/11/15  08:34:32  john
12606  * Added better error messages for IPX init.
12607  *
12608  * Revision 1.212  1994/11/14  20:14:18  john
12609  * Fixed some warnings.
12610  *
12611  * Revision 1.211  1994/11/14  19:50:49  john
12612  * Added joystick cal values to descent.cfg.
12613  *
12614  * Revision 1.210  1994/11/14  17:56:44  allender
12615  * make call to ReadConfigFile at startup
12616  *
12617  * Revision 1.209  1994/11/14  11:41:55  john
12618  * Fixed bug with editor/game sequencing.
12619  *
12620  * Revision 1.208  1994/11/13  17:05:11  john
12621  * Made the callsign entry be a list box and gave the ability
12622  * to delete players.
12623  *
12624  * Revision 1.207  1994/11/13  15:39:22  john
12625  * Added critical error handler to game.  Took out -editor command line
12626  * option because it didn't work anymore and wasn't worth fixing.  Made scores
12627  * not use MINER enviroment variable on release version, and made scores
12628  * not print an error if there is no descent.hi.
12629  *
12630  * Revision 1.206  1994/11/10  20:53:29  john
12631  * Used new sound install parameters.
12632  *
12633  * Revision 1.205  1994/11/10  11:07:52  mike
12634  * Set default detail level.
12635  *
12636  * Revision 1.204  1994/11/09  13:45:43  matt
12637  * Made -? work again for help
12638  *
12639  * Revision 1.203  1994/11/09  10:55:58  matt
12640  * Cleaned up initialization for editor -> game transitions
12641  *
12642  * Revision 1.202  1994/11/07  21:35:47  matt
12643  * Use new function iff_read_into_bitmap()
12644  *
12645  * Revision 1.201  1994/11/05  17:22:16  john
12646  * Fixed lots of sequencing problems with newdemo stuff.
12647  *
12648  * Revision 1.200  1994/11/05  14:05:44  john
12649  * Fixed fade transitions between all screens by making
12650  * gr_palette_fade_in and out keep track of whether the palette is
12651  * faded in or not.  Then, wherever the code needs to fade out, it
12652  * just calls gr_palette_fade_out and it will fade out if it isn't
12653  * already.  The same with fade_in.
12654  * This eliminates the need for all the flags like Menu_fade_out,
12655  * game_fade_in palette, etc.
12656  *
12657  * Revision 1.199  1994/11/04  14:36:30  allender
12658  * change Auto_demo meaning to mean autostart from menu only.  Use
12659  * FindArgs when searching for AutoDemo from command line.  also,
12660  * set N_Players to 1 when starting in editor mode.
12661  *
12662  * Revision 1.198  1994/11/02  11:59:49  john
12663  * Moved menu out of game into inferno main loop.
12664  *
12665  * Revision 1.197  1994/11/01  17:57:39  mike
12666  * -noscreens option to bypass all screens.
12667  *
12668  * Revision 1.196  1994/10/28  15:42:34  allender
12669  * don't register player if Autodemo is on
12670  *
12671  * Revision 1.195  1994/10/28  10:58:01  matt
12672  * Added copyright notice for DOS4GW
12673  *
12674  * Revision 1.194  1994/10/20  21:26:48  matt
12675  * Took out old serial name/number code, and put up message if this
12676  * is a marked version.
12677  *
12678  * Revision 1.193  1994/10/19  09:52:14  allender
12679  * Print out who descent.exe belongs to if descent.exe is stamped.
12680  *
12681  * Revision 1.192  1994/10/18  16:43:05  allender
12682  * Added check for identifier stamp and time after which descent will
12683  * no longer run.
12684  *
12685  * Revision 1.191  1994/10/17  13:07:17  john
12686  * Moved the descent.cfg info into the player config file.
12687  *
12688  * Revision 1.190  1994/10/04  10:26:31  matt
12689  * Support new menu fade in
12690  *
12691  * Revision 1.189  1994/10/03  22:58:46  matt
12692  * Changed some values of game_mode
12693  *
12694  * Revision 1.188  1994/10/03  18:55:39  rob
12695  * Changed defaults for com port settings.
12696  *
12697  * Revision 1.187  1994/10/03  13:34:47  matt
12698  * Added new (and hopefully better) game sequencing functions
12699  *
12700  * Revision 1.186  1994/09/30  12:37:28  john
12701  * Added midi,digi volume to configuration.
12702  *
12703  * Revision 1.185  1994/09/30  10:08:48  john
12704  * Changed sound stuff... made it so the reseting card doesn't hang,
12705  * made volume change only if sound is installed.
12706  *
12707  * Revision 1.184  1994/09/28  17:25:00  matt
12708  * Added first draft of game save/load system
12709  *
12710  * Revision 1.183  1994/09/28  16:18:23  john
12711  * Added capability to play midi song.
12712  *
12713  * Revision 1.182  1994/09/28  11:31:18  john
12714  * Made text output unbuffered.
12715  *
12716  * Revision 1.181  1994/09/27  19:23:44  john
12717  * Added -nojoystick and -nomouse
12718  *
12719  * Revision 1.180  1994/09/24  16:55:29  rob
12720  * No longer open COM port immediately upon program start.
12721  * No longer set Network_active is serial_active is set.
12722  *
12723  * Revision 1.179  1994/09/24  14:16:30  mike
12724  * Support new game mode constants.
12725  *
12726  * Revision 1.178  1994/09/22  17:52:31  rob
12727  * Added Findargs hooks for -serial, -speed, and -com.
12728  *
12729  * Revision 1.177  1994/09/22  16:14:11  john
12730  * Redid intro sequecing.
12731  *
12732  * Revision 1.176  1994/09/21  16:32:58  john
12733  * Made mouse and keyboard init after bm_init. Why?
12734  * Because it seems to work better under virtual
12735  * memory.
12736  *
12737  * Revision 1.175  1994/09/21  16:27:52  john
12738  * Added mouse_init
12739  *
12740  * Revision 1.174  1994/09/20  15:14:10  matt
12741  * New message for new VFX switches
12742  *
12743  * Revision 1.173  1994/09/16  16:14:27  john
12744  * Added acrade sequencing.
12745  *
12746  * Revision 1.172  1994/09/16  11:49:52  john
12747  * Added first version of arcade joystick support;
12748  * Also fixed some bugs in kconfig.c, such as reading non-present
12749  * joysticks, which killed frame rate, and not reading key_down_time
12750  * when in slide mode or bank mode.
12751  *
12752  * Revision 1.171  1994/09/15  16:11:35  john
12753  * Added support for VFX1 head tracking. Fixed bug with memory over-
12754  * write when using stereo mode.
12755  *
12756  * Revision 1.170  1994/09/12  19:38:23  john
12757  * Made some stuff that prints to the DOS screen go to the
12758  * mono instead, since it really is debugging info.
12759  *
12760  * Revision 1.169  1994/08/29  21:18:28  john
12761  * First version of new keyboard/oystick remapping stuff.
12762  *
12763  * Revision 1.168  1994/08/26  13:02:00  john
12764  * Put high score system in.
12765  *
12766  * Revision 1.167  1994/08/24  19:00:23  john
12767  * Changed key_down_time to return fixed seconds instead of
12768  * milliseconds.
12769  *
12770  * Revision 1.166  1994/08/18  16:24:20  john
12771  * changed socket to channel in text.
12772  *
12773  * Revision 1.165  1994/08/18  16:16:51  john
12774  * Added support for different sockets.
12775  *
12776  * Revision 1.164  1994/08/18  10:47:53  john
12777  * *** empty log message ***
12778  *
12779  * Revision 1.163  1994/08/12  09:15:54  john
12780  * *** empty log message ***
12781  *
12782  * Revision 1.162  1994/08/12  03:11:19  john
12783  * Made network be default off; Moved network options into
12784  * main menu.  Made starting net game check that mines are the
12785  * same.
12786  *
12787  * Revision 1.161  1994/08/10  19:57:05  john
12788  * Changed font stuff; Took out old menu; messed up lots of
12789  * other stuff like game sequencing messages, etc.
12790  *
12791  * Revision 1.160  1994/08/05  16:30:23  john
12792  * Added capability to turn off network.
12793  *
12794  * Revision 1.159  1994/08/04  19:42:51  matt
12795  * Moved serial number & name (and version name) from inferno.c to inferno.ini
12796  *
12797  * Revision 1.158  1994/08/03  10:30:23  matt
12798  * Change cybermaxx switches, updated command-line help, and added serial number system
12799  *
12800  * Revision 1.157  1994/07/29  18:30:10  matt
12801  * New parms (lack of parms, actually) for g3_init()
12802  *
12803  * Revision 1.156  1994/07/24  00:39:25  matt
12804  * Added more text to TEX file; make NewGame() take a start level; made game
12805  * load/save menus use open/close window funcs.
12806  *
12807  * Revision 1.155  1994/07/21  21:31:27  john
12808  * First cheapo version of VictorMaxx tracking.
12809  *
12810  * Revision 1.154  1994/07/21  18:15:34  matt
12811  * Ripped out a bunch of unused stuff
12812  *
12813  * Revision 1.153  1994/07/21  17:59:10  matt
12814  * Cleaned up initial mode game/editor code
12815  *
12816  * Revision 1.152  1994/07/21  13:11:19  matt
12817  * Ripped out remants of old demo system, and added demo only system that
12818  * disables object movement and game options from menu.
12819  *
12820  * Revision 1.151  1994/07/20  15:58:27  john
12821  * First installment of ipx stuff.
12822  *
12823  * Revision 1.150  1994/07/15  16:04:24  matt
12824  * Changed comment for milestone 3 version
12825  *
12826  * Revision 1.149  1994/07/15  13:59:24  matt
12827  * Fixed stupid mistake I make in the last revision
12828  *
12829  * Revision 1.148  1994/07/15  13:20:15  matt
12830  * Updated comand-line help
12831  *
12832  * Revision 1.147  1994/07/14  23:29:43  matt
12833  * Open two mono debug messages, one for errors & one for spew
12834  *
12835  * Revision 1.146  1994/07/09  22:48:05  matt
12836  * Added localizable text
12837  *
12838  * Revision 1.145  1994/07/02  13:49:47  matt
12839  * Cleaned up includes
12840  *
12841  * Revision 1.144  1994/06/30  20:04:43  john
12842  * Added -joydef support.
12843  *
12844  * Revision 1.143  1994/06/24  17:01:44  john
12845  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
12846  * took it out of game.c and into gameseq.c
12847
12848 ------------------------------------------------------------------------
12849 main/joydefs.c:
12850
12851  * Revision 1.10  1995/10/18  22:21:21  allender
12852  * fixed bug with gravis mousestick and call key_flush when
12853  * calibrating joystick since it used keystrokes for the trigger
12854  * (at least most of them do)
12855  *
12856  * Revision 1.9  1995/10/17  13:12:32  allender
12857  * fixed up controller support for mac world
12858  *
12859  * Revision 1.8  1995/10/15  19:27:04  allender
12860  * new Dave Denhart controller code
12861  *
12862  * Revision 1.7  1995/10/15  16:14:59  allender
12863  * fixed axis value for Thrustmaster rudders
12864  *
12865  * Revision 1.6  1995/09/13  11:39:39  allender
12866  * made joystick cal menu all text so buttons will work properly
12867  *
12868  * Revision 1.5  1995/09/01  13:13:13  allender
12869  * added close box on controls menu
12870  *
12871  * Revision 1.4  1995/08/18  10:22:47  allender
12872  * if thrustmaster choosen, set joystick at thrustmaster type
12873  * for proper reading in joyc.c
12874  *
12875  * Revision 1.3  1995/07/26  17:00:34  allender
12876  * put back in code to make joysticks work
12877  *
12878  * Revision 1.2  1995/07/17  08:52:21  allender
12879  * put back in code that was taken out previously
12880  *
12881  * Revision 1.1  1995/05/16  15:26:48  allender
12882  * Initial revision
12883  *
12884  * Revision 2.2  1995/06/30  12:30:22  john
12885  * Added -Xname command line.
12886  *
12887  * Revision 2.1  1995/04/06  12:13:20  john
12888  * Made so you can calibrate Gravis Gamepad.
12889  *
12890  * Revision 2.0  1995/02/27  11:30:27  john
12891  * New version 2.0, which has no anonymous unions, builds with
12892  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12893  *
12894  * Revision 1.71  1995/02/12  02:06:10  john
12895  * Fixed bug with joystick incorrectly asking for
12896  * calibration.
12897  *
12898  * Revision 1.70  1995/01/28  15:58:07  john
12899  * Made joystick calibration be only when wrong detected in
12900  * menu or joystick axis changed.
12901  *
12902  * Revision 1.69  1995/01/25  14:37:55  john
12903  * Made joystick only prompt for calibration once...
12904  *
12905  * Revision 1.68  1995/01/24  16:34:29  john
12906  * Made so that if you reconfigure joystick and
12907  * add or subtract an axis, it asks for a recalibration
12908  * upon leaving.
12909  *
12910  * Revision 1.67  1994/12/29  11:08:51  john
12911  * Fixed Thrustmaster and Logitech Wingman extreme
12912  * Hat by reading the y2 axis during the center stage
12913  * of the calibration, and using 75, 50, 27, and 3 %
12914  * as values for the 4 positions.
12915  *
12916  * Revision 1.66  1994/12/15  18:17:39  john
12917  * Fixed warning with previous.
12918  *
12919  * Revision 1.65  1994/12/15  18:15:48  john
12920  * Made the joy cal only write the .cfg file, not
12921  * the player file.
12922  *
12923  * Revision 1.64  1994/12/13  14:43:35  john
12924  * Took out the code in kconfig to build direction array.
12925  * Called kc_set_controls after selecting a new control type.
12926  *
12927  * Revision 1.63  1994/12/10  12:08:47  john
12928  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
12929  *
12930  * Revision 1.62  1994/12/09  11:01:07  mike
12931  * force calibration of joystick on joystick selection from Controls... menu.
12932  *
12933  * Revision 1.61  1994/12/07  21:50:27  john
12934  * Put stop/start time around joystick delay.
12935  *
12936  * Revision 1.60  1994/12/07  19:34:39  john
12937  * Added delay.
12938  *
12939  * Revision 1.59  1994/12/07  18:12:14  john
12940  * NEatened up joy cal.,
12941  *
12942  * Revision 1.58  1994/12/07  17:07:51  john
12943  * Fixed up joy cal.
12944  *
12945  * Revision 1.57  1994/12/07  16:48:53  yuan
12946  * localization
12947  *
12948  * Revision 1.56  1994/12/07  16:05:55  john
12949  * Changed the way joystick calibration works.
12950  *
12951  * Revision 1.55  1994/12/06  20:15:22  john
12952  * Took out code that unpauses songs that were never paused.
12953  *
12954  * Revision 1.54  1994/12/06  15:14:09  yuan
12955  * Localization
12956  *
12957  * Revision 1.53  1994/12/05  16:29:16  john
12958  * Took out music pause around the cheat menu.
12959  *
12960  * Revision 1.52  1994/12/04  12:39:10  john
12961  * MAde so that FCS calibration doesn't ask for axis #2.
12962  *
12963  * Revision 1.51  1994/12/03  15:14:59  john
12964  * Took out the delay mentioned previosuly cause it would
12965  * cause bigger problems than it helps, especially with netgames.
12966  *
12967  * Revision 1.50  1994/12/03  14:16:14  john
12968  * Put a delay between screens in joy cal to keep Yuan from
12969  * double hitting.
12970  *
12971  * Revision 1.49  1994/12/03  11:04:06  john
12972  * Changed newmenu code a bit to fix bug with bogus
12973  * backgrounds occcasionally.
12974  *
12975  * Revision 1.48  1994/12/02  11:03:44  yuan
12976  * Localization.
12977  *
12978  * Revision 1.47  1994/12/02  10:50:33  yuan
12979  * Localization
12980  *
12981  * Revision 1.46  1994/12/01  12:21:59  john
12982  * Added code to calibrate 2 joysticks separately.
12983  *
12984  * Revision 1.45  1994/12/01  11:52:31  john
12985  * Added message when you select FCS to say that if
12986  * you have WCS, see manuel.
12987  *
12988  * Revision 1.44  1994/11/29  02:26:28  john
12989  * Made the prompts for upper-left, lower right for joy
12990  * calibration more obvious.
12991  *
12992  * Revision 1.43  1994/11/26  13:13:59  matt
12993  * Changed "none" option to "keyboard only"
12994  *
12995  * Revision 1.42  1994/11/21  19:35:13  john
12996  * Replaced calls to joy_init with if (joy_present)
12997  *
12998  * Revision 1.41  1994/11/21  19:28:34  john
12999  * Changed warning for no joystick to use nm_messagebox..
13000  *
13001  * Revision 1.40  1994/11/21  19:06:25  john
13002  * Made it so that it only stops sound when your in game mode.
13003  *
13004  * Revision 1.39  1994/11/21  11:47:18  john
13005  * Made sound pause during joystick calibration.
13006  *
13007  * Revision 1.38  1994/11/10  20:34:18  rob
13008  * Removed menu-specific network mode support in favor in new stuff
13009  * in newmenu.c
13010  *
13011  * Revision 1.37  1994/11/08  21:21:38  john
13012  * Made Esc exit joystick calibration.
13013  *
13014  * Revision 1.36  1994/11/08  15:14:42  john
13015  * Added more calls so net doesn't die in net game.
13016  *
13017  * Revision 1.35  1994/11/08  14:59:12  john
13018  * Added code to respond to network while in menus.
13019  *
13020  * Revision 1.34  1994/10/24  19:56:32  john
13021  * Made the new user setup prompt for config options.
13022  *
13023  * Revision 1.33  1994/10/22  14:11:52  mike
13024  * Suppress compiler warning message.
13025  *
13026  * Revision 1.32  1994/10/19  12:44:24  john
13027  * Added hours field to player structure.
13028  *
13029  * Revision 1.31  1994/10/17  13:07:13  john
13030  * Moved the descent.cfg info into the player config file.
13031  *
13032  * Revision 1.30  1994/10/13  21:41:12  john
13033  * MAde Esc exit out of joystick calibration.
13034  *
13035  * Revision 1.29  1994/10/13  19:22:27  john
13036  * Added separate config saves for different devices.
13037  * Made all the devices work together better, such as mice won't
13038  * get read when you're playing with the joystick.
13039  *
13040  * Revision 1.28  1994/10/13  11:40:18  john
13041  * Took out warnings.
13042  *
13043  * Revision 1.27  1994/10/13  11:35:23  john
13044  * Made Thrustmaster FCS Hat work.  Put a background behind the
13045  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13046  * menu to new menu. Made F6 be calibrate joystick.
13047  *
13048  * Revision 1.26  1994/10/11  21:29:03  matt
13049  * Made a bunch of menus have good initial selected values
13050  *
13051  * Revision 1.25  1994/10/11  17:08:39  john
13052  * Added sliders for volume controls.
13053  *
13054  * Revision 1.24  1994/10/10  17:59:21  john
13055  * Neatend previous.
13056  *
13057  * Revision 1.23  1994/10/10  17:57:59  john
13058  * Neatend previous.
13059  *
13060  * Revision 1.22  1994/10/10  17:56:11  john
13061  * Added messagebox that tells that config has been saved.
13062  *
13063  * Revision 1.21  1994/09/30  12:37:26  john
13064  * Added midi,digi volume to configuration.
13065  *
13066  * Revision 1.20  1994/09/22  16:14:14  john
13067  * Redid intro sequecing.
13068  *
13069  * Revision 1.19  1994/09/19  18:50:15  john
13070  * Added switch to disable joystick.
13071  *
13072  * Revision 1.18  1994/09/12  11:47:36  john
13073  * Made stupid cruise work better.  Make kconfig values get
13074  * read/written to disk.
13075  *
13076  * Revision 1.17  1994/09/10  15:46:47  john
13077  * First version of new keyboard configuration.
13078  *
13079  * Revision 1.16  1994/09/06  19:35:44  john
13080  * Fixed bug that didn';t load new size .cal file.
13081  *
13082  * Revision 1.15  1994/09/06  14:51:58  john
13083  * Added sensitivity adjustment, fixed bug with joystick button not
13084  * staying down.
13085  *
13086  * Revision 1.14  1994/09/02  16:13:47  john
13087  * Made keys fill in position.
13088  *
13089  * Revision 1.13  1994/08/31  17:58:50  john
13090  * Made a bit simpler.
13091  *
13092  * Revision 1.12  1994/08/31  14:17:54  john
13093  * *** empty log message ***
13094  *
13095  * Revision 1.11  1994/08/31  14:10:56  john
13096  * Made keys not work when KEY_DELETE pressed.
13097  *
13098  * Revision 1.10  1994/08/31  13:40:47  mike
13099  * Change constant
13100  *
13101  * Revision 1.9  1994/08/31  12:56:27  john
13102  * *** empty log message ***
13103  *
13104  * Revision 1.8  1994/08/30  20:38:29  john
13105  * Add more config stuff..
13106  *
13107  * Revision 1.7  1994/08/30  16:37:25  john
13108  * Added menu options to set controls.
13109  *
13110  * Revision 1.6  1994/08/30  09:27:18  john
13111  * *** empty log message ***
13112  *
13113  * Revision 1.5  1994/08/30  09:12:01  john
13114  * *** empty log message ***
13115  *
13116  * Revision 1.4  1994/08/29  21:18:32  john
13117  * First version of new keyboard/oystick remapping stuff.
13118  *
13119  * Revision 1.3  1994/08/24  19:00:29  john
13120  * Changed key_down_time to return fixed seconds instead of
13121  * milliseconds.
13122  *
13123  * Revision 1.2  1994/08/17  16:50:37  john
13124  * Added damaging fireballs, missiles.
13125  *
13126  * Revision 1.1  1994/08/17  10:07:12  john
13127  * Initial revision
13128
13129 ------------------------------------------------------------------------
13130 main/joydefs.h:
13131
13132  * Revision 2.0  1995/02/27  11:32:12  john
13133  * New version 2.0, which has no anonymous unions, builds with
13134  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13135  *
13136  * Revision 1.12  1995/01/25  14:37:52  john
13137  * Made joystick only prompt for calibration once...
13138  *
13139  * Revision 1.11  1994/10/13  11:35:43  john
13140  * Made Thrustmaster FCS Hat work.  Put a background behind the
13141  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13142  * menu to new menu. Made F6 be calibrate joystick.
13143  *
13144  * Revision 1.10  1994/09/10  15:46:49  john
13145  * First version of new keyboard configuration.
13146  *
13147  * Revision 1.9  1994/09/06  14:51:29  john
13148  * Added sensitivity adjustment, fixed bug with joystick button not
13149  * staying down.
13150  *
13151  * Revision 1.8  1994/08/31  12:56:29  john
13152  * *** empty log message ***
13153  *
13154  * Revision 1.7  1994/08/30  16:37:07  john
13155  * Added menu options to set controls.
13156  *
13157  * Revision 1.6  1994/08/29  21:18:33  john
13158  * First version of new keyboard/oystick remapping stuff.
13159  *
13160  * Revision 1.5  1994/08/24  19:00:30  john
13161  * Changed key_down_time to return fixed seconds instead of
13162  * milliseconds.
13163  *
13164  * Revision 1.4  1994/08/17  16:50:04  john
13165  * Added damaging fireballs, missiles.
13166  *
13167  * Revision 1.3  1994/07/01  10:55:18  john
13168  * Added analog joystick throttle
13169  *
13170  * Revision 1.2  1994/06/30  20:04:46  john
13171  * Added -joydef support.
13172  *
13173  * Revision 1.1  1994/06/30  18:08:12  john
13174  * Initial revision
13175
13176 ------------------------------------------------------------------------
13177 main/kconfig.c:
13178
13179  * Revision 1.18  1995/10/29  20:14:10  allender
13180  * don't read mouse 30x/sec.  Still causes problems -- left with
13181  * exposure at > 60 frame/s
13182  *
13183  * Revision 1.17  1995/10/27  14:16:35  allender
13184  * don't set lastreadtime when doing mouse stuff if we didn't
13185  * read mouse this frame
13186  *
13187  * Revision 1.16  1995/10/24  18:10:22  allender
13188  * get mouse stuff working right this time?
13189  *
13190  * Revision 1.15  1995/10/23  14:50:50  allender
13191  * corrected values for control type in kc_set_controls
13192  *
13193  * Revision 1.14  1995/10/21  16:36:54  allender
13194  * fix up mouse read time
13195  *
13196  * Revision 1.13  1995/10/20  00:46:53  allender
13197  * fix up mouse reading problem
13198  *
13199  * Revision 1.12  1995/10/19  13:36:38  allender
13200  * mouse support in kconfig screens
13201  *
13202  * Revision 1.11  1995/10/18  21:06:06  allender
13203  * removed Int3 in cruise stuff -- was in there for debugging and
13204  * now not needed
13205  *
13206  * Revision 1.10  1995/10/17  13:12:47  allender
13207  * fixed config menus so buttons don't get configured
13208  *
13209  * Revision 1.9  1995/10/15  23:07:55  allender
13210  * added return key as second button for primary fire
13211  *
13212  * Revision 1.8  1995/09/05  08:49:47  allender
13213  * change 'PADRTN' label to 'ENTER'
13214  *
13215  * Revision 1.7  1995/09/01  15:38:22  allender
13216  * took out cap of reading controls max 25 times/sec
13217  *
13218  * Revision 1.6  1995/09/01  13:33:59  allender
13219  * erase all old text
13220  *
13221  * Revision 1.5  1995/08/18  10:20:55  allender
13222  * keep controls reading to 25 times/s max so fast
13223  * frame rates don't mess up control reading
13224  *
13225  * Revision 1.4  1995/07/28  15:43:13  allender
13226  * make mousebutton control primary fire
13227  *
13228  * Revision 1.3  1995/07/26  17:04:32  allender
13229  * new defaults and make joystick main button work correctly
13230  *
13231  * Revision 1.2  1995/07/17  08:51:03  allender
13232  * fixed up configuration menus to look right
13233  *
13234  * Revision 1.1  1995/05/16  15:26:56  allender
13235  * Initial revision
13236  *
13237  * Revision 2.11  1995/08/23  16:08:04  john
13238  * Added version 2 of external controls that passes the ship
13239  * position and orientation the drivers.
13240  *
13241  * Revision 2.10  1995/07/07  16:48:01  john
13242  * Fixed bug with new interface.
13243  *
13244  * Revision 2.9  1995/07/03  15:02:32  john
13245  * Added new version of external controls for Cybermouse absolute position.
13246  *
13247  * Revision 2.8  1995/06/30  12:30:28  john
13248  * Added -Xname command line.
13249  *
13250  * Revision 2.7  1995/03/30  16:36:56  mike
13251  * text localization.
13252  *
13253  * Revision 2.6  1995/03/21  14:39:31  john
13254  * Ifdef'd out the NETWORK code.
13255  *
13256  * Revision 2.5  1995/03/16  10:53:07  john
13257  * Move VFX center to Shift+Z instead of Enter because
13258  * it conflicted with toggling HUD on/off.
13259  *
13260  * Revision 2.4  1995/03/10  13:47:24  john
13261  * Added head tracking sensitivity.
13262  *
13263  * Revision 2.3  1995/03/09  18:07:06  john
13264  * Fixed bug with iglasses tracking not "centering" right.
13265  * Made VFX have bright headlight lighting.
13266  *
13267  * Revision 2.2  1995/03/08  15:32:39  john
13268  * Made VictorMaxx head tracking use Greenleaf code.
13269  *
13270  * Revision 2.1  1995/03/06  15:23:31  john
13271  * New screen techniques.
13272  *
13273  * Revision 2.0  1995/02/27  11:29:26  john
13274  * New version 2.0, which has no anonymous unions, builds with
13275  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13276  *
13277  * Revision 1.105  1995/02/22  14:11:58  allender
13278  * remove anonymous unions from object structure
13279  *
13280  * Revision 1.104  1995/02/13  12:01:56  john
13281  * Fixed bug with buggin not mmaking player faster.
13282  *
13283  * Revision 1.103  1995/02/09  22:00:46  john
13284  * Added i-glasses tracking.
13285  *
13286  * Revision 1.102  1995/01/24  21:25:47  john
13287  * Fixed bug with slide/bank on not working with
13288  * Cyberman heading.,
13289  *
13290  * Revision 1.101  1995/01/24  16:09:56  john
13291  * Fixed bug with Wingman extreme customize text overwriting title.
13292  *
13293  * Revision 1.100  1995/01/24  12:37:46  john
13294  * Made Esc exit key define menu.
13295  *
13296  * Revision 1.99  1995/01/23  23:54:43  matt
13297  * Made keypad enter work
13298  *
13299  * Revision 1.98  1995/01/23  16:42:00  john
13300  * Made the external controls always turn banking off, leveling off
13301  * and passed automap state thru to the tsr.
13302  *
13303  * Revision 1.97  1995/01/12  11:41:33  john
13304  * Added external control reading.
13305  *
13306  * Revision 1.96  1995/01/05  10:43:58  mike
13307  * Handle case when timer_get_fixed_seconds() goes negative.  Happens at 9.1
13308  * hours.  Previously, joystick would stop functioning.  Now will work.
13309  *
13310  * Revision 1.95  1994/12/29  11:17:38  john
13311  * Took out some warnings and mprintf.
13312  *
13313  * Revision 1.94  1994/12/29  11:07:41  john
13314  * Fixed Thrustmaster and Logitech Wingman extreme
13315  * Hat by reading the y2 axis during the center stage
13316  * of the calibration, and using 75, 50, 27, and 3 %
13317  * as values for the 4 positions.
13318  *
13319  * Revision 1.93  1994/12/27  12:16:20  john
13320  * Fixed bug with slide on not working with joystick or mouse buttons.
13321  *
13322  * Revision 1.92  1994/12/20  10:34:15  john
13323  * Made sensitivity work for mouse & joystick and made
13324  * it only affect, pitch, heading, and roll.
13325  *
13326  * Revision 1.91  1994/12/16  00:11:23  matt
13327  * Made delete key act normally when debug out
13328  *
13329  * Revision 1.90  1994/12/14  17:41:15  john
13330  * Added more buttons so that  Yoke would work.
13331  *
13332  * Revision 1.89  1994/12/13  17:25:35  allender
13333  * Added Assert for bogus time for joystick reading.
13334  *
13335  * Revision 1.88  1994/12/13  14:48:01  john
13336  * Took out some debugging mprintf's
13337  *
13338  *
13339  * Revision 1.87  1994/12/13  14:43:02  john
13340  * Took out the code in kconfig to build direction array.
13341  * Called kc_set_controls after selecting a new control type.
13342  *
13343  * Revision 1.86  1994/12/13  01:11:32  john
13344  * Fixed bug with message clearing overwriting
13345  * right border.
13346  *
13347  * Revision 1.85  1994/12/12  00:35:58  john
13348  * Added or thing for keys.
13349  *
13350  * Revision 1.84  1994/12/09  17:08:06  john
13351  * Made mouse a bit less sensitive.
13352  *
13353  * Revision 1.83  1994/12/09  16:04:00  john
13354  * Increased mouse sensitivity.
13355  *
13356  * Revision 1.82  1994/12/09  00:41:26  mike
13357  * fix hang in automap print screen
13358  *
13359  * Revision 1.81  1994/12/08  11:50:37  john
13360  * Made strcpy only copy corect number of chars,.
13361  *
13362  * Revision 1.80  1994/12/07  16:16:06  john
13363  * Added command to check to see if a joystick axes has been used.
13364  *
13365  * Revision 1.79  1994/12/07  14:52:28  yuan
13366  * Localization 492
13367  *
13368  * Revision 1.78  1994/12/07  13:37:40  john
13369  * Made the joystick thrust work in reverse.
13370  *
13371  * Revision 1.77  1994/12/07  11:28:24  matt
13372  * Did a little localization support
13373  *
13374  * Revision 1.76  1994/12/04  12:30:03  john
13375  * Made the Thrustmaster stick read every frame, not every 10 frames,
13376  * because it uses analog axis as buttons.
13377  *
13378  * Revision 1.75  1994/12/03  22:35:25  yuan
13379  * Localization 412
13380  *
13381  * Revision 1.74  1994/12/03  15:39:24  john
13382  * Made numeric keypad move in conifg.
13383  *
13384  * Revision 1.73  1994/12/01  16:23:39  john
13385  * Fixed include mistake.
13386  *
13387  * Revision 1.72  1994/12/01  16:07:57  john
13388  * Fixed bug that disabled joystick in automap because it used gametime, which is
13389  * paused during automap. Fixed be used timer_Get_fixed_seconds instead of GameTime.
13390  *
13391  * Revision 1.71  1994/12/01  12:30:49  john
13392  * Made Ctrl+D delete, not Ctrl+E
13393  *
13394  * Revision 1.70  1994/12/01  11:52:52  john
13395  * Added default values for GamePad.
13396  *
13397  * Revision 1.69  1994/11/30  00:59:12  mike
13398  * optimizations.
13399  *
13400  * Revision 1.68  1994/11/29  03:45:50  john
13401  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
13402  * command line arg.
13403  *
13404  * Revision 1.67  1994/11/27  23:13:44  matt
13405  * Made changes for new mprintf calling convention
13406  *
13407  * Revision 1.66  1994/11/27  19:52:12  matt
13408  * Made screen shots work in a few more places
13409  *
13410  * Revision 1.65  1994/11/22  16:54:50  mike
13411  * autorepeat on missiles.
13412  *
13413  * Revision 1.64  1994/11/21  11:16:17  rob
13414  * Changed calls to GameLoop to calls to multi_menu_poll and changed
13415  * conditions under which they are called.
13416  *
13417  * Revision 1.63  1994/11/19  15:14:48  mike
13418  * remove unused code and data
13419  *
13420  * Revision 1.62  1994/11/18  23:37:56  john
13421  * Changed some shorts to ints.
13422  *
13423  * Revision 1.61  1994/11/17  13:36:35  rob
13424  * Added better network hook in kconfig menu.
13425  *
13426  * Revision 1.60  1994/11/14  20:09:13  john
13427  * Made Tab be default for automap.
13428  *
13429  * Revision 1.59  1994/11/13  16:34:07  matt
13430  * Fixed victormaxx angle conversions
13431  *
13432  * Revision 1.58  1994/11/12  14:47:05  john
13433  * Added support for victor head tracking.
13434  *
13435  * Revision 1.57  1994/11/08  15:14:55  john
13436  * Added more calls so net doesn't die in net game.
13437  *
13438  * Revision 1.56  1994/11/07  14:01:07  john
13439  * Changed the gamma correction sequencing.
13440  *
13441  * Revision 1.55  1994/11/01  16:40:08  john
13442  * Added Gamma correction.
13443  *
13444  * Revision 1.54  1994/10/25  23:09:26  john
13445  * Made the automap key configurable.
13446  *
13447  * Revision 1.53  1994/10/25  13:11:59  john
13448  * Made keys the way Adam speced 'em for final game.
13449  *
13450  * Revision 1.52  1994/10/24  17:44:22  john
13451  * Added stereo channel reversing.
13452  *
13453  * Revision 1.51  1994/10/22  13:23:18  john
13454  * Made default rear view key be R.
13455  *
13456  * Revision 1.50  1994/10/22  13:20:09  john
13457  * Took out toggle primary/secondary weapons.  Fixed black
13458  * background for 'axes' and 'buttons' text.
13459  *
13460  * Revision 1.49  1994/10/21  15:20:15  john
13461  * Made PrtScr do screen dump, not F2.
13462  *
13463  * Revision 1.48  1994/10/21  13:41:36  john
13464  * Allowed F2 to screen dump.
13465  *
13466  * Revision 1.47  1994/10/17  13:07:05  john
13467  * Moved the descent.cfg info into the player config file.
13468  *
13469  * Revision 1.46  1994/10/14  15:30:22  john
13470  * Added Cyberman default positions.
13471  *
13472  * Revision 1.45  1994/10/14  15:24:54  john
13473  * Made Cyberman work with config.
13474  *
13475  * Revision 1.44  1994/10/14  12:46:04  john
13476  * Added the ability to reset all to default.
13477  *
13478  * Revision 1.43  1994/10/14  12:18:31  john
13479  * Made mouse invert axis always be 0 or 1.
13480  *
13481  * Revision 1.42  1994/10/14  12:16:03  john
13482  * Changed code so that by doing DEL+F12 saves the current kconfig
13483  * values as default. Added support for drop_bomb key.  Took out
13484  * unused slots for keyboard.  Made keyboard use control_type of 0
13485  * save slots.
13486  *
13487  * Revision 1.41  1994/10/13  21:27:02  john
13488  * Made axis invert value always be 0 or 1.
13489  *
13490  * Revision 1.40  1994/10/13  20:18:15  john
13491  * Added some more system keys, such as F? and CAPSLOCK.
13492  *
13493  * Revision 1.39  1994/10/13  19:22:29  john
13494  * Added separate config saves for different devices.
13495  * Made all the devices work together better, such as mice won't
13496  * get read when you're playing with the joystick.
13497  *
13498  * Revision 1.38  1994/10/13  15:41:57  mike
13499  * Remove afterburner.
13500
13501 ------------------------------------------------------------------------
13502 main/kconfig.h:
13503
13504  * Revision 1.1  1995/05/16  15:58:27  allender
13505  * Initial revision
13506  *
13507  * Revision 2.0  1995/02/27  11:29:38  john
13508  * New version 2.0, which has no anonymous unions, builds with
13509  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13510  *
13511  * Revision 1.23  1995/01/12  11:41:44  john
13512  * Added external control reading.
13513  *
13514  * Revision 1.22  1994/12/07  16:15:30  john
13515  * Added command to check to see if a joystick axes has been used.
13516  *
13517  * Revision 1.21  1994/11/29  03:46:29  john
13518  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
13519  * command line arg.
13520  *
13521  * Revision 1.20  1994/11/22  16:54:45  mike
13522  * autorepeat on missiles.
13523  *
13524  * Revision 1.19  1994/11/07  14:01:27  john
13525  * Changed the gamma correction sequencing.
13526  *
13527  * Revision 1.18  1994/11/01  16:40:02  john
13528  * Added Gamma correction.
13529  *
13530  * Revision 1.17  1994/10/25  23:09:24  john
13531  * Made the automap key configurable.
13532  *
13533  * Revision 1.16  1994/10/24  19:56:51  john
13534  * Made the new user setup prompt for config options.
13535  *
13536  * Revision 1.15  1994/10/24  17:44:18  john
13537  * Added stereo channel reversing.
13538  *
13539  * Revision 1.14  1994/10/22  13:19:33  john
13540  * Took out toggle primary/secondary weapons.  Fixed black
13541  * background for 'axes' and 'buttons' text.
13542  *
13543  * Revision 1.13  1994/10/17  13:06:51  john
13544  * Moved the descent.cfg info into the player config file.
13545  *
13546  * Revision 1.12  1994/10/14  12:14:47  john
13547  * Changed code so that by doing DEL+F12 saves the current kconfig
13548  * values as default. Added support for drop_bomb key.  Took out
13549  * unused slots for keyboard.  Made keyboard use control_type of 0
13550  * save slots.
13551  *
13552  * Revision 1.11  1994/10/13  19:21:33  john
13553  * Added separate config saves for different devices.
13554  * Made all the devices work together better, such as mice won't
13555  * get read when you're playing with the joystick.
13556  *
13557  * Revision 1.10  1994/10/13  15:18:41  john
13558  * Started ripping out old afterburner, show message, show automap
13559  * keys in the keyboard config stuff.
13560  *
13561  * Revision 1.9  1994/10/13  11:35:27  john
13562  * Made Thrustmaster FCS Hat work.  Put a background behind the
13563  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13564  * menu to new menu. Made F6 be calibrate joystick.
13565  *
13566  * Revision 1.8  1994/10/06  14:10:50  matt
13567  * New function reset_cruise()
13568  *
13569  * Revision 1.7  1994/10/03  14:58:25  john
13570  * Added rear_view_down_state so that the rear view can
13571  * work like the automap.
13572  *
13573  * Revision 1.6  1994/09/30  12:37:25  john
13574  * Added midi,digi volume to configuration.
13575  *
13576  * Revision 1.5  1994/09/19  18:49:59  john
13577  * Added switch to disable joystick.
13578  *
13579  * Revision 1.4  1994/09/15  16:11:21  john
13580  * Added support for VFX1 head tracking. Fixed bug with memory over-
13581  * write when using stereo mode.
13582  *
13583  * Revision 1.3  1994/09/12  11:47:38  john
13584  * Made stupid cruise work better.  Make kconfig values get
13585  * read/written to disk.
13586  *
13587  * Revision 1.2  1994/09/10  15:46:55  john
13588  * First version of new keyboard configuration.
13589  *
13590  * Revision 1.1  1994/09/10  13:51:40  john
13591  * Initial revision
13592
13593 ------------------------------------------------------------------------
13594 main/kmatrix.c:
13595
13596  * Revision 1.6  1995/09/24  10:57:48  allender
13597  * made any key move off of kill matrix screen as text indicates it should
13598  *
13599  * Revision 1.5  1995/08/18  08:33:05  allender
13600  * fixed text problem with top level player names
13601  *
13602  * Revision 1.4  1995/07/26  17:03:05  allender
13603  * sort of fixed spacing for mac
13604  *
13605  * Revision 1.3  1995/06/06  15:36:14  allender
13606  * be sure to bitblt to screen inside of kmatrix loop
13607  *
13608  * Revision 1.2  1995/06/02  07:47:15  allender
13609  * removed bogus include files
13610  *
13611  * Revision 1.1  1995/05/16  15:27:07  allender
13612  * Initial revision
13613  *
13614  * Revision 2.3  1995/05/02  17:01:22  john
13615  * Fixed bug with kill list not showing up in VFX mode.
13616  *
13617  * Revision 2.2  1995/03/21  14:38:20  john
13618  * Ifdef'd out the NETWORK code.
13619  *
13620  * Revision 2.1  1995/03/06  15:22:54  john
13621  * New screen techniques.
13622  *
13623  * Revision 2.0  1995/02/27  11:25:56  john
13624  * New version 2.0, which has no anonymous unions, builds with
13625  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13626  *
13627  * Revision 1.19  1995/02/15  14:47:23  john
13628  * Added code to keep track of kills during endlevel.
13629  *
13630  * Revision 1.18  1995/02/08  11:00:06  rob
13631  * Moved string to localized file
13632  *
13633  * Revision 1.17  1995/02/01  23:45:55  rob
13634  * Fixed string.
13635  *
13636  * Revision 1.16  1995/01/30  21:47:11  rob
13637  * Added a line of instructions.
13638  *
13639  * Revision 1.15  1995/01/20  16:58:43  rob
13640  * careless careless careless...
13641  *
13642  *
13643  * Revision 1.14  1995/01/20  13:43:48  rob
13644  * Longer time to view.
13645  *
13646  * Revision 1.13  1995/01/20  13:42:34  rob
13647  * Fixed sorting bug.
13648  *
13649  * Revision 1.12  1995/01/19  17:35:21  rob
13650  * Fixed coloration of player names in team mode.
13651  *
13652  * Revision 1.11  1995/01/16  21:26:15  rob
13653  * Fixed it!!
13654  *
13655  * Revision 1.10  1995/01/16  18:55:41  rob
13656  * Added include of network.h
13657  *
13658  * Revision 1.9  1995/01/16  18:22:35  rob
13659  * Fixed problem with signs.
13660  *
13661  * Revision 1.8  1995/01/12  16:07:51  rob
13662  * ADded sorting before display.
13663  *
13664  * Revision 1.7  1995/01/04  08:46:53  rob
13665  * JOHN CHECKED IN FOR ROB !!!
13666  *
13667  * Revision 1.6  1994/12/09  20:17:20  yuan
13668  * Touched up
13669  *
13670  * Revision 1.5  1994/12/09  19:46:35  yuan
13671  * Localized the sucker.
13672  *
13673  * Revision 1.4  1994/12/09  19:24:58  rob
13674  * Yuan's fix to the centering.
13675  *
13676  * Revision 1.3  1994/12/09  19:02:37  yuan
13677  * Cleaned up a bit.
13678  *
13679  * Revision 1.2  1994/12/09  16:19:46  yuan
13680  * kill matrix stuff.
13681  *
13682  * Revision 1.1  1994/12/09  15:08:58  yuan
13683  * Initial revision
13684
13685 ------------------------------------------------------------------------
13686 main/kmatrix.h:
13687
13688  * Revision 1.1  1995/05/16  15:58:35  allender
13689  * Initial revision
13690  *
13691  * Revision 2.0  1995/02/27  11:28:51  john
13692  * New version 2.0, which has no anonymous unions, builds with
13693  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13694  *
13695  * Revision 1.3  1995/02/15  14:47:39  john
13696  * Added code to keep track of kills during endlevel.
13697  *
13698  * Revision 1.2  1994/12/09  16:19:46  yuan
13699  * kill matrix stuff.
13700  *
13701  * Revision 1.1  1994/12/09  15:58:33  yuan
13702  * Initial revision
13703
13704 ------------------------------------------------------------------------
13705 main/laser.c:
13706
13707  * Revision 1.1  1993/11/29  17:19:02  john
13708  * Initial revision
13709
13710 ------------------------------------------------------------------------
13711 main/laser.h:
13712
13713  * Revision 1.1  1995/05/16  15:58:43  allender
13714  * Initial revision
13715  *
13716  * Revision 2.0  1995/02/27  11:32:27  john
13717  * New version 2.0, which has no anonymous unions, builds with
13718  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13719  *
13720  * Revision 1.50  1995/02/01  21:03:44  john
13721  * Lintified.
13722  *
13723  * Revision 1.49  1995/02/01  16:34:11  john
13724  * Linted.
13725  *
13726  * Revision 1.48  1995/01/31  16:16:16  mike
13727  * Separate smart blobs for robot and player.
13728  *
13729  * Revision 1.47  1995/01/27  17:02:55  mike
13730  * Add LASER_ID -- why wasn't this added in June?
13731  *
13732  * Revision 1.46  1995/01/25  10:53:27  mike
13733  * make badass damage go through grates.
13734  *
13735  * Revision 1.45  1994/12/12  17:17:32  mike
13736  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
13737  *
13738  * Revision 1.44  1994/12/04  16:17:23  mike
13739  * spruce up homing missile behavior.
13740  *
13741  * Revision 1.43  1994/12/03  12:48:30  mike
13742  * make homing missile tracking not frame rate dependent (more-or-less)
13743  *
13744  * Revision 1.42  1994/10/12  08:04:54  mike
13745  * Clean up proximity/homing mess.
13746  *
13747  * Revision 1.41  1994/10/09  20:07:04  rob
13748  * Change prototype for do_laser_firing
13749  *
13750  * Revision 1.40  1994/10/09  00:15:48  mike
13751  * Add constants for super mech missile, regular mech missile, silent spreadfire.
13752  *
13753  * Revision 1.39  1994/10/08  19:52:09  rob
13754  * Added new weapon fire flags.
13755  *
13756  * Revision 1.38  1994/10/07  15:31:12  mike
13757  * Prototypes for new laser functions which don't necessarily make sound.
13758  *
13759  * Revision 1.37  1994/10/05  17:08:29  matt
13760  * Fixed a couple of small bugs, and made homing missiles alternate sides
13761  *
13762  * Revision 1.36  1994/09/28  14:28:55  rob
13763  * Added firing of missiles on networks/serial.
13764  *
13765  * Revision 1.35  1994/09/24  14:17:02  mike
13766  * Prototype do_laser_firing.
13767  *
13768  * Revision 1.34  1994/09/23  11:36:49  mike
13769  * Prototype Laser_create_new_easy.
13770  *
13771  * Revision 1.33  1994/09/20  11:55:01  mike
13772  * Fix bug.
13773  *
13774  * Revision 1.32  1994/09/20  11:48:34  mike
13775  * Change spreadfire laser to use new bitmap. (Define SPREADFIRE_ID)
13776  *
13777  * Revision 1.31  1994/09/15  16:31:28  mike
13778  * Prototype object_to_object_visibility.
13779  *
13780  * Revision 1.30  1994/09/10  17:31:40  mike
13781  * Add thrust to weapons.
13782  *
13783  * Revision 1.29  1994/09/08  14:49:44  mike
13784  * Bunch of IDs for new weapon types.
13785  *
13786  * Revision 1.28  1994/09/07  19:16:40  mike
13787  * Homing missile.
13788  *
13789  * Revision 1.27  1994/09/07  15:59:47  mike
13790  * Kill FLARE_MAX_TIME (now defined in bitmaps.tbl), add PROXIMITY_ID (shame!), prototype do_laser_firing, do_missile_firing.
13791  *
13792  * Revision 1.26  1994/09/03  15:22:41  mike
13793  * Kill Projectile_player_fire prototype.
13794  *
13795  * Revision 1.25  1994/09/02  16:39:00  mike
13796  * IDs for primary weapons.
13797  *
13798  * Revision 1.24  1994/09/02  11:55:54  mike
13799  * Define some illegal constants.
13800  *
13801  * Revision 1.23  1994/08/25  18:12:06  matt
13802  * Made player's weapons and flares fire from the positions on the 3d model.
13803  * Also added support for quad lasers.
13804  *
13805  * Revision 1.22  1994/08/19  15:22:28  mike
13806  * Define constant for MAX_LASER_LEVEL.
13807  *
13808  * Revision 1.21  1994/08/13  12:20:47  john
13809  * Made the networking uise the Players array.
13810  *
13811  * Revision 1.20  1994/08/10  10:44:05  john
13812  * Made net players fire..
13813  *
13814  * Revision 1.19  1994/06/27  18:30:57  mike
13815  * Add flares.
13816  *
13817  * Revision 1.18  1994/06/09  15:32:37  mike
13818  * Muzzle flash
13819  *
13820  * Revision 1.17  1994/05/19  09:09:00  mike
13821  * Move a bunch of laser variables to bm.h, I think.
13822  * Also, added Robot_laser_speed, instead of hard-coding Laser_speed/4.
13823  *
13824  * Revision 1.16  1994/05/14  17:16:20  matt
13825  * Got rid of externs in source (non-header) files
13826  *
13827  * Revision 1.15  1994/05/13  20:27:39  john
13828  * Version II of John's new object code.
13829  *
13830  * Revision 1.14  1994/04/20  15:06:47  john
13831  * Neatend laser code and fixed some laser bugs.
13832  *
13833  * Revision 1.13  1994/04/01  13:35:15  matt
13834  * Cleaned up laser code a bit; moved some code here object.c to laser.c
13835  *
13836  * Revision 1.12  1994/04/01  11:14:24  yuan
13837  * Added multiple bitmap functionality to all objects...
13838  * (hostages, powerups, lasers, etc.)
13839  * Hostages and powerups are implemented in the object system,
13840  * just need to finish function call to "affect" player.
13841  *
13842  * Revision 1.11  1994/03/31  09:10:09  matt
13843  * Added #define to turn crosshair off
13844  *
13845  * Revision 1.10  1994/02/17  11:33:15  matt
13846  * Changes in object system
13847  *
13848  * Revision 1.9  1994/01/06  11:56:01  john
13849  * Made lasers be lines, not purple blobs
13850  *
13851  * Revision 1.8  1994/01/05  10:53:35  john
13852  * New object code by John.
13853  *
13854  * Revision 1.7  1993/12/08  14:21:36  john
13855  * Added ExplodeObject
13856  *
13857  * Revision 1.6  1993/12/08  11:28:54  john
13858  * Made lasers look like bolts.
13859  *
13860  * Revision 1.5  1993/12/01  13:12:40  john
13861  * made lasers frame-rate independant
13862  *
13863  * Revision 1.4  1993/11/30  19:00:42  john
13864  * lasers working kinda
13865  *
13866  * Revision 1.3  1993/11/29  19:44:53  john
13867  * *** empty log message ***
13868  *
13869  * Revision 1.2  1993/11/29  17:44:55  john
13870  * *** empty log message ***
13871  *
13872  * Revision 1.1  1993/11/29  17:19:19  john
13873  * Initial revision
13874
13875 ------------------------------------------------------------------------
13876 main/lighting.c:
13877
13878  * Revision 1.4  1995/09/20  14:26:12  allender
13879  * more optimizations(?) ala MK
13880  *
13881  * Revision 1.2  1995/07/05  21:27:31  allender
13882  * new and improved lighting code by MK!
13883  *
13884  * Revision 2.1  1995/07/24  13:21:56  john
13885  * Added new lighting calculation code to speed things up.
13886  *
13887  * Revision 2.0  1995/02/27  11:27:33  john
13888  * New version 2.0, which has no anonymous unions, builds with
13889  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13890  *
13891  * Revision 1.43  1995/02/22  13:57:10  allender
13892  * remove anonymous union from object structure
13893  *
13894  * Revision 1.42  1995/02/13  20:35:07  john
13895  * Lintized
13896  *
13897  * Revision 1.41  1995/02/04  21:43:40  matt
13898  * Changed an assert() to an int3() and deal with the bad case
13899  *
13900  * Revision 1.40  1995/01/15  20:48:27  mike
13901  * support light field for powerups.
13902  *
13903  * Revision 1.39  1994/12/15  13:04:19  mike
13904  * Replace Players[Player_num].time_total references with GameTime.
13905  *
13906  * Revision 1.38  1994/11/28  21:50:41  mike
13907  * optimizations.
13908  *
13909  * Revision 1.37  1994/11/28  01:32:33  mike
13910  * lighting optimization.
13911  *
13912  * Revision 1.36  1994/11/15  12:01:00  john
13913  * Changed a bunch of code that uses timer_get_milliseconds to
13914  * timer_get_fixed_Seconds.
13915  *
13916  * Revision 1.35  1994/10/31  21:56:07  matt
13917  * Fixed bug & added error checking
13918  *
13919  * Revision 1.34  1994/10/21  11:24:57  mike
13920  * Trap divide overflows in lighting.
13921  *
13922  * Revision 1.33  1994/10/08  14:49:11  matt
13923  * If viewer changed, don't do smooth lighting hack
13924  *
13925  * Revision 1.32  1994/09/25  23:41:07  matt
13926  * Changed the object load & save code to read/write the structure fields one
13927  * at a time (rather than the whole structure at once).  This mean that the
13928  * object structure can be changed without breaking the load/save functions.
13929  * As a result of this change, the local_object data can be and has been
13930  * incorporated into the object array.  Also, timeleft is now a property
13931  * of all objects, and the object structure has been otherwise cleaned up.
13932  *
13933  * Revision 1.31  1994/09/25  15:45:15  matt
13934  * Added OBJ_LIGHT, a type of object that casts light
13935  * Added generalized lifeleft, and moved it to local_object
13936  *
13937  * Revision 1.30  1994/09/11  15:48:27  mike
13938  * Use vm_vec_mag_quick in place of vm_vec_mag in point_dist computation.
13939  *
13940  * Revision 1.29  1994/09/08  21:44:49  matt
13941  * Made lighting ramp 4x as fast; made only static (ambient) light ramp
13942  * up, but not headlight & dynamic light
13943  *
13944  * Revision 1.28  1994/09/02  14:00:07  matt
13945  * Simplified explode_object() & mutliple-stage explosions
13946  *
13947  * Revision 1.27  1994/08/29  19:06:44  mike
13948  * Make lighting proportional to square of distance, not linear.
13949  *
13950  * Revision 1.26  1994/08/25  18:08:38  matt
13951  * Made muzzle flash cast 3x as much light
13952  *
13953  * Revision 1.25  1994/08/23  16:38:31  mike
13954  * Key weapon light off bitmaps.tbl.
13955  *
13956  * Revision 1.24  1994/08/13  12:20:44  john
13957  * Made the networking uise the Players array.
13958  *
13959  * Revision 1.23  1994/08/12  22:42:18  john
13960  * Took away Player_stats; added Players array.
13961  *
13962  * Revision 1.22  1994/07/06  10:19:22  matt
13963  * Changed include
13964  *
13965  * Revision 1.21  1994/06/28  13:20:22  mike
13966  * Oops, fixed a dumb typo.
13967  *
13968  * Revision 1.20  1994/06/28  12:53:25  mike
13969  * Change lighting function for flares, make brighter and asynchronously flicker.
13970  *
13971  * Revision 1.19  1994/06/27  18:31:15  mike
13972  * Add flares.
13973  *
13974  * Revision 1.18  1994/06/20  13:41:17  matt
13975  * Added time-based gradual lighting hack for objects
13976  * Took out strobing robots
13977  *
13978  * Revision 1.17  1994/06/19  16:25:54  mike
13979  * Optimize lighting.
13980  *
13981  * Revision 1.16  1994/06/17  18:08:08  mike
13982  * Make robots cast more and variable light.
13983  *
13984  * Revision 1.15  1994/06/13  15:15:55  mike
13985  * Fix phantom light, every 64K milliseconds, muzzle flash would flash again.
13986
13987 ------------------------------------------------------------------------
13988 main/lighting.h:
13989
13990  * Revision 1.1  1995/05/16  15:58:51  allender
13991  * Initial revision
13992  *
13993  * Revision 2.0  1995/02/27  11:27:52  john
13994  * New version 2.0, which has no anonymous unions, builds with
13995  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13996  *
13997  * Revision 1.6  1994/11/28  21:50:56  mike
13998  * optimizations.
13999  *
14000  * Revision 1.5  1994/06/07  16:51:58  matt
14001  * Made object lighting work correctly; changed name of Ambient_light to
14002  * Dynamic_light; cleaned up polygobj object rendering a little.
14003  *
14004  * Revision 1.4  1994/05/31  18:41:35  matt
14005  * Added comments
14006  *
14007  * Revision 1.3  1994/05/23  15:00:08  mike
14008  * Change MIN_LIGHT_DIST.
14009  *
14010  * Revision 1.2  1994/05/22  15:30:09  mike
14011  * First version.
14012  *
14013  * Revision 1.1  1994/05/22  15:16:44  mike
14014  * Initial revision
14015
14016 ------------------------------------------------------------------------
14017 main/menu.h:
14018
14019  * Revision 1.1  1995/05/16  15:59:14  allender
14020  * Initial revision
14021  *
14022  * Revision 2.1  1995/03/06  16:47:41  mike
14023  * destination saturn
14024  *
14025  * Revision 2.0  1995/02/27  11:29:47  john
14026  * New version 2.0, which has no anonymous unions, builds with
14027  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14028  *
14029  * Revision 1.34  1994/12/12  00:16:16  john
14030  * Added auto-leveling flag.
14031  *
14032  * Revision 1.33  1994/12/07  20:04:26  mike
14033  * set Max_debris_objects.
14034  *
14035  * Revision 1.32  1994/11/14  17:23:19  rob
14036  * ADded extern for default difficulty settings.
14037  *
14038  * Revision 1.31  1994/11/10  11:08:29  mike
14039  * detail level stuff.
14040  *
14041  * Revision 1.30  1994/11/05  14:05:53  john
14042  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
14043  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
14044  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
14045  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
14046  *
14047  * Revision 1.29  1994/11/02  11:59:44  john
14048  * Moved menu out of game into inferno main loop.
14049  *
14050  * Revision 1.28  1994/10/17  20:30:59  john
14051  * Made the text for the difficulty labels global so that
14052  * the high score screen can print "rookie" or whatever.
14053  *
14054  * Revision 1.27  1994/10/04  10:47:09  matt
14055  * Made main menu remember selected item
14056  *
14057  * Revision 1.26  1994/08/10  19:55:19  john
14058  * Changed font stuff; Took out old menu; messed up lots of
14059  * other stuff like game sequencing messages, etc.
14060  *
14061  * Revision 1.25  1994/06/23  18:54:09  matt
14062  * Cleaned up game start/menu interaction, and improved main menu a little
14063  *
14064  * Revision 1.24  1994/06/21  12:11:50  yuan
14065  * Fixed up menus and added HUDisplay messages.
14066  *
14067  * Revision 1.23  1994/06/20  23:15:16  yuan
14068  * Color switching capability for the menus.
14069  *
14070  * Revision 1.22  1994/06/20  22:02:25  yuan
14071  * Made menu GREEN by POPULAR DEMAND!!
14072  *
14073  * Revision 1.21  1994/06/20  21:05:48  yuan
14074  * Fixed up menus.
14075  *
14076  * Revision 1.20  1994/06/20  19:19:29  yuan
14077  * Tidied up the menu and the "message blocks" between levels, etc.
14078  *
14079  * Revision 1.19  1994/06/17  18:01:10  john
14080  * A bunch of new stuff by John
14081  *
14082  * Revision 1.18  1994/05/16  09:37:22  matt
14083  * Got rid of global continue_flag
14084  *
14085  * Revision 1.17  1994/05/14  17:14:51  matt
14086  * Got rid of externs in source (non-header) files
14087  *
14088  * Revision 1.16  1994/05/10  12:14:26  yuan
14089  * Game save/load... Demo levels 1-5 added...
14090  * High scores fixed...
14091  *
14092  * Revision 1.15  1994/05/05  09:21:21  yuan
14093  * *** empty log message ***
14094  *
14095  * Revision 1.14  1994/04/29  14:55:40  mike
14096  * Change some menu colors.
14097  *
14098  * Revision 1.13  1994/04/28  18:04:36  yuan
14099  * Gamesave added.
14100  * Trigger problem fixed (seg pointer is replaced by index now.)
14101  *
14102  * Revision 1.12  1994/02/18  11:55:01  yuan
14103  * Fixed menu to be called from game.
14104  *
14105  * Revision 1.11  1994/02/10  17:45:39  yuan
14106  * Integrated some hacks which still need to be fixed.
14107  *
14108  * Revision 1.10  1994/02/01  22:50:23  yuan
14109  * Final menu version for demo
14110  *
14111  * Revision 1.9  1994/02/01  11:50:17  yuan
14112  * Moved quit message down just a tiny bit
14113  *
14114  * Revision 1.8  1994/01/31  17:30:16  yuan
14115  * Fixed quit not disappearing problem
14116  *
14117  * Revision 1.7  1994/01/31  12:25:20  yuan
14118  * New menu stuff
14119  *
14120  * Revision 1.6  1994/01/26  13:14:04  john
14121  * *** empty log message ***
14122  *
14123  * Revision 1.5  1993/12/29  16:44:44  yuan
14124  * Added some function definitions
14125  *
14126  * Revision 1.4  1993/12/13  18:53:12  yuan
14127  * Fixed dependency problem
14128  *
14129  * Revision 1.3  1993/12/12  13:53:51  yuan
14130  * Added menu and -g flag
14131  *
14132  * Revision 1.2  1993/12/10  16:07:17  yuan
14133  * Working on menu system.  Updated the title screen.
14134  *
14135  * Revision 1.1  1993/12/10  12:45:27  yuan
14136  * Initial revision
14137
14138 ------------------------------------------------------------------------
14139 main/mglobal.c:
14140
14141  * Revision 1.1  1995/12/05  16:03:10  allender
14142  * Initial revision
14143  *
14144  * Revision 1.3  1995/10/10  11:49:41  allender
14145  * removed malloc of static data now in ai module
14146  *
14147  * Revision 1.2  1995/07/12  12:48:52  allender
14148  * malloc out edge_list global here, not static in automap.c
14149  *
14150  * Revision 1.1  1995/05/16  15:27:40  allender
14151  * Initial revision
14152  *
14153  * Revision 2.2  1995/03/14  18:24:37  john
14154  * Force Destination Saturn to use CD-ROM drive.
14155  *
14156  * Revision 2.1  1995/03/06  16:47:23  mike
14157  * destination saturn
14158  *
14159  * Revision 2.0  1995/02/27  11:30:00  john
14160  * New version 2.0, which has no anonymous unions, builds with
14161  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14162  *
14163  * Revision 1.43  1995/01/19  17:00:53  john
14164  * Made save game work between levels.
14165  *
14166  * Revision 1.42  1994/12/05  14:23:53  adam
14167  * changed default detail to max, not custom
14168  *
14169  * Revision 1.41  1994/11/19  15:15:07  mike
14170  * remove unused code and data
14171  *
14172  * Revision 1.40  1994/11/03  10:13:19  yuan
14173  * Added #include "game.h"
14174  *
14175  * Revision 1.39  1994/11/03  10:09:59  matt
14176  * Properly initialize detail & difficulty levels
14177  *
14178  * Revision 1.38  1994/10/30  14:11:21  mike
14179  * rip out local segments stuff.
14180  *
14181  * Revision 1.37  1994/10/26  15:21:30  mike
14182  * detail level.
14183  *
14184  * Revision 1.36  1994/09/22  10:46:12  mike
14185  * Add difficulty levels.
14186  *
14187  * Revision 1.35  1994/09/13  11:19:11  mike
14188  * Add Next_missile_fire_time.
14189  *
14190  * Revision 1.34  1994/08/31  19:25:34  mike
14191  * GameTime and laser-firing limiting stuff added.
14192  *
14193  * Revision 1.33  1994/08/11  18:58:53  mike
14194  * Add Side_to_verts_int.
14195  *
14196  * Revision 1.32  1994/07/21  19:01:38  mike
14197  * Add Lsegment.
14198  *
14199  * Revision 1.31  1994/07/21  13:11:24  matt
14200  * Ripped out remants of old demo system, and added demo only system that
14201  * disables object movement and game options from menu.
14202  *
14203  * Revision 1.30  1994/06/17  18:06:48  matt
14204  * Made password be treated as lowercase, since cmdline parsing converts
14205  * everything to lowercase.
14206  *
14207  * Revision 1.29  1994/03/15  16:33:04  yuan
14208  * Cleaned up bm-loading code.
14209  * (Fixed structures too)
14210  *
14211  * Revision 1.28  1994/02/17  11:32:45  matt
14212  * Changes in object system
14213  *
14214  * Revision 1.27  1994/02/16  17:08:43  matt
14215  * Added needed include of 3d.h
14216  *
14217  * Revision 1.26  1994/02/16  13:47:58  mike
14218  * fix bugs so editor can compile out.
14219  *
14220  * Revision 1.25  1994/02/11  21:52:13  matt
14221  * Made password protection selectable by #define (and thus INFERNO.INI)
14222  *
14223  * Revision 1.24  1994/02/10  15:35:56  matt
14224  * Various changes to make editor compile out.
14225  *
14226  * Revision 1.23  1994/02/02  12:34:29  mike
14227  * take out BATS encryption.
14228  *
14229  * Revision 1.22  1994/01/21  16:08:11  matt
14230  * Added FrameCount variable
14231  *
14232  * Revision 1.21  1994/01/06  17:13:10  john
14233  * Added Video clip functionality
14234  *
14235  * Revision 1.20  1993/12/08  17:45:08  matt
14236  * Changed password again
14237  *
14238  * Revision 1.19  1993/12/08  17:41:05  matt
14239  * Changed password
14240  *
14241  * Revision 1.18  1993/12/08  10:55:10  mike
14242  * Add free_obj_list
14243  *
14244  * Revision 1.17  1993/12/07  13:46:38  john
14245  * Added Explosion bitmap array
14246  *
14247  * Revision 1.16  1993/12/06  18:40:35  matt
14248  * Changed object loading & handling
14249  *
14250  * Revision 1.15  1993/12/05  22:47:48  matt
14251  * Reworked include files in an attempt to cut down on build times
14252  *
14253  * Revision 1.14  1993/12/01  11:44:11  matt
14254  * Chagned Frfract to FrameTime
14255  *
14256  * Revision 1.13  1993/12/01  00:27:11  yuan
14257  * Implemented new bitmap structure system...
14258  * overall bitmap scheme still needs some work.
14259  *
14260  * Revision 1.12  1993/11/19  17:21:59  matt
14261  * Changed the bitmap number of object class UNICLASS
14262  * Removed static initialization for objects
14263  *
14264  * Revision 1.11  1993/11/18  13:51:47  mike
14265  * Add Classes, Class_views, Objects
14266  *
14267  * Revision 1.10  1993/11/04  18:52:36  matt
14268  * Made Vertices[] and Segment_points[] use same constant for size, since
14269  * they must be the same size anyway
14270  *
14271  * Revision 1.9  1993/11/04  14:01:06  matt
14272  * Mucked with include files
14273  *
14274  * Revision 1.8  1993/10/26  13:58:42  mike
14275  * Add password protection.
14276  *
14277  * Revision 1.7  1993/10/14  18:05:50  mike
14278  * Change Side_to_verts to use MAX_SIDES_PER_SEGMENT in place of CONNECTIVITY
14279  *
14280  * Revision 1.6  1993/10/12  13:57:19  john
14281  * added texture[]
14282  *
14283  * Revision 1.5  1993/10/12  09:58:15  mike
14284  * Move Side_to_verts here from eglobal.c, since it is needed in the game.
14285  *
14286  * Revision 1.4  1993/10/09  15:52:30  mike
14287  * Move test_pos, test_orient here from render.c.
14288  *
14289  * Revision 1.3  1993/10/02  18:15:45  mike
14290  * Killed include of segment.h, which gets included by inferno.h.
14291  *
14292  * Revision 1.2  1993/09/23  17:54:24  mike
14293  * Add Segment_points
14294  *
14295  * Revision 1.1  1993/09/23  15:01:50  mike
14296  * Initial revision
14297
14298 ------------------------------------------------------------------------
14299 main/mission.c:
14300
14301  * Revision 1.4  1995/10/31  10:21:40  allender
14302  * no mission support in shareware
14303  *
14304  * Revision 1.3  1995/10/21  22:53:04  allender
14305  * moved missions to data folder
14306  *
14307  * Revision 1.2  1995/09/13  08:47:29  allender
14308  * made to work with Chris' direct stuff
14309  *
14310  * Revision 1.1  1995/05/16  15:27:48  allender
14311  * Initial revision
14312  *
14313  * Revision 2.9  1995/05/26  16:16:32  john
14314  * Split SATURN into define's for requiring cd, using cd, etc.
14315  * Also started adding all the Rockwell stuff.
14316  *
14317  * Revision 2.8  1995/03/20  15:49:31  mike
14318  * Remove eof char from comment which confused make depend, causing
14319  * no mission.obj: line in makefile.  Pretty stupid tool, huh?
14320  *
14321  * Revision 2.7  1995/03/20  12:12:11  john
14322  * Added ifdef SATURN.
14323  *
14324  * Revision 2.6  1995/03/15  14:32:49  john
14325  * Added code to force the Descent CD-rom in the drive.
14326  *
14327  * Revision 2.5  1995/03/15  11:41:15  john
14328  * Better Saturn CD-ROM support.
14329  *
14330  * Revision 2.4  1995/03/14  18:24:14  john
14331  * Force Destination Saturn to use CD-ROM drive.
14332  *
14333  * Revision 2.3  1995/03/07  14:19:41  mike
14334  * More destination saturn stuff.
14335  *
14336  * Revision 2.2  1995/03/06  23:09:03  mike
14337  * more saturn stuff: make briefings work for saturn mission.
14338  *
14339  * Revision 2.1  1995/03/06  16:47:48  mike
14340  * destination saturn
14341  *
14342  * Revision 2.0  1995/02/27  11:27:49  john
14343  * New version 2.0, which has no anonymous unions, builds with
14344  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14345  *
14346  * Revision 1.14  1995/02/15  11:30:37  john
14347  * Fixed bug with potential mem overwrite on line 160.
14348  *
14349  * Revision 1.13  1995/02/10  17:53:20  matt
14350  * Changed mission name again
14351  *
14352  * Revision 1.12  1995/02/10  17:35:38  matt
14353  * Changed name of built-in mission
14354  *
14355  * Revision 1.11  1995/02/07  17:13:51  allender
14356  * removed return statement in load_mission so that built in mission will
14357  * actually set the Current_mission_name and _filename
14358  *
14359  * Revision 1.10  1995/01/31  01:19:45  matt
14360  * Made build_mission_list() sort missions by name
14361  *
14362  * Revision 1.9  1995/01/30  13:49:58  allender
14363  * changed build_mission_list in load_mission_by_name to include
14364  * anarchy levels.
14365  *
14366  * Revision 1.8  1995/01/30  13:03:51  matt
14367  * Fixed dumb mistake
14368  *
14369  * Revision 1.7  1995/01/30  12:55:22  matt
14370  * Added vars to point to mission names
14371  *
14372  * Revision 1.6  1995/01/22  18:57:28  matt
14373  * Made player highest level work with missions
14374  *
14375  * Revision 1.5  1995/01/22  14:13:08  matt
14376  * Added flag in mission list for anarchy-only missions
14377  *
14378  * Revision 1.4  1995/01/21  23:13:12  matt
14379  * Made high scores with (not work, really) with loaded missions
14380  * Don't give player high score when quit game
14381  *
14382  * Revision 1.3  1995/01/21  16:27:12  matt
14383  * Made endlevel briefing work with missions
14384  *
14385  * Revision 1.2  1995/01/20  22:47:50  matt
14386  * Mission system implemented, though imcompletely
14387  *
14388  * Revision 1.1  1995/01/20  13:42:19  matt
14389  * Initial revision
14390
14391 ------------------------------------------------------------------------
14392 main/mission.h:
14393
14394  * Revision 1.1  1995/05/16  15:59:22  allender
14395  * Initial revision
14396  *
14397  * Revision 2.0  1995/02/27  11:31:35  john
14398  * New version 2.0, which has no anonymous unions, builds with
14399  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14400  *
14401  * Revision 1.6  1995/01/30  12:55:41  matt
14402  * Added vars to point to mission names
14403  *
14404  * Revision 1.5  1995/01/22  18:57:21  matt
14405  * Made player highest level work with missions
14406  *
14407  * Revision 1.4  1995/01/22  14:13:21  matt
14408  * Added flag in mission list for anarchy-only missions
14409  *
14410  * Revision 1.3  1995/01/21  23:13:12  matt
14411  * Made high scores with (not work, really) with loaded missions
14412  * Don't give player high score when quit game
14413  *
14414  * Revision 1.2  1995/01/20  22:47:53  matt
14415  * Mission system implemented, though imcompletely
14416  *
14417  * Revision 1.1  1995/01/20  13:42:26  matt
14418  * Initial revision
14419
14420 ------------------------------------------------------------------------
14421 main/modem.h:
14422
14423  * Revision 1.2  1995/09/05  14:06:40  allender
14424  * checkpoint again
14425  *
14426  * Revision 1.1  1995/05/16  15:59:29  allender
14427  * Initial revision
14428  *
14429  * Revision 2.1  1995/03/21  14:40:38  john
14430  * Ifdef'd out the NETWORK code.
14431  *
14432  * Revision 2.0  1995/02/27  11:31:34  john
14433  * New version 2.0, which has no anonymous unions, builds with
14434  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14435  *
14436  * Revision 1.18  1994/11/22  17:12:05  rob
14437  * Starting working on secret level fix for modem games.
14438  *
14439  * Revision 1.17  1994/11/17  16:43:17  rob
14440  * Added prototype for com_level_sync function.
14441  *
14442  * Revision 1.16  1994/11/15  21:30:32  rob
14443  * Added prototype for new menu hook.
14444  *
14445  * Revision 1.15  1994/10/07  16:15:33  rob
14446  * Changed calls to multi_send_position.
14447  *
14448  * Revision 1.14  1994/10/07  12:52:24  rob
14449  * Fixed some problems.
14450  *
14451  * Revision 1.13  1994/10/07  11:25:47  rob
14452  * Tried to fix modem to work with new multi stuff.  Still a bit jacked up, tho.
14453  *
14454  * Revision 1.12  1994/10/05  19:14:50  rob
14455  * Exported macros and arrays to support network object mapping.
14456  *
14457  * Revision 1.11  1994/10/05  17:48:59  rob
14458  * Several changes, most to end_of_level sequencing.
14459  *
14460  * Revision 1.10  1994/10/05  14:22:54  rob
14461  * Added com_end_level.
14462  *
14463  * Revision 1.9  1994/09/30  18:37:22  rob
14464  * Another day's worth of work.  Mostly menus, error checking.  Added
14465  * level checksums during sync, carrier detect during all com calls,
14466  * generic com_abort() procedure for bailing out, and nm_messagebox
14467  * handling of QUIT instead of HUD message (which never gets seen).
14468  *
14469  * Revision 1.8  1994/09/29  20:55:16  rob
14470  * Lots of changes.
14471  *
14472  * Revision 1.7  1994/09/29  16:09:20  rob
14473  * Added explode stuff.
14474  *
14475  * Revision 1.6  1994/09/28  14:31:08  rob
14476  * Added serial setup menu.
14477  *
14478  * Revision 1.5  1994/09/27  15:02:49  rob
14479  * Null modem basic routines working.  Sending DEAD messages and
14480  * missiles still need to be done.
14481  *
14482  * Revision 1.4  1994/09/24  16:52:33  rob
14483  * Added stubbed funcs for startup and stop of serial games.
14484  *
14485  * Revision 1.3  1994/09/24  14:47:31  rob
14486  * New function protos.
14487  *
14488  * Revision 1.2  1994/09/22  17:53:29  rob
14489  * First revision, not yet functional.
14490  *
14491  * Revision 1.1  1994/09/22  12:39:25  rob
14492  * Initial revision
14493
14494 ------------------------------------------------------------------------
14495 main/morph.c:
14496
14497  * Revision 1.5  1995/08/23  21:36:10  allender
14498  * mcc compiler warnings fixed
14499  *
14500  * Revision 1.4  1995/08/12  11:34:19  allender
14501  * removed #ifdef NEWDEMO -- always in
14502  *
14503  * Revision 1.3  1995/07/28  15:39:51  allender
14504  * removed fixdiv thing
14505  *
14506  * Revision 1.2  1995/07/28  15:21:23  allender
14507  * inverse magnitude fixup thing
14508  *
14509  * Revision 1.1  1995/05/16  15:28:05  allender
14510  * Initial revision
14511  *
14512  * Revision 2.1  1995/02/27  18:26:33  john
14513  * Fixed bug that was caused by externing Polygon_models, and I had
14514  * changed the type of it in polyobj.c, thus causing page faults.
14515  *
14516  * Revision 2.0  1995/02/27  11:27:44  john
14517  * New version 2.0, which has no anonymous unions, builds with
14518  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14519  *
14520  * Revision 1.35  1995/02/22  14:45:37  allender
14521  * remove anonymous unions from object structure
14522  *
14523  * Revision 1.34  1995/01/14  19:16:52  john
14524  * First version of new bitmap paging code.
14525  *
14526  * Revision 1.33  1995/01/03  20:38:36  john
14527  * Externed MAX_MORPH_OBJECTS
14528  *
14529  * Revision 1.32  1994/11/17  15:34:04  matt
14530  * Attempt #4 to fix morph bug
14531  *
14532  * Revision 1.31  1994/11/15  10:57:14  matt
14533  * Tried again to fix morph
14534  *
14535  * Revision 1.30  1994/11/14  14:06:45  matt
14536  * Fixed stupid bug
14537  *
14538  * Revision 1.29  1994/11/14  11:55:13  matt
14539  * Added divide overflow check
14540  *
14541  * Revision 1.28  1994/09/26  17:28:14  matt
14542  * Made new multiple-object morph code work with the demo system
14543  *
14544  * Revision 1.27  1994/09/26  15:39:56  matt
14545  * Allow multiple simultaneous morphing objects
14546  *
14547  * Revision 1.26  1994/09/11  22:44:59  mike
14548  * quick on vecmat function.
14549  *
14550  * Revision 1.25  1994/08/26  15:36:00  matt
14551  * Made eclips usable on more than one object at a time
14552  *
14553  * Revision 1.24  1994/07/25  00:02:46  matt
14554  * Various changes to accomodate new 3d, which no longer takes point numbers
14555  * as parms, and now only takes pointers to points.
14556  *
14557  * Revision 1.23  1994/07/12  12:39:58  matt
14558  * Revamped physics system
14559  *
14560  * Revision 1.22  1994/06/28  11:54:51  john
14561  * Made newdemo system record/play directly to/from disk, so
14562  * we don't need the 4 MB buffer anymore.
14563  *
14564  * Revision 1.21  1994/06/27  15:53:01  john
14565  * #define'd out the newdemo stuff
14566  *
14567  *
14568  * Revision 1.20  1994/06/16  14:30:19  matt
14569  * Moved morph record data call to reder routine
14570  *
14571  * Revision 1.19  1994/06/16  13:57:23  matt
14572  * Added support for morphing objects in demos
14573  *
14574  * Revision 1.18  1994/06/16  12:24:23  matt
14575  * Made robot lighting not mess with Lighting_on so robots now night
14576  * according to this variable.
14577  *
14578  * Revision 1.17  1994/06/14  16:55:01  matt
14579  * Got rid of physics_object speed field
14580  *
14581  * Revision 1.16  1994/06/08  21:16:29  matt
14582  * Made objects spin while morphing
14583  *
14584  * Revision 1.15  1994/06/08  18:21:53  matt
14585  * Made morphing objects light correctly
14586  *
14587  * Revision 1.14  1994/06/07  16:50:49  matt
14588  * Made object lighting work correctly; changed name of Ambient_light to
14589  * Dynamic_light; cleaned up polygobj object rendering a little.
14590  *
14591  * Revision 1.13  1994/06/01  16:33:59  yuan
14592  * Fixed bug.
14593  *
14594  *
14595  * Revision 1.12  1994/06/01  16:29:08  matt
14596  * If morph_frame called on object this isn't the morph object, kill it.
14597  *
14598  * Revision 1.11  1994/06/01  12:46:34  matt
14599  * Added needed include
14600  *
14601  * Revision 1.10  1994/05/31  22:12:41  matt
14602  * Set lighting for morph objects
14603  * Don't let another object start morph while one is morphing, unless
14604  * that one dies.
14605  *
14606  * Revision 1.9  1994/05/31  18:49:53  john
14607  * Took out debugging printf's that Matt left in.
14608  *
14609  * Revision 1.8  1994/05/30  22:50:22  matt
14610  * Added morph effect for robots
14611
14612 ------------------------------------------------------------------------
14613 main/morph.h:
14614
14615  * Revision 1.2  1995/08/23  21:35:58  allender
14616  * fix mcc compiler warnings
14617  *
14618  * Revision 1.1  1995/05/16  15:59:37  allender
14619  * Initial revision
14620  *
14621  * Revision 2.0  1995/02/27  11:32:19  john
14622  * New version 2.0, which has no anonymous unions, builds with
14623  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14624  *
14625  * Revision 1.9  1995/01/04  12:20:46  john
14626  * Declearations to work better with game state save.
14627  *
14628  *
14629  * Revision 1.8  1995/01/03  20:38:44  john
14630  * Externed MAX_MORPH_OBJECTS
14631  *
14632  * Revision 1.7  1994/09/26  17:28:33  matt
14633  * Made new multiple-object morph code work with the demo system
14634  *
14635  * Revision 1.6  1994/09/26  15:40:17  matt
14636  * Allow multiple simultaneous morphing objects
14637  *
14638  * Revision 1.5  1994/06/28  11:55:19  john
14639  * Made newdemo system record/play directly to/from disk, so
14640  * we don't need the 4 MB buffer anymore.
14641  *
14642  * Revision 1.4  1994/06/16  13:57:40  matt
14643  * Added support for morphing objects in demos
14644  *
14645  * Revision 1.3  1994/06/08  18:22:03  matt
14646  * Made morphing objects light correctly
14647  *
14648  * Revision 1.2  1994/05/30  22:50:25  matt
14649  * Added morph effect for robots
14650  *
14651  * Revision 1.1  1994/05/30  12:04:19  matt
14652  * Initial revision
14653
14654 ------------------------------------------------------------------------
14655 main/multi.h:
14656
14657  * Revision 2.3  1995/04/03  08:49:50  john
14658  * Added code to get someone's player struct.
14659  *
14660  * Revision 2.2  1995/03/27  12:59:17  john
14661  * Initial version of multiplayer save games.
14662  *
14663  * Revision 2.1  1995/03/21  14:39:06  john
14664  * Ifdef'd out the NETWORK code.
14665  *
14666  * Revision 2.0  1995/02/27  11:28:34  john
14667  * New version 2.0, which has no anonymous unions, builds with
14668  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14669  *
14670  * Revision 1.74  1995/02/11  11:36:42  rob
14671  * Added new var.
14672  *
14673  * Revision 1.73  1995/02/08  18:17:41  rob
14674  * Added prototype for reset function.
14675  *
14676  * Revision 1.72  1995/02/05  14:37:42  rob
14677  * Made object mapping more efficient.
14678  *
14679  * Revision 1.71  1995/02/01  18:07:36  rob
14680  * Change object mapping to int functions.
14681  *
14682  * Revision 1.70  1995/02/01  12:55:00  rob
14683  * Changed message type.
14684  *
14685  * Revision 1.69  1995/01/31  12:46:12  rob
14686  * Fixed a bug with object overflow handling.
14687  *
14688  * Revision 1.68  1995/01/27  11:15:13  rob
14689  * removed extern of variable no longer in multi.c
14690  *
14691  * Revision 1.67  1995/01/24  11:53:13  john
14692  * Added better macro defining code.
14693  *
14694  * Revision 1.66  1995/01/24  11:32:03  john
14695  * Added new defining macro method.
14696  *
14697  * Revision 1.65  1995/01/23  17:17:06  john
14698  * Added multi_sending_message.
14699  *
14700  * Revision 1.64  1995/01/23  16:02:42  rob
14701  * Added prototype for mission select function.
14702  *
14703  * Revision 1.63  1995/01/18  19:01:21  rob
14704  * Added new message for hostage door sync.
14705  *
14706  * Revision 1.62  1995/01/14  18:39:57  rob
14707  * Added new message type for dropping robot powerups.
14708  *
14709  * Revision 1.61  1995/01/12  21:41:13  rob
14710  * Fixed incompat. with 1.0 and 1.1.
14711  *
14712  * Revision 1.60  1995/01/04  21:40:55  rob
14713  * Added new type for boss actions in coop.
14714  *
14715  * Revision 1.59  1995/01/04  11:38:09  rob
14716  * Fixed problem with lost character in messages.
14717  *
14718  * Revision 1.58  1995/01/03  20:12:44  rob
14719  * Made max message length in shareware = 40.
14720  *
14721  * Revision 1.57  1995/01/03  14:27:25  rob
14722  * ADded trigger messages.
14723  *
14724  * Revision 1.56  1995/01/02  20:08:21  rob
14725  * Added robot creation.
14726  *
14727  * Revision 1.55  1995/01/02  14:41:30  rob
14728  * Added score syncing.
14729  *
14730  * Revision 1.54  1994/12/21  21:02:01  rob
14731  * Added new message type for ROBOT_FIRE
14732  *
14733  * Revision 1.53  1994/12/21  17:27:25  rob
14734  * Changed the format for send_create_powerup messages.
14735  *
14736  *
14737  * Revision 1.52  1994/12/20  20:41:39  rob
14738  * ADded robot release message type.
14739  *
14740  * Revision 1.51  1994/12/19  19:00:12  rob
14741  * Changed buf to multibuf so it can be safely externed.
14742  *
14743  * Revision 1.50  1994/12/19  16:41:14  rob
14744  * Added new message types for robot support.
14745  * Added prototype for external use of multi_send_data (from multibot.c)
14746  *
14747  * Revision 1.49  1994/12/11  13:30:13  rob
14748  * Added new variables to get players out of nested menus.
14749  *
14750  * Revision 1.48  1994/12/11  01:58:57  rob
14751  * Added variable to track menu deth..
14752  *
14753  * Revision 1.47  1994/12/08  12:41:17  rob
14754  * Added audio taunts.
14755  *
14756  * Revision 1.46  1994/12/07  21:53:12  rob
14757  * Fixing sequencing bugginess in modem/serial.
14758  *
14759  * Revision 1.45  1994/12/07  16:46:58  rob
14760  * Added prototype.
14761  *
14762  * Revision 1.44  1994/12/01  12:22:31  rob
14763  * Added de-cloak message for demo.
14764  *
14765  * Revision 1.43  1994/12/01  00:54:14  rob
14766  * Added variable for tracking homing missiles.
14767  *
14768  * Revision 1.42  1994/11/30  16:04:39  rob
14769  * Added show reticle name variable for team games.
14770  *
14771  * Revision 1.41  1994/11/29  19:33:38  rob
14772  * Team support.
14773  *
14774  * Revision 1.40  1994/11/29  12:49:37  rob
14775  * Added more team support stuff.
14776  *
14777  * Revision 1.39  1994/11/28  21:20:49  rob
14778  * Cleaned up the .h file, removed an unused function.
14779  *
14780  * Revision 1.38  1994/11/28  21:04:50  rob
14781  * Added support for network sound-casting.
14782  *
14783  * Revision 1.37  1994/11/28  14:02:08  rob
14784  * Added protocol versioning for registered versus shareware.
14785  *
14786  * Revision 1.36  1994/11/28  13:30:04  rob
14787  * Added a define for protocol version.
14788  *
14789  * Revision 1.35  1994/11/22  19:19:48  rob
14790  * remove unused function.
14791  *
14792  * Revision 1.34  1994/11/22  18:47:34  rob
14793  * Added hooks for modem support for secret levels.
14794  *
14795  * Revision 1.33  1994/11/22  17:10:50  rob
14796  * Fix for secret levels in network play mode.
14797  *
14798  * Revision 1.32  1994/11/21  16:00:28  rob
14799  * Added secret-level hooks.
14800  *
14801  * Revision 1.31  1994/11/18  18:28:50  rob
14802  * Added new function for multiplayer score screen.
14803  *
14804  * Revision 1.30  1994/11/18  16:31:05  rob
14805  * Added kill list timer variable.
14806  *
14807  * Revision 1.29  1994/11/17  16:38:15  rob
14808  * Added creation of net powerups.
14809  *
14810  * Revision 1.28  1994/11/17  13:37:33  rob
14811  * Added prototype for multi_new_game.
14812  *
14813  * Revision 1.27  1994/11/17  12:58:45  rob
14814  * Added kill matrix.
14815  *
14816  * Revision 1.26  1994/11/16  20:35:24  rob
14817  * Changed explosion hook.
14818  *
14819  * Revision 1.25  1994/11/15  21:31:13  rob
14820  * Bumped max message size, was giving modem.c fits.
14821  *
14822  * Revision 1.24  1994/11/15  19:28:37  matt
14823  * Added prototypes
14824  *
14825  * Revision 1.23  1994/11/14  17:22:19  rob
14826  * Added extern for message macros.
14827  *
14828  * Revision 1.22  1994/11/11  18:16:44  rob
14829  * Made multi_menu_poll return a value to exit menus.
14830  *
14831  * Revision 1.21  1994/11/11  11:06:19  rob
14832  * Added prototype for multi_menu_poll.
14833  *
14834  * Revision 1.20  1994/11/10  21:48:41  rob
14835  * Changed multi_endlevel to return an int.
14836  *
14837  * Revision 1.19  1994/11/08  17:48:14  rob
14838  * Fixing endlevel stuff.
14839  *
14840  * Revision 1.18  1994/11/07  17:49:07  rob
14841  * Changed prototype for object mapping funcs.
14842  *
14843  * Revision 1.17  1994/11/07  15:46:32  rob
14844  * Changed the way remote object number mapping works, and it was a real
14845  * pain in the ass..  I think it will work more reliably now.
14846  *
14847  * Revision 1.16  1994/11/04  19:53:01  rob
14848  * Added a new message type for Player_leave 'explosions'.
14849  * Added a prototype for function moved over from network.c
14850  *
14851  * Revision 1.15  1994/11/02  18:02:33  rob
14852  * Added message type for control center firing.
14853  *
14854  * Revision 1.14  1994/11/02  11:38:00  rob
14855  * Added player-in-process-of-dying explosions to network game.
14856  *
14857  * Revision 1.13  1994/11/01  19:31:44  rob
14858  * Bumped max_net_create_objects to 20 to accomodate a fully equipped
14859  * character blowing up.
14860  *
14861  * Revision 1.12  1994/10/31  13:48:02  rob
14862  * Fixed bug in opening doors over network/modem.  Added a new message
14863  * type to multi.c that communicates door openings across the net.
14864  * Changed includes in multi.c and wall.c to accomplish this.
14865  *
14866  * Revision 1.11  1994/10/09  20:08:20  rob
14867  * Added some exported func prototypes.
14868  * Changed max net message length to 25 (from 30).
14869  * Removed some message types no longer used.
14870  *
14871  * Revision 1.10  1994/10/08  20:06:10  rob
14872  * fixed a typo.
14873  *
14874  * Revision 1.9  1994/10/08  19:59:43  rob
14875  * Moved MAX_MESSAGE_LEN to here.
14876  *
14877  * Revision 1.8  1994/10/07  23:09:54  rob
14878  * Fixed some prototypes.
14879  *
14880  * Revision 1.7  1994/10/07  18:11:19  rob
14881  * Added multi_do_death to multi.c.
14882  *
14883  * Revision 1.6  1994/10/07  16:14:32  rob
14884  * Added new message type for player reappear
14885  *
14886  * Revision 1.5  1994/10/07  12:58:17  rob
14887  * Added multi_leave_game.
14888  *
14889  * Revision 1.4  1994/10/07  12:17:17  rob
14890  * Fixed some stuff in multi_do_frame and exported the message_length
14891  * array.
14892  *
14893  * Revision 1.3  1994/10/07  11:10:17  john
14894  * Added function to parse multiple messages into individual
14895  * messages.
14896  *
14897  * Revision 1.2  1994/10/07  10:28:06  rob
14898  * Headers and stuff for multi.c (obviously)
14899  *
14900  * Revision 1.1  1994/10/06  16:07:39  rob
14901  * Initial revision
14902
14903 ------------------------------------------------------------------------
14904 main/multibot.h:
14905
14906  * Revision 1.2  1995/08/24  16:04:38  allender
14907  * fix function prototype for compiler warning
14908  *
14909  * Revision 1.1  1995/05/16  15:59:53  allender
14910  * Initial revision
14911  *
14912  * Revision 2.1  1995/03/21  14:40:18  john
14913  * Ifdef'd out the NETWORK code.
14914  *
14915  * Revision 2.0  1995/02/27  11:30:57  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.20  1995/02/06  18:18:05  rob
14920  * Tweaking cooperative stuff.
14921  *
14922  * Revision 1.19  1995/02/04  16:49:50  rob
14923  * Changed multi_send_robot_frame to return the number of robot positions that were sent.
14924  *
14925  * Revision 1.18  1995/02/04  12:29:32  rob
14926  * Added buffered fire sends.
14927  *
14928  * Revision 1.17  1995/01/30  17:22:02  rob
14929  * Added prototype for modem robot send function.
14930  *
14931  * Revision 1.16  1995/01/26  18:24:56  rob
14932  * Reduced # of controlled bots.
14933  *
14934  * Revision 1.15  1995/01/25  19:26:35  rob
14935  * Added define for robot laser agitation.
14936  *
14937  * Revision 1.14  1995/01/25  13:45:26  rob
14938  * Added prototype of robot transfer fucm.
14939  *
14940  * Revision 1.13  1995/01/14  19:01:08  rob
14941  * Added prototypes for new functionality.
14942  *
14943  * Revision 1.12  1995/01/12  16:41:53  rob
14944  * Added new prototypes.
14945  *
14946  * Revision 1.11  1995/01/12  15:42:55  rob
14947  * Fixing score awards for coop.
14948  *
14949  * Revision 1.10  1995/01/02  21:00:40  rob
14950  * added robot matcen support.
14951  *
14952  * Revision 1.9  1994/12/31  21:03:53  rob
14953  * More tweaking for robot behavior.
14954  *
14955  * Revision 1.8  1994/12/29  13:54:25  rob
14956  * Ooops.. fixed a bug..
14957  *
14958  * Revision 1.7  1994/12/29  12:51:38  rob
14959  * ADded proto for multi_robot_explode_sub
14960  *
14961  * Revision 1.6  1994/12/21  21:08:32  rob
14962  * Added new functions for robot firing.
14963  *
14964  * Revision 1.5  1994/12/21  19:04:02  rob
14965  * Fixing score accounting for multi robot games.
14966  *
14967  * Revision 1.4  1994/12/21  17:36:09  rob
14968  * Added a new func.
14969  *
14970  * Revision 1.3  1994/12/21  11:12:02  rob
14971  * Added new function and new vars.
14972  *
14973  * Revision 1.2  1994/12/19  16:41:42  rob
14974  * first revision.
14975  *
14976  * Revision 1.1  1994/12/16  15:48:20  rob
14977  * Initial revision
14978
14979 ------------------------------------------------------------------------
14980 main/netmisc.c:
14981
14982  * Revision 1.1  1995/05/16  15:28:41  allender
14983  * Initial revision
14984  *
14985  * Revision 2.0  1995/02/27  11:27:24  john
14986  * New version 2.0, which has no anonymous unions, builds with
14987  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14988  *
14989  * Revision 1.3  1994/11/19  15:19:34  mike
14990  * rip out unused code and data.
14991  *
14992  * Revision 1.2  1994/08/09  19:31:53  john
14993  * Networking changes.
14994  *
14995  * Revision 1.1  1994/08/08  11:06:07  john
14996  * Initial revision
14997
14998 ------------------------------------------------------------------------
14999 main/netmisc.h:
15000
15001  * Revision 1.1  1995/05/16  16:00:08  allender
15002  * Initial revision
15003  *
15004  * Revision 2.0  1995/02/27  11:30:18  john
15005  * New version 2.0, which has no anonymous unions, builds with
15006  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15007  *
15008  * Revision 1.2  1994/08/09  19:31:54  john
15009  * Networking changes.
15010  *
15011  * Revision 1.1  1994/08/08  11:18:40  john
15012  * Initial revision
15013
15014 ------------------------------------------------------------------------
15015 main/network.h:
15016
15017  * Revision 1.7  1995/10/31  10:20:04  allender
15018  * shareware stuff
15019  *
15020  * Revision 1.6  1995/09/21  14:31:18  allender
15021  * new appltalk type packet which contains shortpos
15022  *
15023  * Revision 1.5  1995/09/18  08:07:08  allender
15024  * added function prototype to remove netgame NBP
15025  *
15026  * Revision 1.4  1995/08/31  15:51:55  allender
15027  * new prototypes for join and start games
15028  *
15029  * Revision 1.3  1995/07/26  17:02:29  allender
15030  * implemented and working on mac
15031  *
15032  * Revision 1.2  1995/06/02  07:42:34  allender
15033  * fixed prototype for network_endlevel_poll2
15034  *
15035  * Revision 1.1  1995/05/16  16:00:15  allender
15036  * Initial revision
15037  *
15038  * Revision 2.2  1995/03/21  14:58:09  john
15039  * *** empty log message ***
15040  *
15041  * Revision 2.1  1995/03/21  14:39:43  john
15042  * Ifdef'd out the NETWORK code.
15043  *
15044  * Revision 2.0  1995/02/27  11:29:48  john
15045  * New version 2.0, which has no anonymous unions, builds with
15046  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15047  *
15048  * Revision 1.72  1995/02/11  14:24:39  rob
15049  * Added suppor for invul. cntrlcen.
15050  *
15051  * Revision 1.71  1995/02/08  19:18:43  rob
15052  * Added extern for segments checksum.
15053  *
15054  * Revision 1.70  1995/02/08  11:01:16  rob
15055  * Fixed a bug.
15056  *
15057  * Revision 1.69  1995/02/07  21:16:49  rob
15058  * Added flag for automap.
15059  *
15060  * Revision 1.68  1995/02/06  18:18:33  rob
15061  * Extern'ed Packet Urgent.
15062  *
15063  * Revision 1.67  1995/02/05  14:36:29  rob
15064  * Moved defines to network.h.
15065  *
15066  * Revision 1.66  1995/02/01  16:34:09  john
15067  * Linted.
15068  *
15069  * Revision 1.65  1995/01/30  21:14:35  rob
15070  * Fixed a bug in join menu.
15071  * Simplified mission load support.
15072  *
15073  * Revision 1.64  1995/01/30  18:19:40  rob
15074  * Added mission title to gameinfo packet.
15075  *
15076  * Revision 1.63  1995/01/28  17:02:39  rob
15077  * Fixed monitor syncing bug (minor 19).
15078  *
15079  * Revision 1.62  1995/01/27  11:15:25  rob
15080  * removed extern of variable no longer in network.c
15081  *
15082  * Revision 1.61  1995/01/26  12:17:34  rob
15083  * Added new param to network_do_frame.
15084  *
15085  * Revision 1.60  1995/01/22  17:32:11  rob
15086  * Added mission support for network games.
15087  *
15088  * Revision 1.59  1995/01/17  17:10:33  rob
15089  * Added some flags to netgame struct.
15090  *
15091  * Revision 1.58  1995/01/12  18:57:15  rob
15092  * Added score resync stuff.
15093  *
15094  * Revision 1.57  1995/01/12  16:42:18  rob
15095  * Added new prototypes.
15096  *
15097  * Revision 1.56  1995/01/05  12:12:10  rob
15098  * Fixed a problem with packet size.
15099  *
15100  * Revision 1.55  1995/01/05  11:12:36  rob
15101  * Reduced packet size by 1 byte just to be safe.
15102  *
15103  * Revision 1.54  1995/01/04  21:39:32  rob
15104  * New framedata packet for registered.
15105  *
15106  * Revision 1.53  1995/01/04  08:47:04  rob
15107  * JOHN CHECKED IN FOR ROB !!!
15108  *
15109  * Revision 1.52  1994/12/30  20:09:07  rob
15110  * ADded a toggle for showing player names on HUD.
15111  *
15112  * Revision 1.51  1994/12/29  15:59:52  rob
15113  * Centralized network disconnects.
15114  *
15115  * Revision 1.50  1994/12/09  21:21:57  rob
15116  * rolled back changes.
15117  *
15118  * Revision 1.48  1994/12/05  22:59:27  rob
15119  * added prototype for send_endlevel_packet.
15120  *
15121  * Revision 1.47  1994/12/05  21:47:34  rob
15122  * Added a new field to netgame struct.
15123  *
15124  * Revision 1.46  1994/12/05  14:39:16  rob
15125  * Added new variable to indicate new net game starting.
15126  *
15127  * Revision 1.45  1994/12/04  15:37:18  rob
15128  * Fixed a typo.
15129  *
15130  * Revision 1.44  1994/12/04  15:30:42  rob
15131  * Added new fields to netgame struct.
15132  *
15133  * Revision 1.43  1994/12/03  18:03:19  rob
15134  * ADded team kill syncing.
15135  *
15136  * Revision 1.42  1994/12/01  21:21:27  rob
15137  * Added new system for object sync on rejoin.
15138  *
15139  * Revision 1.41  1994/11/29  13:07:33  rob
15140  * Changed structure defs to .h files.
15141  *
15142  * Revision 1.40  1994/11/22  17:10:48  rob
15143  * Fix for secret levels in network play mode.
15144  *
15145  * Revision 1.39  1994/11/18  16:36:31  rob
15146  * Added variable network_rejoined to enable random placement
15147  * of rejoining palyers.
15148  *
15149  * Revision 1.38  1994/11/12  19:51:13  rob
15150  * Changed prototype for network_send_data to pass
15151  * urgent flag.
15152  *
15153  * Revision 1.37  1994/11/10  21:48:26  rob
15154  * Changed net_endlevel to return an int.
15155  *
15156  * Revision 1.36  1994/11/10  20:32:49  rob
15157  * Added extern for LastPacketTime.
15158  *
15159  * Revision 1.35  1994/11/09  11:36:34  rob
15160  * ADded return value to network_level_sync for success/fail.
15161  *
15162  * Revision 1.34  1994/11/08  21:22:31  rob
15163  * Added proto for network_endlevel_snyc
15164  *
15165  * Revision 1.33  1994/11/08  15:20:00  rob
15166  * added proto for change_playernum_to
15167  *
15168  * Revision 1.32  1994/11/07  17:45:40  rob
15169  * Added prototype for network_endlevel (called from multi.c)
15170  *
15171  * Revision 1.31  1994/11/04  19:52:37  rob
15172  * Removed a function from network.h (network_show_player_list)
15173  *
15174  * Revision 1.30  1994/11/01  19:39:26  rob
15175  * Removed a couple of variables that should be externed from multi.c
15176  * (remnants of the changover)
15177  *
15178  * Revision 1.29  1994/10/31  19:18:24  rob
15179  * Changed prototype for network_do_frame to add a parameter if you wish
15180  * to force the frame to be sent.  Important if this is a leave_game frame.
15181  *
15182  * Revision 1.28  1994/10/08  19:59:20  rob
15183  * Removed network message variables.
15184  *
15185  * Revision 1.27  1994/10/08  11:08:38  john
15186  * Moved network_delete_unused objects into multi.c,
15187  * took out network callsign stuff and used Matt's net
15188  * players[.].callsign stuff.
15189  *
15190  * Revision 1.26  1994/10/07  11:26:20  rob
15191  * Changed network_start_frame to network_do_frame,.
15192  *
15193  *
15194  * Revision 1.25  1994/10/05  13:58:10  rob
15195  * Added a new function net_endlevel that is called after each level is
15196  * completed.  Currently it only does anything if SERIAL game is in effect.
15197  *
15198  * Revision 1.24  1994/10/04  19:34:57  rob
15199  * export network_find_max_net_players.
15200  *
15201  * Revision 1.23  1994/10/04  17:31:10  rob
15202  * Exported MaxNumNetPlayers.
15203  *
15204  * Revision 1.22  1994/10/03  22:57:30  matt
15205  * Took out redundant definition of callsign_len
15206  *
15207  * Revision 1.21  1994/10/03  15:12:48  rob
15208  * Boosted MAX_CREATE_OBJECTS to 15.
15209  *
15210  * Revision 1.20  1994/09/30  18:19:51  rob
15211  * Added two new variables for tracking object creation.
15212  *
15213  * Revision 1.19  1994/09/27  15:03:18  rob
15214  * Added prototype for network_delete_extra_objects used by modem.c
15215  *
15216  * Revision 1.18  1994/09/27  14:36:45  rob
15217  * Added two new varaibles for network/serial weapon firing.
15218  *
15219  * Revision 1.17  1994/09/07  17:10:57  john
15220  * Started adding code to sync powerups.
15221  *
15222  * Revision 1.16  1994/09/06  19:29:05  john
15223  * Added trial version of rejoin function.
15224  *
15225  * Revision 1.15  1994/08/26  13:01:54  john
15226  * Put high score system in.
15227  *
15228  * Revision 1.14  1994/08/25  18:12:04  matt
15229  * Made player's weapons and flares fire from the positions on the 3d model.
15230  * Also added support for quad lasers.
15231  *
15232  * Revision 1.13  1994/08/17  16:50:00  john
15233  * Added damaging fireballs, missiles.
15234  *
15235  * Revision 1.12  1994/08/16  12:25:22  john
15236  * Added hooks for sending messages.
15237  *
15238  * Revision 1.11  1994/08/13  12:20:18  john
15239  * Made the networking uise the Players array.
15240  *
15241  * Revision 1.10  1994/08/12  22:41:27  john
15242  * Took away Player_stats; add Players array.
15243  *
15244  * Revision 1.9  1994/08/12  03:10:22  john
15245  * Made network be default off; Moved network options into
15246  * main menu.  Made starting net game check that mines are the
15247  * same.
15248  *
15249  * Revision 1.8  1994/08/11  21:57:08  john
15250  * Moved network options to main menu.
15251  *
15252  * Revision 1.7  1994/08/10  11:29:20  john
15253  * *** empty log message ***
15254  *
15255  * Revision 1.6  1994/08/10  10:44:12  john
15256  * Made net players fire..
15257  *
15258  * Revision 1.5  1994/08/09  19:31:46  john
15259  * Networking changes.
15260  *
15261  * Revision 1.4  1994/08/05  16:30:26  john
15262  * Added capability to turn off network.
15263  *
15264  * Revision 1.3  1994/08/05  16:11:43  john
15265  * Psuedo working version of networking.
15266  *
15267  * Revision 1.2  1994/07/25  12:33:34  john
15268  * Network "pinging" in.
15269  *
15270  * Revision 1.1  1994/07/20  16:09:05  john
15271  * Initial revision
15272
15273 ------------------------------------------------------------------------
15274 main/newdemo.c:
15275
15276  * Revision 1.12  1995/10/31  10:19:43  allender
15277  * shareware stuff
15278  *
15279  * Revision 1.11  1995/10/17  13:19:16  allender
15280  * close boxes for demo save
15281  *
15282  * Revision 1.10  1995/10/05  10:36:07  allender
15283  * fixed calls to digi_play_sample to account for differing volume and angle calculations
15284  *
15285  * Revision 1.9  1995/09/12  15:49:13  allender
15286  * define __useAppleExts__ if not already defined
15287  *
15288  * Revision 1.8  1995/09/05  14:28:32  allender
15289  * fixed previous N_players bug in newdemo_goto_end
15290  *
15291  * Revision 1.7  1995/09/05  14:16:51  allender
15292  * added space to allowable demo filename characters
15293  * and fixed bug with netgame demos N_players got getting
15294  * set correctly
15295  *
15296  * Revision 1.6  1995/09/01  16:10:47  allender
15297  * fixed bug with reading in N_players variable on
15298  * netgame demo playback
15299  *
15300  * Revision 1.5  1995/08/24  16:04:11  allender
15301  * fix signed byte problem
15302  *
15303  * Revision 1.4  1995/08/12  12:21:59  allender
15304  * made call to create_shortpos not swap the shortpos
15305  * elements
15306  *
15307  * Revision 1.3  1995/08/01  16:04:19  allender
15308  * made random picking of demo work
15309  *
15310  * Revision 1.2  1995/08/01  13:56:56  allender
15311  * demo system working on the mac
15312  *
15313  * Revision 1.1  1995/05/16  15:28:59  allender
15314  * Initial revision
15315  *
15316  * Revision 2.7  1995/05/26  16:16:06  john
15317  * Split SATURN into define's for requiring cd, using cd, etc.
15318  * Also started adding all the Rockwell stuff.
15319  *
15320  * Revision 2.6  1995/03/21  14:39:38  john
15321  * Ifdef'd out the NETWORK code.
15322  *
15323  * Revision 2.5  1995/03/14  18:24:31  john
15324  * Force Destination Saturn to use CD-ROM drive.
15325  *
15326  * Revision 2.4  1995/03/14  16:22:29  john
15327  * Added cdrom alternate directory stuff.
15328  *
15329  * Revision 2.3  1995/03/10  12:58:33  allender
15330  * only display rear view cockpit when cockpit mode was CM_FULL_COCKPIT.
15331  *
15332  * Revision 2.2  1995/03/08  16:12:15  allender
15333  * changes for Destination Saturn
15334  *
15335  * Revision 2.1  1995/03/08  12:11:26  allender
15336  * fix shortpos reading
15337  *
15338  * Revision 2.0  1995/02/27  11:29:40  john
15339  * New version 2.0, which has no anonymous unions, builds with
15340  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15341  *
15342  * Revision 1.189  1995/02/22  14:53:42  allender
15343  * missed some anonymous stuff
15344  *
15345  * Revision 1.188  1995/02/22  13:24:53  john
15346  * Removed the vecmat anonymous unions.
15347  *
15348  * Revision 1.187  1995/02/22  13:13:54  allender
15349  * remove anonymous unions from object structure
15350  *
15351  * Revision 1.186  1995/02/14  15:36:41  allender
15352  * fix fix for morph effect
15353  *
15354  * Revision 1.185  1995/02/14  11:25:48  allender
15355  * save cockpit mode and restore after playback.  get orientation for morph
15356  * effect when object is morph vclip
15357  *
15358  * Revision 1.184  1995/02/13  12:18:14  allender
15359  * change to decide about interpolating or not
15360  *
15361  * Revision 1.183  1995/02/12  00:46:23  adam
15362  * don't decide to skip frames until after at least 10 frames have
15363  * passed -- allender
15364  *
15365  * Revision 1.182  1995/02/11  22:34:01  john
15366  * Made textures page in for newdemos before playback time.
15367  *
15368  * Revision 1.181  1995/02/11  17:28:32  allender
15369  * strip frames from end of demo
15370  *
15371  * Revision 1.180  1995/02/11  16:40:35  allender
15372  * start of frame stripping debug code
15373  *
15374  * Revision 1.179  1995/02/10  17:40:06  allender
15375  * put back in wall_hit_process code to fix door problem
15376  *
15377  * Revision 1.178  1995/02/10  17:17:24  adam
15378  * allender } fix
15379  *
15380  * Revision 1.177  1995/02/10  17:16:24  allender
15381  * fix possible tmap problems
15382  *
15383  * Revision 1.176  1995/02/10  15:54:37  allender
15384  * changes for out of space on device.
15385  *
15386  * Revision 1.175  1995/02/09  19:55:00  allender
15387  * fix bug with morph recording -- force rendertype to RT_POLYOBJ when
15388  * playing back since it won't render until fully morphed otherwise
15389  *
15390  * Revision 1.174  1995/02/07  17:15:35  allender
15391  * DOH!!!!!
15392  *
15393  * Revision 1.173  1995/02/07  17:14:21  allender
15394  * immediately return when loading bogus level stuff when reading a frame
15395  *
15396  * Revision 1.172  1995/02/02  11:15:03  allender
15397  * after loading new level, read next frame (forward or back) always because
15398  * of co-op ships showing up when level is loaded
15399  *
15400  * Revision 1.171  1995/02/02  10:24:16  allender
15401  * removed cfile stuff.  Use standard FILE functions for demo playback
15402  *
15403  * Revision 1.170  1995/01/30  13:54:32  allender
15404  * support for missions
15405  *
15406  * Revision 1.169  1995/01/27  16:27:35  allender
15407  * put game mode to demo_game_mode when sorting multiplayer kill (and score)
15408  * list
15409  *
15410  * Revision 1.168  1995/01/27  09:52:25  allender
15411  * minor changes because of object/segment linking problems
15412  *
15413  * Revision 1.167  1995/01/27  09:22:28  allender
15414  * changed way multi-player score is recorded.  Record difference, not
15415  * actual
15416  *
15417  * Revision 1.166  1995/01/25  14:32:44  allender
15418  * changed with recorded player flags.  More checks for paused state
15419  * during interpolation reading of objects
15420  *
15421  * Revision 1.165  1995/01/25  11:23:32  allender
15422  * found bug with out of disk space problem
15423  *
15424  * Revision 1.164  1995/01/25  11:11:33  allender
15425  * coupla' things.  Fix problem with objects apparently being linked in
15426  * the wrong segment.  Put an Int3 in to check why demos will write to
15427  * end of space on drive. close demo file if demo doens't start playing
15428  * back.  Put obj->type == OBJ_ROBOT around checking for boss cloaking
15429  *
15430  * Revision 1.163  1995/01/24  19:44:30  allender
15431  * fix obscure problem with rewinding and having the wrong object linked
15432  * to the wrong segments.  will investigate further.
15433  *
15434  * Revision 1.162  1995/01/23  09:31:28  allender
15435  * add team score in team mode playback
15436  *
15437  * Revision 1.161  1995/01/20  22:47:39  matt
15438  * Mission system implemented, though imcompletely
15439  *
15440  * Revision 1.160  1995/01/20  09:30:37  allender
15441  * don't call LoadLevel with bogus data
15442  *
15443  * Revision 1.159  1995/01/20  09:13:23  allender
15444  * *&^%&*%$ typo
15445  *
15446  * Revision 1.158  1995/01/20  09:12:04  allender
15447  * record team names during demo recoring in GM_TEAM
15448  *
15449  * Revision 1.157  1995/01/19  16:31:09  allender
15450  * forgot to bump demo version for new weapon change stuff
15451  *
15452  * Revision 1.156  1995/01/19  16:29:33  allender
15453  * added new byte for weapon change (old weapon) so rewinding works
15454  * correctly for weapon changes in registered
15455  *
15456  * Revision 1.155  1995/01/19  15:00:05  allender
15457  * remove code to take away blastable walls in multiplayer demo playbacks
15458  *
15459  * Revision 1.154  1995/01/19  11:07:05  allender
15460  * put in psuedo cloaking for boss robots.  Problem is that cloaking is
15461  * time based, and that don't get done in demos, so bosses just disappear.
15462  * oh well
15463  *
15464  * Revision 1.153  1995/01/19  09:42:29  allender
15465  * record laser levels in demos
15466  *
15467  * Revision 1.152  1995/01/18  20:43:12  allender
15468  * fix laser level stuff on goto-beginning and goto-end
15469  *
15470  * Revision 1.151  1995/01/18  20:28:18  allender
15471  * cloak robots now cloak (except maybe for boss........)  Put in function
15472  * to deal with control center triggers
15473  *
15474  * Revision 1.150  1995/01/18  18:55:07  allender
15475  * bug fix
15476  *
15477  * Revision 1.149  1995/01/18  18:49:03  allender
15478  * lots 'o stuff....record laser level.  Record beginning of door opening
15479  * sequence.  Fix some problems with control center stuff.  Control center
15480  * triggers now work in reverse
15481  *
15482  * Revision 1.148  1995/01/18  08:51:40  allender
15483  * forgot to record ammo counts at beginning of demo
15484  *
15485  * Revision 1.147  1995/01/17  17:42:07  allender
15486  * added primary and secondary ammo counts.  Changed goto_end routine
15487  * to be more efficient
15488  *
15489  * Revision 1.146  1995/01/17  13:46:35  allender
15490  * fix problem with destroyed control center and rewinding a demo.
15491  * Save callsign and restore after demo playback
15492  *
15493  * Revision 1.145  1995/01/12  10:21:53  allender
15494  * fixes for 1.0 to 1.1 demo incompatibility
15495  *
15496  * Revision 1.144  1995/01/05  13:51:43  allender
15497  * fixed type of player num variable
15498  *
15499  * Revision 1.143  1995/01/04  16:58:28  allender
15500  * bumped up demo version number
15501  *
15502  * Revision 1.142  1995/01/04  14:59:02  allender
15503  * added more information to end of demo for registered.  Forced game mode
15504  * to be GM_NORMAL on demo playback
15505  *
15506  * Revision 1.141  1995/01/03  17:30:47  allender
15507  * fixed logic problem with cloak stuf
15508  *
15509  * Revision 1.140  1995/01/03  17:12:23  allender
15510  * fix for getting cloak stuff at end of demo for shareware
15511  *
15512  * Revision 1.139  1995/01/03  15:20:24  allender
15513  * fix goto_end for shareware -- changes to goto_end for registered
15514  *
15515  * Revision 1.138  1995/01/03  13:13:26  allender
15516  * add } I forgot
15517  *
15518  * Revision 1.137  1995/01/03  13:10:29  allender
15519  * make score work forwards and backwards
15520  *
15521  * Revision 1.136  1995/01/03  11:45:20  allender
15522  * added code to record players scores
15523  *
15524  * Revision 1.135  1994/12/30  10:03:57  allender
15525  * put cloak stuff at end of demo for fast forward to the end
15526  *
15527  * Revision 1.134  1994/12/29  17:02:55  allender
15528  * spelling fix on SHAREWARE
15529  *
15530  * Revision 1.133  1994/12/29  16:43:41  allender
15531  * lots of new multiplayer stuff.  wrapped much code with SHAREWARE defines
15532  *
15533  * Revision 1.132  1994/12/28  14:15:01  allender
15534  * added routines to deal with connecting and reconnecting players when
15535  * recording multiplayer demos
15536  *
15537  * Revision 1.131  1994/12/21  12:57:59  allender
15538  * bug fix
15539  *
15540  * Revision 1.130  1994/12/21  12:46:53  allender
15541  * record multi player deaths and kills
15542  *
15543  * Revision 1.129  1994/12/19  16:37:27  allender
15544  * pick good filename when trying to save in network play and player
15545  * gets bumped out of menu by multi-player code
15546  *
15547  * Revision 1.128  1994/12/14  10:49:01  allender
15548  * reset bad_read variable when starting demo playback
15549  *
15550  * Revision 1.127  1994/12/14  08:53:06  allender
15551  * lowered watermark for out of space
15552  *
15553  * Revision 1.126  1994/12/14  08:49:52  allender
15554  * put up warning when starting demo recording if not enough space and
15555  * not let them record
15556  *
15557  * Revision 1.125  1994/12/13  00:01:37  allender
15558  * CLOAK FIX -- (I'm tempted to take cloak out of game because I can't
15559  * seem to get it right in demo playback)
15560  *
15561  * Revision 1.124  1994/12/12  14:51:21  allender
15562  * more fixed to multiplayer cloak stuff
15563  *
15564  * Revision 1.123  1994/12/12  11:33:11  allender
15565  * fixed rearview mode to work again
15566  *
15567  * Revision 1.122  1994/12/12  11:00:16  matt
15568  * Added code to handle confusion with attached objects
15569  *
15570  * Revision 1.121  1994/12/12  00:31:29  allender
15571  * give better warning when out of space when recording.  Don't record
15572  * until no space left.  We have 500K watermark when we now stop recording
15573  *
15574  * Revision 1.120  1994/12/10  16:44:54  matt
15575  * Added debugging code to track down door that turns into rock
15576  *
15577  * Revision 1.119  1994/12/09  18:46:15  matt
15578  * Added code to handle odd error condition
15579  *
15580  * Revision 1.118  1994/12/09  17:27:37  allender
15581  * force playernum to 0 when demo is done playing
15582  *
15583  * Revision 1.117  1994/12/09  16:40:39  allender
15584  * yet more cloak stuff.  Assign cloak/invuln time when starting demo
15585  * if flags are set.  Check cloak and invuln time when demo
15586  * even when paused
15587  *
15588  * Revision 1.116  1994/12/09  14:59:22  matt
15589  * Added system to attach a fireball to another object for rendering purposes,
15590  * so the fireball always renders on top of (after) the object.
15591  *
15592  * Revision 1.115  1994/12/09  12:21:45  allender
15593  * only allow valid chars when typing in demo filename
15594  *
15595  * Revision 1.114  1994/12/08  23:19:02  allender
15596  * final(?) fix for getting cloak gauge to work on demo playback
15597  * with forward and reverse
15598  *
15599  * Revision 1.113  1994/12/08  21:34:38  allender
15600  * record old and new player flags to accuratedly record cloaking and
15601  * decloaking
15602  * ./
15603  *
15604  * Revision 1.112  1994/12/08  18:04:47  allender
15605  * bashed playernum right after reading it in demo header so shields
15606  * and energy are put in right place
15607  *
15608  * Revision 1.111  1994/12/08  17:10:07  allender
15609  * encode playernum in demo header.  Bash viewer segment to 0 if in
15610  * bogus segnum.  Don't link render objs for same reason
15611  *
15612  * Revision 1.110  1994/12/08  15:36:12  allender
15613  * cloak stuff works forwards and backwards
15614  *
15615  * Revision 1.109  1994/12/08  13:46:03  allender
15616  * don't record rearview anymore, but leave in case statement for playback
15617  * purposes.  change the way letterbox <--> cockpit transitions happen
15618  *
15619  * Revision 1.108  1994/12/08  12:36:06  matt
15620  * Added new object allocation & deallocation functions so other code
15621  * could stop messing around with internal object data structures.
15622  *
15623  * Revision 1.107  1994/12/08  11:19:04  allender
15624  * handle out of space (more) gracefully then before
15625  *
15626  * Revision 1.106  1994/12/08  00:29:49  allender
15627  * fixed bug that didn't load level on goto_beginning
15628  *
15629  * Revision 1.105  1994/12/08  00:11:51  mike
15630  * change matrix interpolation.
15631  *
15632  * Revision 1.104  1994/12/07  23:46:37  allender
15633  * changed invulnerability and cloak to work (almost) correctly both
15634  * in single and multi player
15635  *
15636  * Revision 1.103  1994/12/07  11:48:49  adam
15637  * BY ALLENDER -- added dampening of interpolation factor to 1 if greater
15638  * than 1 (although I have not seen this happen).  this is attempt to
15639  * get wobbling problem solved
15640  *
15641  * Revision 1.102  1994/12/07  11:23:56  allender
15642  * attempt at getting rid of wobbling on demo playback
15643  *
15644  * Revision 1.101  1994/12/06  19:31:17  allender
15645  * moved blastable wall stuff code to where we load level during demo
15646  * playback
15647  *
15648  * Revision 1.100  1994/12/06  19:21:51  allender
15649  * multi games, destroy blastable walls.  Do wall toggle when control center
15650  * destroyed
15651  *
15652  * Revision 1.99  1994/12/06  16:54:48  allender
15653  * fixed code so if demo automatically started from menu, don't bring up
15654  * message if demo is too old
15655  *
15656  * Revision 1.98  1994/12/06  13:55:15  matt
15657  * Use new rounding func, f2ir()
15658  *
15659  * Revision 1.97  1994/12/06  13:44:45  allender
15660  * suppressed compiler warnings
15661  *
15662  * Revision 1.96  1994/12/06  13:38:03  allender
15663  * removed recording of wall hit process.  I think that all bases are covered
15664  * elsewhere
15665  *
15666  * Revision 1.95  1994/12/06  12:57:35  allender
15667  * added recording of multi_decloaking.  Fixed some other cloaking code so
15668  * that cloak should last as long as player was cloaked.  We will lose the
15669  * guage effect, but the time is probably more important on playback
15670  *
15671  * Revision 1.94  1994/12/05  23:37:17  matt
15672  * Took out calls to warning() function
15673  *
15674  * Revision 1.93  1994/12/03  17:52:04  yuan
15675  * Localization 380ish
15676  *
15677  * Revision 1.92  1994/12/02  12:53:39  allender
15678  * fixed goto_beginning and goto_end on demo playback
15679  *
15680  * Revision 1.91  1994/12/01  12:01:49  allender
15681  * added multi player cloak stuff
15682  *
15683  * Revision 1.90  1994/11/30  09:33:58  allender
15684  * added field in header to tell what version (shareware or registered)
15685  * demo was recorded with.  Don't allow demo recorded on one to playback
15686  * on the other
15687  *
15688  * Revision 1.89  1994/11/29  00:31:01  allender
15689  * major changes -- added level recording feature which records level
15690  * advancement.  Changes to internal code to handle this.
15691  *
15692  * Revision 1.88  1994/11/27  23:13:54  matt
15693  * Made changes for new mprintf calling convention
15694  *
15695  * Revision 1.87  1994/11/27  23:07:35  allender
15696  * starting on code to get all level transitions recorded. not done yet
15697  *
15698  * Revision 1.86  1994/11/27  17:39:47  matt
15699  * Don't xlate tmap numbers when editor compiled out
15700  *
15701  * Revision 1.85  1994/11/23  09:27:21  allender
15702  * put up info box with message if demo version is too old or level
15703  * cannot be loaded
15704  *
15705  * Revision 1.84  1994/11/22  19:37:39  allender
15706  * fix array mistake
15707  *
15708  * Revision 1.83  1994/11/22  19:35:09  allender
15709  * record player ship colors in multiplayer demo recordings
15710  *
15711  * Revision 1.82  1994/11/19  15:36:42  mike
15712  * fix fix.
15713  *
15714  * Revision 1.81  1994/11/19  15:23:21  mike
15715  * rip out unused code
15716  *
15717  * Revision 1.80  1994/11/16  14:51:49  rob
15718  * Fixed network/demo incompatibility.
15719  *
15720  * Revision 1.79  1994/11/15  10:55:48  allender
15721  * made start of demo playback read initial demo information so
15722  * level will get loaded.  Made demo record to single file which
15723  * will get renamed.  Added numerics after old filename so
15724  * sequential filenames would be defaulted to
15725  *
15726  * Revision 1.78  1994/11/15  09:46:06  allender
15727  * added versioning.  Fixed problems with trying to interpolating a completely
15728  * 0 orientation matrix
15729  *
15730  * Revision 1.77  1994/11/14  14:34:31  matt
15731  * Fixed up handling when textures can't be found during remap
15732  *
15733  * Revision 1.76  1994/11/14  09:15:29  allender
15734  * make ESC from file save menu exit w/o saving.  Fix letterbox, rear view,
15735  * to normal cockpit mode transition to work correctly when skipping and
15736  * interpolating frames
15737  *
15738  * Revision 1.75  1994/11/11  16:22:07  allender
15739  * made morphing objects record only the object being morphed.
15740  *
15741  * Revision 1.74  1994/11/08  14:59:19  john
15742  * Added code to respond to network while in menus.
15743  *
15744  * Revision 1.73  1994/11/08  14:52:20  adam
15745  * *** empty log message ***
15746  *
15747  * Revision 1.72  1994/11/07  15:47:04  allender
15748  * prompt for filename when done recording demo
15749  *
15750  * Revision 1.71  1994/11/07  11:47:19  allender
15751  * when interpolating frames, delete weapon, fireball, and debris objects
15752  * from an inpolated frame if they don't appear in the next recorded
15753  * frame
15754  *
15755  * Revision 1.70  1994/11/07  11:02:41  allender
15756  * more with interpolation. I believe that I have it right now
15757  *
15758  * Revision 1.69  1994/11/07  08:47:40  john
15759  * Made wall state record.
15760  *
15761  * Revision 1.68  1994/11/05  17:22:51  john
15762  * Fixed lots of sequencing problems with newdemo stuff.
15763  *
15764  * Revision 1.67  1994/11/04  20:11:52  john
15765  * Neatening up palette stuff with demos.
15766  *
15767  * Revision 1.66  1994/11/04  16:49:44  allender
15768  * changed newdemo_do_interpolate to default to on
15769  *
15770  * Revision 1.65  1994/11/04  16:44:51  allender
15771  * added filename support for demo recording.  more auto demo stuff
15772  *
15773  * Revision 1.64  1994/11/04  13:05:31  allender
15774  * fixing the lifeleft variable again.  (I think I got it right this time)
15775  *
15776  * Revision 1.63  1994/11/04  11:37:37  allender
15777  * commented out fprintfs and fixed compiler warning
15778  *
15779  * Revision 1.62  1994/11/04  11:33:50  allender
15780  * added OBJ_FLARE and OBJ_LIGHT to obj->lifeleft recording
15781  *
15782  * Revision 1.61  1994/11/04  11:29:21  allender
15783  * more interpolation stuff -- not done yet.  Fixed so hostage vclips
15784  * render correctly.  Changed lifeleft to full precision, but only
15785  * write it when object is fireball or weapon type of object
15786  *
15787  * Revision 1.60  1994/11/03  10:00:11  allender
15788  * fixed divide by zero in calculating render time.  more interpolation
15789  * stuff which isn't quite done
15790  *
15791  * Revision 1.59  1994/11/02  17:10:59  allender
15792  * never play recorded frames when interpolation is occuring
15793  *
15794  * Revision 1.58  1994/11/02  14:28:58  allender
15795  * profile total playback time and average frame render time
15796  *
15797  * Revision 1.57  1994/11/02  14:09:03  allender
15798  * record rear view.  start of playback interpolation code -- this
15799  * is not yet done
15800  *
15801  * Revision 1.56  1994/11/01  13:25:30  allender
15802  * drop frames if playing back demo on slower machine
15803  *
15804  * Revision 1.55  1994/10/31  16:10:40  allender
15805  * record letterbox mode on death seq, and then restore
15806  *
15807  * Revision 1.54  1994/10/29  16:01:38  allender
15808  * added ND_STATE_NODEMOS to indicate that there are no demos currently
15809  * available for playback
15810  *
15811  * Revision 1.53  1994/10/29  15:38:42  allender
15812  * in newdemo_start_playback, make Newdemo_at_eof = 0
15813  *
15814  * Revision 1.52  1994/10/28  14:45:28  john
15815  * fixed typo from last checkin.
15816  *
15817  * Revision 1.51  1994/10/28  14:42:55  john
15818  * Added sound volumes to all sound calls.
15819  *
15820  * Revision 1.50  1994/10/28  14:31:57  allender
15821  * homing missle and autodemo stuff
15822  *
15823  * Revision 1.49  1994/10/28  12:42:14  allender
15824  * record homing distance
15825  *
15826  * Revision 1.48  1994/10/27  16:57:54  allender
15827  * changed demo vcr to be able to play any number of frames by storing
15828  * frame length (in bytes) in the demo file.  Added blowing up monitors
15829  *
15830  * Revision 1.47  1994/10/26  16:50:50  allender
15831  * put two functions inside of VCR_MODE ifdef
15832  *
15833  * Revision 1.46  1994/10/26  15:20:32  allender
15834  * added CT_REMOTE as valid control type for recording
15835  *
15836  * Revision 1.45  1994/10/26  14:45:35  allender
15837  * completed hacked in vcr demo playback stuff
15838  *
15839  * Revision 1.44  1994/10/26  13:40:52  allender
15840  * vcr playback of demo stuff
15841  *
15842  * Revision 1.43  1994/10/26  08:51:57  allender
15843  * record player weapon change
15844  *
15845  * Revision 1.42  1994/10/25  15:48:01  allender
15846  * add shields, energy, and player flags to demo recording.
15847  * ,
15848  *
15849  * Revision 1.41  1994/10/24  08:19:35  allender
15850  * fixed compilation errors
15851  *
15852  * Revision 1.40  1994/10/23  19:17:08  matt
15853  * Fixed bug with "no key" messages
15854  *
15855  * Revision 1.39  1994/10/22  14:15:08  mike
15856  * Suppress compiler warnings.
15857  *
15858  * Revision 1.38  1994/10/21  15:24:55  allender
15859  * compressed writing of object structures with specialized code
15860  * to write out only pertinent object structures.
15861  *
15862  * Revision 1.37  1994/10/20  13:03:17  matt
15863  * Replaced old save files (MIN/SAV/HOT) with new LVL files
15864  *
15865  * Revision 1.36  1994/09/28  23:13:10  matt
15866  * Macroized palette flash system
15867  *
15868  * Revision 1.35  1994/09/26  17:28:32  matt
15869  * Made new multiple-object morph code work with the demo system
15870  *
15871  * Revision 1.34  1994/09/10  13:31:54  matt
15872  * Made exploding walls a type of blastable walls.
15873  * Cleaned up blastable walls, making them tmap2 bitmaps.
15874  *
15875  * Revision 1.33  1994/08/15  18:05:28  john
15876  * *** empty log message ***
15877  *
15878  * Revision 1.32  1994/08/15  17:56:38  john
15879  * ,
15880  *
15881  * Revision 1.31  1994/08/10  09:44:54  john
15882  * *** empty log message ***
15883  *
15884  * Revision 1.30  1994/07/22  12:35:48  matt
15885  * Cleaned up editor/game interactions some more.
15886  *
15887  * Revision 1.29  1994/07/21  13:06:45  matt
15888  * Ripped out remants of old demo system, and added demo only system that
15889  * disables object movement and game options from menu.
15890  *
15891  * Revision 1.28  1994/07/18  16:22:44  john
15892  * Made all file read/writes call the same routine.
15893  *
15894  * Revision 1.27  1994/07/14  22:38:27  matt
15895  * Added exploding doors
15896  *
15897  * Revision 1.26  1994/07/05  12:49:04  john
15898  * Put functionality of New Hostage spec into code.
15899  *
15900  * Revision 1.25  1994/06/29  11:05:38  john
15901  * Made demos read in compressed.
15902  *
15903  * Revision 1.24  1994/06/29  09:14:06  john
15904  * Made files write out uncompressed and read in compressed.
15905  *
15906  * Revision 1.23  1994/06/28  11:55:28  john
15907  * Made newdemo system record/play directly to/from disk, so
15908  * we don't need the 4 MB buffer anymore.
15909  *
15910  * Revision 1.22  1994/06/27  15:52:38  john
15911  * #define'd out the newdemo stuff
15912  *
15913  *
15914  * Revision 1.21  1994/06/22  00:29:04  john
15915  * Fixed bug with playing demo then playing game without
15916  * loading new mine.
15917  *
15918  * Revision 1.20  1994/06/22  00:14:23  john
15919  * Attempted to fix sign.
15920  *
15921  * Revision 1.19  1994/06/21  23:57:54  john
15922  * Hopefully fixed bug with negative countdowns.
15923  *
15924  * Revision 1.18  1994/06/21  23:47:44  john
15925  * MAde Malloc always 4*1024*1024.
15926  *
15927  * Revision 1.17  1994/06/21  22:58:47  john
15928  * Added error if out of memory.
15929  *
15930  * Revision 1.16  1994/06/21  22:15:48  john
15931  * Added  % done to demo recording.
15932  *
15933  *
15934  * Revision 1.15  1994/06/21  19:45:55  john
15935  * Added palette effects to demo recording.
15936  *
15937  * Revision 1.14  1994/06/21  15:08:54  john
15938  * Made demo record HUD message and cleaned up the HUD code.
15939  *
15940  * Revision 1.13  1994/06/21  14:20:08  john
15941  * Put in hooks to record HUD messages.
15942  *
15943  * Revision 1.12  1994/06/20  11:50:15  john
15944  * Made demo record flash effect, and control center triggers.
15945  *
15946  * Revision 1.11  1994/06/17  18:01:33  john
15947  * A bunch of new stuff by John
15948  *
15949  * Revision 1.10  1994/06/17  12:13:31  john
15950  * More newdemo stuff; made editor->game transition start in slew mode.
15951  *
15952  * Revision 1.9  1994/06/16  13:14:36  matt
15953  * Fixed typo
15954  *
15955  * Revision 1.8  1994/06/16  13:02:07  john
15956  * Added morph hooks.
15957  *
15958  * Revision 1.7  1994/06/15  19:01:33  john
15959  * Added the capability to make 3d sounds play just once for the
15960  * laser hit wall effects.
15961  *
15962  * Revision 1.6  1994/06/15  14:56:59  john
15963  * Added triggers to demo recording.
15964  *
15965  * Revision 1.5  1994/06/14  20:42:15  john
15966  * Made robot matztn cntr not work until no robots or player are
15967  * in the segment.
15968  *
15969  * Revision 1.4  1994/06/14  14:43:27  john
15970  * Made doors work with newdemo system.
15971  *
15972  * Revision 1.3  1994/06/14  11:32:29  john
15973  * Made Newdemo record & restore the current mine.
15974  *
15975  * Revision 1.2  1994/06/13  21:02:43  john
15976  * Initial version of new demo recording system.
15977  *
15978  * Revision 1.1  1994/06/13  11:09:00  john
15979  * Initial revision
15980
15981 ------------------------------------------------------------------------
15982 main/newdemo.h:
15983
15984  * Revision 1.1  1995/05/16  16:00:24  allender
15985  * Initial revision
15986  *
15987  * Revision 2.0  1995/02/27  11:27:18  john
15988  * New version 2.0, which has no anonymous unions, builds with
15989  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15990  *
15991  * Revision 1.43  1995/01/19  09:41:43  allender
15992  * prototype for laser level recording
15993  *
15994  * Revision 1.42  1995/01/18  18:48:49  allender
15995  * added function prototype for door_open
15996  *
15997  * Revision 1.41  1995/01/17  17:42:31  allender
15998  * new prototypes for ammo counts
15999  *
16000  * Revision 1.40  1995/01/04  15:04:27  allender
16001  * added some different prototypes for registered
16002  *
16003  * Revision 1.39  1995/01/03  11:45:11  allender
16004  * extern function definition
16005  *
16006  * Revision 1.38  1994/12/29  16:43:31  allender
16007  * new function prototype
16008  *
16009  * Revision 1.37  1994/12/28  14:15:27  allender
16010  * new function prototypes
16011  *
16012  * Revision 1.36  1994/12/21  12:46:41  allender
16013  * new functions for multiplayer deaths and kills
16014  *
16015  * Revision 1.35  1994/12/12  11:32:55  allender
16016  * added new record function to restore after in rearview mode
16017  *
16018  * Revision 1.34  1994/12/08  21:03:15  allender
16019  * added new param to record_player_flags
16020  *
16021  * Revision 1.33  1994/12/08  13:47:01  allender
16022  * removed function call to record_rearview
16023  *
16024  * Revision 1.32  1994/12/06  12:57:10  allender
16025  * added new prototype for multi decloaking
16026  *
16027  * Revision 1.31  1994/12/01  11:46:34  allender
16028  * added recording prototype for multi player cloak
16029  *
16030  * Revision 1.30  1994/11/27  23:04:22  allender
16031  * function prototype for recording new levels
16032  *
16033  * Revision 1.29  1994/11/07  08:47:43  john
16034  * Made wall state record.
16035  *
16036  * Revision 1.28  1994/11/05  17:22:53  john
16037  * Fixed lots of sequencing problems with newdemo stuff.
16038  *
16039  * Revision 1.27  1994/11/04  16:48:49  allender
16040  * extern Newdemo_do_interpolate variable
16041  *
16042  * Revision 1.26  1994/11/02  14:08:53  allender
16043  * record rearview
16044  *
16045  * Revision 1.25  1994/10/31  13:35:04  allender
16046  * added two record functions to save and restore cockpit state on
16047  * death sequence
16048  *
16049  * Revision 1.24  1994/10/29  16:01:11  allender
16050  * added ND_STATE_NODEMOS to indicate that there are no demos currently
16051  * available for playback
16052  *
16053  * Revision 1.23  1994/10/28  12:41:58  allender
16054  * add homing distance recording event
16055  *
16056  * Revision 1.22  1994/10/27  16:57:32  allender
16057  * removed VCR_MODE stuff, and added monitor blowup effects
16058  *
16059  * Revision 1.21  1994/10/26  14:44:48  allender
16060  * completed hacked in vcr type demo playback states
16061  *
16062  * Revision 1.20  1994/10/26  13:40:38  allender
16063  * more vcr demo playback defines
16064  *
16065  * Revision 1.19  1994/10/26  08:51:26  allender
16066  * record player weapon change
16067  *
16068  * Revision 1.18  1994/10/25  16:25:31  allender
16069  * prototypes for shield, energy and flags
16070  *
16071  * Revision 1.17  1994/08/15  18:05:30  john
16072  * *** empty log message ***
16073  *
16074  * Revision 1.16  1994/07/21  13:11:26  matt
16075  * Ripped out remants of old demo system, and added demo only system that
16076  * disables object movement and game options from menu.
16077  *
16078  * Revision 1.15  1994/07/05  12:49:02  john
16079  * Put functionality of New Hostage spec into code.
16080  *
16081  * Revision 1.14  1994/06/27  15:53:12  john
16082  * #define'd out the newdemo stuff
16083  *
16084  *
16085  * Revision 1.13  1994/06/24  17:01:25  john
16086  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
16087  * took it out of game.c and into gameseq.c
16088  *
16089  * Revision 1.12  1994/06/21  19:46:05  john
16090  * Added palette effects to demo recording.
16091  *
16092  * Revision 1.11  1994/06/21  14:19:58  john
16093  * Put in hooks to record HUD messages.
16094  *
16095  * Revision 1.10  1994/06/20  11:50:42  john
16096  * Made demo record flash effect, and control center triggers.
16097  *
16098  * Revision 1.9  1994/06/17  18:01:29  john
16099  * A bunch of new stuff by John
16100  *
16101  * Revision 1.8  1994/06/17  12:13:34  john
16102  * More newdemo stuff; made editor->game transition start in slew mode.
16103  *
16104  * Revision 1.7  1994/06/16  13:02:02  john
16105  * Added morph hooks.
16106  *
16107  * Revision 1.6  1994/06/15  19:01:42  john
16108  * Added the capability to make 3d sounds play just once for the
16109  * laser hit wall effects.
16110  *
16111  * Revision 1.5  1994/06/15  14:57:11  john
16112  * Added triggers to demo recording.
16113  *
16114  * Revision 1.4  1994/06/14  20:42:19  john
16115  * Made robot matztn cntr not work until no robots or player are
16116  * in the segment.
16117  *
16118  * Revision 1.3  1994/06/14  14:43:52  john
16119  * Made doors work with newdemo system.
16120  *
16121  * Revision 1.2  1994/06/13  21:02:44  john
16122  * Initial version of new demo recording system.
16123  *
16124  * Revision 1.1  1994/06/13  15:51:09  john
16125  * Initial revision
16126
16127 ------------------------------------------------------------------------
16128 main/newmenu.c:
16129
16130  * Revision 1.26  1996/04/14  21:07:35  allender
16131  * some change for update
16132  *
16133  * Revision 1.25  1995/10/31  10:19:25  allender
16134  * shareware stuff
16135  *
16136  * Revision 1.24  1995/10/27  11:09:04  allender
16137  * always cd to descent dir before any menu processing --
16138  * sanity check because of way mac does volume mounting and
16139  * other file stuff
16140  *
16141  * Revision 1.23  1995/10/24  18:11:19  allender
16142  * do_appl_quit saves and restores background -- don't
16143  * do any special processing.  fixed newmenu_do3 to pass width
16144  * and height to ...do_4
16145  *
16146  * Revision 1.22  1995/10/21  23:26:25  allender
16147  * can't do cmd-q in multiplayer games
16148  *
16149  * Revision 1.21  1995/10/21  22:53:25  allender
16150  * menus need to be 8 byte multiple wide -- printscreen stuff
16151  *
16152  * Revision 1.20  1995/10/20  00:50:15  allender
16153  * redbook stuff and make esc leave menu always
16154  *
16155  * Revision 1.19  1995/10/17  13:14:52  allender
16156  * mouse support for other menus now operational -- dragging
16157  * mouse will also move sliders
16158  *
16159  * Revision 1.18  1995/10/12  17:35:19  allender
16160  * mouse support for pilot and demos
16161  *
16162  * Revision 1.17  1995/10/11  12:17:47  allender
16163  * removed event loop processing
16164  *
16165  * Revision 1.16  1995/10/10  11:51:29  allender
16166  * align menus to 8 byte boundry
16167  *
16168  * Revision 1.15  1995/10/05  14:09:36  allender
16169  * lowered starting x location on menus to fixup network
16170  * status screen chopping off characters
16171  *
16172  * Revision 1.14  1995/09/24  10:52:27  allender
16173  * made close boxes work
16174  * maybe some other minor stuff?
16175  *
16176  * Revision 1.13  1995/09/15  09:02:04  allender
16177  * started putting mouse support in listboxes
16178  *
16179  * Revision 1.12  1995/09/13  08:50:14  allender
16180  * close box in this rev?  Worked on getting list box better
16181  * looking
16182  *
16183  * Revision 1.11  1995/09/01  10:52:37  allender
16184  * fixed up list boxes
16185  *
16186  * Revision 1.10  1995/08/24  16:23:08  allender
16187  * mouse support for most menus
16188  *
16189  * Revision 1.9  1995/08/08  13:46:56  allender
16190  * added macsys header file
16191  *
16192  * Revision 1.8  1995/08/01  16:03:54  allender
16193  * added file list with Desalvo's directory stuff
16194  *
16195  * Revision 1.7  1995/07/26  17:03:37  allender
16196  * show then hide cursor during newmenu operations -- not quite
16197  * right yet
16198  *
16199  * Revision 1.6  1995/07/17  08:56:26  allender
16200  * fixed up menus to look better with new high res fonts
16201  *
16202  * Revision 1.5  1995/07/12  10:35:52  allender
16203  * removed old debug thing
16204  *
16205  * Revision 1.4  1995/06/23  10:23:21  allender
16206  * menus should work in any resolution now
16207  *
16208  * Revision 1.3  1995/06/20  09:11:19  allender
16209  * changed menu system to support 640x480 instead of 320x200
16210  *
16211  * Revision 1.2  1995/06/13  13:07:30  allender
16212  * added special key to move 320x200 window to upper left corner of screen
16213  *
16214  * Revision 1.1  1995/05/16  15:29:13  allender
16215  * Initial revision
16216  *
16217  * Revision 2.8  1995/05/26  16:16:28  john
16218  * Split SATURN into define's for requiring cd, using cd, etc.
16219  * Also started adding all the Rockwell stuff.
16220  *
16221  * Revision 2.7  1995/04/23  14:54:17  john
16222  * Fixed bug with background breaking in first menu.
16223  *
16224  * Revision 2.6  1995/03/21  14:38:46  john
16225  * Ifdef'd out the NETWORK code.
16226  *
16227  * Revision 2.5  1995/03/15  14:33:29  john
16228  * Added code to force the Descent CD-rom in the drive.
16229  *
16230  * Revision 2.4  1995/03/14  18:24:28  john
16231  * Force Destination Saturn to use CD-ROM drive.
16232  *
16233  * Revision 2.3  1995/03/14  16:22:23  john
16234  * Added cdrom alternate directory stuff.
16235  *
16236  * Revision 2.2  1995/03/06  18:30:51  john
16237  * Fixed bug with newmenu trashing editor font.
16238  *
16239  * Revision 2.1  1995/03/06  15:23:17  john
16240  * New screen techniques.
16241  *
16242  * Revision 2.0  1995/02/27  11:27:55  john
16243  * New version 2.0, which has no anonymous unions, builds with
16244  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16245  *
16246  * Revision 1.129  1995/02/11  16:19:56  john
16247  * Added code to make the default mission be the one last played.
16248  *
16249  * Revision 1.128  1995/02/02  19:41:33  john
16250  * Added 10 save game slots.
16251  *
16252  * Revision 1.127  1995/02/01  18:13:52  john
16253  * Fixed some constants.
16254  *
16255  * Revision 1.126  1995/02/01  18:04:01  yuan
16256  * Added 50 characters to list.
16257  *
16258  * Revision 1.125  1995/02/01  13:39:35  john
16259  * Made menu text that changes not overwrite.
16260  *
16261  * Revision 1.124  1995/01/31  10:47:57  john
16262  * Added menu that you can specify the width of the menu.
16263  *
16264  * Revision 1.123  1995/01/28  17:18:12  john
16265  * Added file list box.
16266  *
16267  * Revision 1.122  1995/01/27  17:15:55  john
16268  * Made prev comment actually work.
16269  *
16270  * Revision 1.121  1995/01/27  16:49:03  john
16271  * *** empty log message ***
16272  *
16273  * Revision 1.120  1995/01/27  16:46:40  john
16274  * Made so that input_menu only clears text if -empty-.
16275  *
16276  * Revision 1.119  1995/01/27  15:25:04  john
16277  * Delete saved game when deleteing a pilot file.
16278  *
16279  * Revision 1.118  1995/01/25  16:36:09  john
16280  * Made so that when you hit enter during
16281  * game save, -empty- goes away.
16282  *
16283  * Revision 1.117  1995/01/24  16:59:30  john
16284  * took out mono debugging text.
16285  *
16286  * Revision 1.116  1995/01/24  16:23:16  john
16287  * Fixed some bugs with listboxes.
16288  *
16289  * Revision 1.115  1995/01/23  23:47:36  matt
16290  * Made keypad enter work in menus
16291  *
16292  * Revision 1.114  1995/01/23  19:29:59  john
16293  * Added scrolling listbox menus.
16294  *
16295  * Revision 1.113  1995/01/19  12:33:34  john
16296  * Made keys jump to sliders, etc in menus.
16297  *
16298  * Revision 1.112  1995/01/15  14:33:08  rob
16299  * Fixed problem with nested nm_messageboxes.
16300  *
16301  * Revision 1.111  1995/01/03  17:33:40  john
16302  * Made scrolling textbox. Used it for scores cool saying.
16303  *
16304  * Revision 1.110  1994/12/28  10:42:58  john
16305  * More VFX tweaking.
16306  *
16307  * Revision 1.109  1994/12/28  10:26:39  john
16308  * Fixed some VFX problems.
16309  *
16310  * Revision 1.108  1994/12/15  23:18:10  john
16311  * Added fix so that VFX mode doesn't hang.
16312  *
16313  * Revision 1.107  1994/12/15  12:19:55  john
16314  * Made menu use clipped bitblt functions.
16315  *
16316  * Revision 1.106  1994/12/09  00:41:30  mike
16317  * fix hang in automap print screen
16318  *
16319  * Revision 1.105  1994/12/08  10:01:34  john
16320  * Changed the way the player callsign stuff works.
16321  *
16322  * Revision 1.104  1994/12/04  15:34:30  john
16323  * Fixed bug with newmenu not restoring font properly.
16324  *
16325  * Revision 1.103  1994/12/03  17:47:09  john
16326  * Fixed bug that didn't free filename mem when not .plr files found.
16327  *
16328  * Revision 1.102  1994/12/03  15:06:15  john
16329  * If no pilot exists, bring up box asking for name.
16330  *
16331  * Revision 1.101  1994/12/03  11:04:02  john
16332  * Changed newmenu code a bit to fix bug with bogus
16333  * backgrounds occcasionally.
16334  *
16335  * Revision 1.100  1994/12/01  20:15:48  yuan
16336  * Localization.
16337  *
16338  * Revision 1.99  1994/12/01  10:33:28  john
16339  * Fixed bug with large menu backgrounds not drawing correctly.
16340  *
16341  * Revision 1.98  1994/12/01  02:41:56  john
16342  * Fixed warnining.
16343  *
16344  * Revision 1.97  1994/11/30  22:52:43  john
16345  * Fixed bug in code that made the backgrounds behind menus.
16346  *
16347  * Revision 1.96  1994/11/30  19:47:42  john
16348  * Added a check for out o' memory when mallocing background.
16349  *
16350  * Revision 1.95  1994/11/30  19:39:10  john
16351  * ..
16352  *
16353  * Revision 1.94  1994/11/30  19:38:27  john
16354  * fixed bug with previous.
16355  *
16356  * Revision 1.93  1994/11/30  19:36:47  john
16357  * Made Gravis Ultrasound work again.  Made the scores blink
16358  * at a constant rate.  Revamped the newmenu background storage,
16359  * which hopefully fixed some bugs.  Made menus in ame not pause
16360  * sound, except for the pause key.               ^== Game!
16361  *
16362  * Revision 1.92  1994/11/30  18:06:05  matt
16363  * When player types space in callsign, comes up as underscore
16364  *
16365  * Revision 1.91  1994/11/30  12:28:22  adam
16366  * added PCX support
16367  *
16368  * Revision 1.90  1994/11/30  12:10:59  adam
16369  * added support for PCX titles/brief screens
16370  *
16371  * Revision 1.89  1994/11/29  00:59:12  allender
16372  * change newmenu_get_filename so demo files can be deleted too
16373  *
16374  * Revision 1.88  1994/11/27  21:16:18  allender
16375  * made some return values in newmenu_get_filename 0 instead of -1
16376  *
16377  * Revision 1.87  1994/11/27  16:58:17  matt
16378  * Made printscreen work all the time (not just when no ndebug) and made it
16379  * work when getting a filename.
16380  *
16381  * Revision 1.86  1994/11/27  16:47:51  john
16382  * Made the call to fade in palette only happen if it needs to be, just
16383  * because I thought it might reduce code paging with vm in menus.
16384  *
16385  * Revision 1.85  1994/11/26  15:30:16  matt
16386  * Allow escape out of change pilot menu
16387  *
16388  * Revision 1.84  1994/11/26  14:17:26  matt
16389  * Player can now only enter valid chars for his name
16390  *
16391  * Revision 1.83  1994/11/23  14:13:17  allender
16392  * if no demo files, displays less "techy" message
16393  *
16394  * Revision 1.82  1994/11/21  11:55:52  john
16395  * Fixed some sound pausing in menus bugs.
16396  *
16397  * Revision 1.81  1994/11/19  15:14:58  mike
16398  * remove unused code and data
16399  *
16400  * Revision 1.80  1994/11/18  23:37:54  john
16401  * Changed some shorts to ints.
16402  *
16403  * Revision 1.79  1994/11/15  09:29:21  john
16404  * Made it so that pressing a letter when selecting players moves to
16405  * a matching choice.
16406  *
16407  * Revision 1.78  1994/11/14  17:12:28  adam
16408  * *** empty log message ***
16409  *
16410  * Revision 1.77  1994/11/14  16:58:31  rob
16411  * Tried to fix a problem with save demo dialog.
16412  *
16413  * Revision 1.76  1994/11/14  16:13:46  matt
16414  * Fixed handling of players with DOS device names
16415  *
16416  * Revision 1.75  1994/11/13  18:12:53  matt
16417  * Fixed handling of filenames that are the same as DOS devices
16418  *
16419  * Revision 1.74  1994/11/13  17:20:44  john
16420  * Fixed text a bit.
16421  *
16422  * Revision 1.73  1994/11/13  17:18:22  john
16423  * Changed wording of new pilot.
16424  *
16425  * Revision 1.72  1994/11/13  17:14:21  john
16426  * Fixed bug with player list box.
16427  *
16428  * Revision 1.71  1994/11/13  17:12:48  john
16429  * Fixed broken demo file list.
16430  *
16431  * Revision 1.70  1994/11/13  17:04:49  john
16432  * Made the callsign entry be a list box and gave the ability
16433  * to delete players.
16434  *
16435  * Revision 1.69  1994/11/13  15:38:03  john
16436  * Added critical error handler to game.  Took out -editor command line
16437  * option because it didn't work anymore and wasn't worth fixing.  Made scores
16438  * not use MINER enviroment variable on release version, and made scores
16439  * not print an error if there is no descent.hi.
16440  *
16441  * Revision 1.68  1994/11/11  18:17:03  rob
16442  * Made multi_menu_poll return a value to exit menus.
16443  *
16444  * Revision 1.67  1994/11/11  11:07:06  rob
16445  * Added include of multi.h
16446  *
16447  * Revision 1.66  1994/11/10  20:25:16  rob
16448  * John's stuff to make network menus work.
16449  *
16450  * Revision 1.65  1994/11/08  14:51:39  john
16451  * Added nm_messagebox1, (like the original, only you can pass a function).
16452  *
16453  * Revision 1.64  1994/11/08  08:30:39  john
16454  * Fixed bug with centering titles.
16455  *
16456  * Revision 1.63  1994/11/08  08:27:00  john
16457  * Made titles and subtitles center.
16458  *
16459  * Revision 1.62  1994/11/07  09:40:48  john
16460  * Neatend file list box some.
16461  *
16462  * Revision 1.61  1994/11/05  17:22:41  john
16463  * Fixed lots of sequencing problems with newdemo stuff.
16464  *
16465  * Revision 1.60  1994/11/05  15:04:08  john
16466  * Added non-popup menu for the main menu, so that scores and credits don't have to save
16467  * the background.
16468  *
16469  * Revision 1.59  1994/11/05  14:03:52  john
16470  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
16471  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
16472  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
16473  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
16474  *
16475  * Revision 1.58  1994/11/04  20:11:50  john
16476  * Neatening up palette stuff with demos.
16477  *
16478  * Revision 1.57  1994/11/04  13:49:24  allender
16479  * fixed newmenu_get_filename to work with less than 10 files
16480  *
16481  * Revision 1.56  1994/11/03  19:37:44  john
16482  * Added scrolling file list box
16483  *
16484  * Revision 1.55  1994/10/31  18:16:42  john
16485  * Made Pad arrows work with menus.
16486  *
16487  * Revision 1.54  1994/10/28  14:54:25  john
16488  * Added forward dec. for newmenu_close.
16489  * .\
16490  *
16491  * Revision 1.53  1994/10/28  14:53:00  john
16492  * Fixed hideous bug that would bomb if you called newmenu_draw_background
16493  * before any menus were ever displayed.
16494  *
16495  * Revision 1.52  1994/10/24  19:56:53  john
16496  * Made the new user setup prompt for config options.
16497  *
16498  * Revision 1.51  1994/10/24  15:15:49  john
16499  * Made Esc exit nm_messagebox's,
16500  * ,
16501  *
16502  * Revision 1.50  1994/10/21  15:20:20  john
16503  * Made PrtScr do screen dump, not F2.
16504  *
16505  * Revision 1.49  1994/10/18  12:33:38  john
16506  * Only used copy the item text into the saved_text field
16507  * if it is an inputbox or inputbox_menu.
16508  *
16509  * Revision 1.48  1994/10/17  11:04:01  john
16510  * Made backtab work also.
16511  *
16512  * Revision 1.47  1994/10/17  10:47:49  john
16513  * MAde Tab work like down arrow.
16514  *
16515  * Revision 1.46  1994/10/17  10:45:10  john
16516  * Made the player able to abort death by pressing any button or key.
16517  *
16518  * Revision 1.45  1994/10/13  21:52:02  john
16519  * Made it so that if a messagebox has 1 choice, then
16520  * Esc will return -1.
16521  *
16522  * Revision 1.44  1994/10/13  11:35:38  john
16523  * Made Thrustmaster FCS Hat work.  Put a background behind the
16524  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
16525  * menu to new menu. Made F6 be calibrate joystick.
16526  *
16527  * Revision 1.43  1994/10/11  17:18:52  john
16528  * Fixed bug with sliders always starting at -1.
16529  *
16530  * Revision 1.42  1994/10/11  17:08:29  john
16531  * Added sliders for volume controls.
16532  *
16533  * Revision 1.41  1994/10/06  16:04:40  john
16534  * Made text items color differently than others. Adam
16535  * is gonna make a diff colored font for these.
16536  *
16537  * Revision 1.40  1994/10/06  15:08:23  rob
16538  * Allowed any negative key value to abort the menu and return.
16539  *
16540  * Revision 1.39  1994/10/04  10:26:06  matt
16541  * Changed fade in to happen every time a global var is set
16542  *
16543  * Revision 1.38  1994/10/04  09:16:08  john
16544  * If you pass -1 as choice in newmenu_do1, then
16545  * no item is highlighted until you press up or
16546  * down arrows.
16547  *
16548  * Revision 1.37  1994/10/03  23:44:37  matt
16549  * Save & restore palette effect around menus & pause message
16550  *
16551  * Revision 1.36  1994/10/03  22:59:40  matt
16552  * Re-enabled backspace to generate Int3()
16553  *
16554  * Revision 1.35  1994/10/03  19:11:21  matt
16555  * Changed string input cursor to blinking underscore
16556  *
16557  * Revision 1.34  1994/10/03  14:44:15  john
16558  * Added newmenu_do1, which allows you to pass the starting
16559  * item to the menu system
16560  *
16561  * Revision 1.33  1994/09/30  11:51:21  john
16562  * Added Matt's NM_TYPE_INPUT_MENU
16563  *
16564  * Revision 1.32  1994/09/28  17:22:56  matt
16565  * Added extra space between subtitle and menu items
16566  * Made shortcut key check ignore leading spaces in text
16567  *
16568  * Revision 1.31  1994/09/15  16:11:22  john
16569  * Added support for VFX1 head tracking. Fixed bug with memory over-
16570  * write when using stereo mode.
16571  *
16572  * Revision 1.30  1994/09/12  09:52:59  john
16573  * Made global flush function that flushes keyboard,mouse, and joystick.
16574  *
16575  * Revision 1.29  1994/09/10  19:10:54  matt
16576  * Fixed a few things (like arrow key handling) for menus with all
16577  * text items, such as the key help message.
16578  *
16579  * Revision 1.28  1994/09/01  18:55:38  john
16580  * freed scores.lbm
16581  *
16582  * Revision 1.27  1994/09/01  18:03:50  john
16583  * Neatened up scores a bit.
16584  *
16585  * Revision 1.26  1994/08/30  20:38:13  john
16586  * Passed citem in newmenu sub.
16587  *
16588  * Revision 1.25  1994/08/30  11:13:01  john
16589  * Added beveled edges to menus.
16590  *
16591  * Revision 1.24  1994/08/26  13:01:58  john
16592  * Put high score system in.
16593  *
16594  * Revision 1.23  1994/08/16  00:18:44  john
16595  * Made pressing the first letter of a menu
16596  * item move to it.
16597  *
16598  * Revision 1.22  1994/08/15  23:17:43  john
16599  * *** empty log message ***
16600  *
16601  * Revision 1.21  1994/08/15  23:15:28  john
16602  * Made 1 menu/checkbox return with any keypress.
16603  *
16604  * Revision 1.20  1994/08/12  10:18:23  john
16605  * *** empty log message ***
16606  *
16607  * Revision 1.19  1994/08/12  10:09:11  john
16608  * Made borders better.
16609  *
16610  * Revision 1.18  1994/08/12  03:11:16  john
16611  * Made network be default off; Moved network options into
16612  * main menu.  Made starting net game check that mines are the
16613  * same.
16614  *
16615  * Revision 1.17  1994/08/11  22:14:43  john
16616  * Free'd up some memory that I forgot to free.
16617  *
16618  * Revision 1.16  1994/08/11  19:27:35  john
16619  * Made the Backspace drop into the debugger only
16620  * if you're not in an inputbox.
16621  *
16622  * Revision 1.15  1994/08/11  18:01:49  matt
16623  * Added F2 and BACKSPACE keys to new menu system
16624  *
16625  * Revision 1.14  1994/08/11  14:25:58  john
16626  * *** empty log message ***
16627  *
16628  * Revision 1.13  1994/08/11  14:25:40  john
16629  * *** empty log message ***
16630  *
16631  * Revision 1.12  1994/08/11  13:47:02  john
16632  * Made newmenu have subtitles, passed key through to
16633  * the newmenu subfunctions.
16634  *
16635  * Revision 1.11  1994/08/11  12:45:08  john
16636  * *** empty log message ***
16637  *
16638  * Revision 1.10  1994/08/11  12:25:45  john
16639  * Made right_offset spacing different
16640  *
16641  * Revision 1.9  1994/08/11  12:09:49  john
16642  * Made work with bitmapped fonts.
16643  *
16644  * Revision 1.8  1994/08/10  19:56:16  john
16645  * Changed font stuff; Took out old menu; messed up lots of
16646  * other stuff like game sequencing messages, etc.
16647  *
16648  * Revision 1.7  1994/07/27  16:12:23  john
16649  * Changed newmenu system to have a callback function.
16650  * /.
16651  *
16652  * Revision 1.6  1994/07/25  15:10:23  john
16653  * *** empty log message ***
16654  *
16655  * Revision 1.5  1994/07/25  12:33:35  john
16656  * Network "pinging" in.
16657  *
16658  * Revision 1.4  1994/07/24  18:21:27  john
16659  * Took out first time stuff.
16660  *
16661  * Revision 1.3  1994/07/24  17:32:47  john
16662  * Added percent item.  Also neatend up a bit.
16663  *
16664  * Revision 1.2  1994/07/22  17:48:13  john
16665  * Added new menuing system.
16666  *
16667  * Revision 1.1  1994/07/22  13:55:38  john
16668  * Initial revision
16669
16670 ------------------------------------------------------------------------
16671 main/newmenu.h:
16672
16673  * Revision 1.3  1995/10/17  13:15:19  allender
16674  * new call to nm_listbox for close_box
16675  *
16676  * Revision 1.2  1995/09/13  08:48:50  allender
16677  * new prototype for newmenu -- have close box
16678  *
16679  * Revision 1.1  1995/05/16  16:00:32  allender
16680  * Initial revision
16681  *
16682  * Revision 2.0  1995/02/27  11:32:28  john
16683  * New version 2.0, which has no anonymous unions, builds with
16684  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16685  *
16686  * Revision 1.24  1995/02/11  16:20:05  john
16687  * Added code to make the default mission be the one last played.
16688  *
16689  * Revision 1.23  1995/01/31  10:21:41  john
16690  * Added code to specify width, height.
16691  *
16692  * Revision 1.22  1995/01/28  17:09:21  john
16693  * *** empty log message ***
16694  *
16695  * Revision 1.21  1995/01/23  18:38:43  john
16696  * Added listbox function.
16697  *
16698  * Revision 1.20  1994/11/26  15:29:55  matt
16699  * Allow escape out of change pilot menu
16700  *
16701  * Revision 1.19  1994/11/26  14:17:05  matt
16702  * Player can now only enter valid chars for his name
16703  *
16704  * Revision 1.18  1994/11/18  16:17:13  mike
16705  * prototype Max_linear_depth_objects.
16706  *
16707  * Revision 1.17  1994/11/08  14:51:17  john
16708  * Added nm_messagebox1, (like the original, only you can pass a function).
16709  *
16710  * Revision 1.16  1994/11/05  14:31:45  john
16711  * Added a new menu function for the background.
16712  *
16713  * Revision 1.15  1994/11/05  14:05:46  john
16714  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
16715  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
16716  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
16717  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
16718  *
16719  * Revision 1.14  1994/11/03  19:37:35  john
16720  * Added scrolling file list box
16721  *
16722  * Revision 1.13  1994/10/13  11:34:03  john
16723  * Made Thrustmaster FCS Hat work.  Put a background behind the
16724  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
16725  * menu to new menu. Made F6 be calibrate joystick.
16726  *
16727  * Revision 1.12  1994/10/11  17:08:32  john
16728  * Added sliders for volume controls.
16729  *
16730  * Revision 1.11  1994/10/04  10:26:23  matt
16731  * Changed fade in to happen every time a global var is set
16732  *
16733  * Revision 1.10  1994/10/03  14:43:56  john
16734  * Added newmenu_do1, which allows you to pass the starting
16735  * item to the menu system
16736  *
16737  * Revision 1.9  1994/09/30  11:51:33  john
16738  * Added Matt's NM_TYPE_INPUT_MENU
16739  *
16740  * Revision 1.8  1994/08/30  20:38:28  john
16741  * Passed citem in newmenu sub.
16742  *
16743  * Revision 1.7  1994/08/12  03:11:00  john
16744  * Made network be default off; Moved network options into
16745  * main menu.  Made starting net game check that mines are the
16746  * same.
16747  *
16748  * Revision 1.6  1994/08/11  13:47:05  john
16749  * Made newmenu have subtitles, passed key through to
16750  * the newmenu subfunctions.
16751  *
16752  * Revision 1.5  1994/07/27  16:12:24  john
16753  * Changed newmenu system to have a callback function.
16754  * /.
16755  *
16756  * Revision 1.4  1994/07/24  17:41:38  john
16757  * *** empty log message ***
16758  *
16759  * Revision 1.3  1994/07/24  17:33:01  john
16760  * Added percent item.  Also neatend up a bit.
16761  *
16762  * Revision 1.2  1994/07/22  17:48:12  john
16763  * Added new menuing system.
16764  *
16765  * Revision 1.1  1994/07/22  13:55:51  john
16766  * Initial revision
16767
16768 ------------------------------------------------------------------------
16769 main/object.c:
16770
16771  * Revision 1.5  1995/10/26  14:08:03  allender
16772  * optimization to do physics on objects that didn't render last
16773  * frame only every so often
16774  *
16775  * Revision 1.4  1995/10/20  00:50:57  allender
16776  * make alt texture for player ship work correctly when cloaked
16777  *
16778  * Revision 1.3  1995/09/14  14:11:32  allender
16779  * fix_object_segs returns void
16780  *
16781  * Revision 1.2  1995/08/12  11:31:01  allender
16782  * removed #ifdef NEWDEMO -- always in
16783  *
16784  * Revision 1.1  1995/05/16  15:29:23  allender
16785  * Initial revision
16786  *
16787  * Revision 2.3  1995/06/15  12:30:51  john
16788  * Fixed bug with multiplayer ships cloaking out wrongly.
16789  *
16790  * Revision 2.2  1995/05/15  11:34:53  john
16791  * Fixed bug as Matt directed that fixed problems with the exit
16792  * triggers being missed on slow frame rate computer.
16793  *
16794  * Revision 2.1  1995/03/21  14:38:51  john
16795  * Ifdef'd out the NETWORK code.
16796  *
16797  * Revision 2.0  1995/02/27  11:28:14  john
16798  * New version 2.0, which has no anonymous unions, builds with
16799  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16800  *
16801  * Revision 1.335  1995/02/22  12:57:30  allender
16802  * remove anonymous unions from object structure
16803  *
16804  * Revision 1.334  1995/02/09  22:04:40  mike
16805  * fix lifeleft on badass weapons.
16806  *
16807  * Revision 1.333  1995/02/08  12:54:00  matt
16808  * Fixed object freeing code which was deleting some explosions it shouldn't
16809  *
16810  * Revision 1.332  1995/02/08  11:37:26  mike
16811  * Check for failures in call to obj_create.
16812  *
16813  * Revision 1.331  1995/02/05  17:48:52  rob
16814  * Changed assert in obj_relink, more robust.
16815  *
16816  * Revision 1.330  1995/02/05  13:39:48  mike
16817  * remove invulnerability effect code (actually, comment out).
16818  *
16819  * Revision 1.329  1995/02/04  12:29:52  rob
16820  * Get rid of potential assert error for explosion detachment.
16821  *
16822  * Revision 1.328  1995/02/01  18:15:57  rob
16823  * Removed debugging output from engine glow change.
16824  *
16825  * Revision 1.327  1995/02/01  16:20:12  matt
16826  * Made engine glow vary over a wider range, and made the glow be based
16827  * on thrust/speed, without regard to direction.
16828  *
16829  * Revision 1.326  1995/01/29  14:46:24  rob
16830  * Fixed invul. vclip to only appear on player who is invul.
16831  *
16832  * Revision 1.325  1995/01/29  13:48:16  mike
16833  * Add invulnerability graphical effect viewable by other players.
16834  *
16835  * Revision 1.324  1995/01/29  11:39:25  mike
16836  * Add invulnerability effect.
16837  *
16838  * Revision 1.323  1995/01/27  17:02:41  mike
16839  * add more information to an Error call.
16840  *
16841  * Revision 1.322  1995/01/26  22:11:30  mike
16842  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
16843  *
16844  * Revision 1.321  1995/01/25  20:04:10  matt
16845  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
16846  *
16847  * Revision 1.320  1995/01/25  12:11:35  matt
16848  * Make sure orient matrix is orthogonal when resetting player object
16849  *
16850  * Revision 1.319  1995/01/21  21:46:22  mike
16851  * Optimize code in Assert (and prevent warning message).
16852  *
16853  * Revision 1.318  1995/01/21  21:22:16  rob
16854  * Removed HUD clear messages.
16855  * Added more Asserts to try and find illegal control type bug.
16856  *
16857  * Revision 1.317  1995/01/15  15:34:30  matt
16858  * When freeing object slots, don't free fireballs that will be deleting
16859  * other objects.
16860  *
16861  * Revision 1.316  1995/01/14  19:16:48  john
16862  * First version of new bitmap paging code.
16863  *
16864  * Revision 1.315  1995/01/12  18:53:37  john
16865  * Fixed parameter passing error.
16866  *
16867  * Revision 1.314  1995/01/12  12:09:47  yuan
16868  * Added coop object capability.
16869  *
16870  * Revision 1.313  1994/12/15  16:45:44  matt
16871  * Took out slew stuff for release version
16872  *
16873  * Revision 1.312  1994/12/15  13:04:25  mike
16874  * Replace Players[Player_num].time_total references with GameTime.
16875  *
16876  * Revision 1.311  1994/12/15  11:01:04  mike
16877  * add Object_minus_one for debugging.
16878  *
16879  * Revision 1.310  1994/12/15  03:03:33  matt
16880  * Added error checking for NULL return from object_create_explosion()
16881  *
16882  * Revision 1.309  1994/12/14  17:25:31  matt
16883  * Made next viewer func based on release not ndebug
16884  *
16885  * Revision 1.308  1994/12/13  12:55:42  mike
16886  * hostages on board messages for when you die.
16887  *
16888  * Revision 1.307  1994/12/12  17:18:11  mike
16889  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
16890  *
16891  * Revision 1.306  1994/12/12  00:27:11  matt
16892  * Added support for no-levelling option
16893  *
16894  * Revision 1.305  1994/12/11  22:41:14  matt
16895  * Added command-line option, -nolevel, which turns off player ship levelling
16896  *
16897  * Revision 1.304  1994/12/11  22:03:23  mike
16898  * free up object slots as necessary.
16899  *
16900  * Revision 1.303  1994/12/11  14:09:31  mike
16901  * make boss explosion sounds softer.
16902  *
16903  * Revision 1.302  1994/12/11  13:25:11  matt
16904  * Restored calls to fix_object_segs() when debugging is turned off, since
16905  * it's not a big routine, and could fix some possibly bad problems.
16906  *
16907  * Revision 1.301  1994/12/11  12:38:25  mike
16908  * make boss explosion sounds louder in create_small_fireball.
16909  *
16910  * Revision 1.300  1994/12/10  15:28:37  matt
16911  * Added asserts for debugging
16912  *
16913  * Revision 1.299  1994/12/09  16:18:51  matt
16914  * Fixed init_player_object, for editor
16915  *
16916  * Revision 1.298  1994/12/09  15:03:10  matt
16917  * Two changes for Mike:
16918  *   1.  Do better placement of camera during death sequence (prevents hang)
16919  *   2.  Only record dodging information if the player fired in a frame
16920  *
16921  * Revision 1.297  1994/12/09  14:59:12  matt
16922  * Added system to attach a fireball to another object for rendering purposes,
16923  * so the fireball always renders on top of (after) the object.
16924  *
16925  * Revision 1.296  1994/12/08  20:05:07  matt
16926  * Removed unneeded debug message
16927  *
16928  * Revision 1.295  1994/12/08  12:36:02  matt
16929  * Added new object allocation & deallocation functions so other code
16930  * could stop messing around with internal object data structures.
16931  *
16932  * Revision 1.294  1994/12/07  20:13:37  matt
16933  * Added debris object limiter
16934  *
16935  * Revision 1.293  1994/12/06  16:58:38  matt
16936  * Killed warnings
16937  *
16938  * Revision 1.292  1994/12/05  22:34:35  matt
16939  * Make tmap_override objects use override texture as alt texture.  This
16940  * should have the effect of making simpler models use the override texture.
16941  *
16942  * Revision 1.291  1994/12/05  12:23:53  mike
16943  * make camera start closer, but move away from player in death sequence.
16944  *
16945  * Revision 1.290  1994/12/02  11:11:18  mike
16946  * hook sound effect to player small explosions (ctrlcen, too).
16947  *
16948  * Revision 1.289  1994/11/28  21:50:52  mike
16949  * optimizations.
16950  *
16951  * Revision 1.288  1994/11/27  23:12:28  matt
16952  * Made changes for new mprintf calling convention
16953  *
16954  * Revision 1.287  1994/11/27  20:35:50  matt
16955  * Fixed dumb mistake
16956  *
16957  * Revision 1.286  1994/11/27  20:30:52  matt
16958  * Got rid of warning
16959  *
16960  * Revision 1.285  1994/11/21  11:43:21  mike
16961  * ndebug stuff.
16962  *
16963  * Revision 1.284  1994/11/19  15:19:37  mike
16964  * rip out unused code and data.
16965  *
16966  * Revision 1.283  1994/11/18  23:41:59  john
16967  * Changed some shorts to ints.
16968  *
16969  * Revision 1.282  1994/11/18  16:16:17  mike
16970  * Separate depth on objects vs. walls.
16971  *
16972  * Revision 1.281  1994/11/18  12:05:35  rob
16973  * Removed unnecessary invulnerability flag set in player death.
16974  * (I hope its unnecessary.. its commented out if it proves crucial)
16975  * fixes powerup dropping bug for net play.
16976  *
16977  * Revision 1.280  1994/11/16  20:36:34  rob
16978  * Changed player explosion (small) code.
16979  *
16980  * Revision 1.279  1994/11/16  18:26:04  matt
16981  * Clear tmap override on player, to fix "rock ship" bug
16982  *
16983  * Revision 1.278  1994/11/16  14:54:12  rob
16984  * Moved hook for network explosions.
16985  *
16986  * Revision 1.277  1994/11/14  11:40:42  mike
16987  * plot inner polygon on laser based on detail level.
16988  *
16989  * Revision 1.276  1994/11/10  14:02:59  matt
16990  * Hacked in support for player ships with different textures
16991  *
16992  * Revision 1.275  1994/11/08  12:19:08  mike
16993  * Make a generally useful function for putting small explosions on any object.
16994  *
16995  * Revision 1.274  1994/11/04  19:55:54  rob
16996  * Changed calls to player_explode to accomodate new parameter.
16997  *
16998  * Revision 1.273  1994/11/02  21:54:27  matt
16999  * Delete the camera when the death sequence is done
17000  *
17001  * Revision 1.272  1994/11/02  11:36:35  rob
17002  * Added player-in-process-of-dying explosions to network play.
17003  *
17004  * Revision 1.271  1994/10/31  17:25:33  matt
17005  * Fixed cloaked bug
17006  *
17007  * Revision 1.270  1994/10/31  16:11:19  allender
17008  * on demo recording, store letterbox mode in demo.
17009  *
17010  * Revision 1.269  1994/10/31  10:36:18  mike
17011  * Make cloak effect fadein/fadeout different for robots versus player.
17012  *
17013  * Revision 1.268  1994/10/30  14:11:44  mike
17014  * rip out repair center stuff.
17015  *
17016  * Revision 1.267  1994/10/28  19:43:52  mike
17017  * Boss cloaking effect.
17018  *
17019  * Revision 1.266  1994/10/27  11:33:42  mike
17020  * Add Highest_ever_object_index -- high water mark in object creation.
17021  *
17022  * Revision 1.265  1994/10/25  10:51:12  matt
17023  * Vulcan cannon powerups now contain ammo count
17024  *
17025  * Revision 1.264  1994/10/24  20:49:24  matt
17026  * Made cloaked objects pulse
17027  *
17028  * Revision 1.263  1994/10/21  12:19:45  matt
17029  * Clear transient objects when saving (& loading) games
17030  *
17031  * Revision 1.262  1994/10/21  11:25:23  mike
17032  * Use new constant IMMORTAL_TIME.
17033  *
17034  * Revision 1.261  1994/10/19  16:50:35  matt
17035  * If out of segment, put player in center of segment when checking objects
17036  *
17037  *
17038  * Revision 1.260  1994/10/17  23:21:55  mike
17039  * Clean up robot cloaking, move more to ai.c
17040  *
17041  * Revision 1.259  1994/10/17  21:34:49  matt
17042  * Added support for new Control Center/Main Reactor
17043  *
17044  * Revision 1.258  1994/10/17  21:18:04  mike
17045  * robot cloaking.
17046  *
17047  * Revision 1.257  1994/10/17  14:12:23  matt
17048  * Cleaned up problems with player dying from mine explosion
17049  *
17050  * Revision 1.256  1994/10/15  19:04:31  mike
17051  * Don't remove proximity bombs after you die.
17052  *
17053  * Revision 1.255  1994/10/14  15:57:00  mike
17054  * Don't show ids in network mode.
17055  * Fix, I hope, but in death sequence.
17056  *
17057  * Revision 1.254  1994/10/12  08:04:29  mike
17058  * Don't decloak player on death.
17059  *
17060  * Revision 1.253  1994/10/11  20:36:16  matt
17061  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
17062  *
17063  * Revision 1.252  1994/10/11  12:24:09  matt
17064  * Cleaned up/change badass explosion calls
17065  *
17066  * Revision 1.251  1994/10/08  19:30:20  matt
17067  * Fixed (I hope) a bug in cloaking of multiplayer objects
17068  *
17069  * Revision 1.250  1994/10/08  14:03:15  rob
17070  * Changed cloaking routine.
17071  *
17072  * Revision 1.249  1994/10/07  22:17:27  mike
17073  * Asserts on valid segnum.
17074  *
17075  * Revision 1.248  1994/10/07  19:11:14  matt
17076  * Added cool cloak transition effect
17077
17078 ------------------------------------------------------------------------
17079 main/object.h:
17080
17081  * Revision 1.6  1995/09/20  14:24:45  allender
17082  * swap bytes on extractshortpos
17083  *
17084  * Revision 1.5  1995/09/14  14:11:42  allender
17085  * fix_object_segs returns void
17086  *
17087  * Revision 1.4  1995/08/12  12:02:44  allender
17088  * added flag to create_shortpos
17089  *
17090  * Revision 1.3  1995/07/12  12:55:08  allender
17091  * move structures back to original form as found on PC because
17092  * of network play
17093  *
17094  * Revision 1.2  1995/06/19  07:55:06  allender
17095  * rearranged structure members for possible better alignment
17096  *
17097  * Revision 1.1  1995/05/16  16:00:40  allender
17098  * Initial revision
17099  *
17100  * Revision 2.1  1995/03/31  12:24:10  john
17101  * I had changed alt_textures from a pointer to a byte. This hosed old
17102  * saved games, so I restored it to an int.
17103  *
17104  * Revision 2.0  1995/02/27  11:26:47  john
17105  * New version 2.0, which has no anonymous unions, builds with
17106  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17107  *
17108  * Revision 1.122  1995/02/22  12:35:53  allender
17109  * remove anonymous unions
17110  *
17111  * Revision 1.121  1995/02/06  20:43:25  rob
17112  * Extern'ed Dead_player_camera so it can be reset by multi.c
17113  *
17114  * Revision 1.120  1995/02/01  16:34:07  john
17115  * Linted.
17116  *
17117  * Revision 1.119  1995/01/29  13:46:42  mike
17118  * adapt to new create_small_fireball_on_object prototype.
17119  *
17120  * Revision 1.118  1995/01/26  22:11:27  mike
17121  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
17122  *
17123  * Revision 1.117  1995/01/24  12:09:29  mike
17124  * Boost MAX_OBJECTS from 250 to 350.
17125  *
17126  * Revision 1.116  1995/01/13  19:39:51  rob
17127  * Removed outdated remote_info structure.  (looking for cause of bugs
17128  *
17129  * Revision 1.115  1995/01/12  12:09:38  yuan
17130  * Added coop object capability.
17131  *
17132  * Revision 1.114  1994/12/15  13:04:20  mike
17133  * Replace Players[Player_num].time_total references with GameTime.
17134  *
17135  * Revision 1.113  1994/12/12  17:18:09  mike
17136  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
17137  *
17138  * Revision 1.112  1994/12/09  14:58:42  matt
17139  * Added system to attach a fireball to another object for rendering purposes,
17140  * so the fireball always renders on top of (after) the object.
17141  *
17142  * Revision 1.111  1994/12/08  12:35:35  matt
17143  * Added new object allocation & deallocation functions so other code
17144  * could stop messing around with internal object data structures.
17145  *
17146  * Revision 1.110  1994/11/21  17:30:21  matt
17147  * Increased max number of objects
17148  *
17149  * Revision 1.109  1994/11/18  23:41:52  john
17150  * Changed some shorts to ints.
17151  *
17152  * Revision 1.108  1994/11/10  14:02:45  matt
17153  * Hacked in support for player ships with different textures
17154  *
17155  * Revision 1.107  1994/11/08  12:19:27  mike
17156  * Small explosions on objects.
17157  *
17158  * Revision 1.106  1994/10/25  10:51:17  matt
17159  * Vulcan cannon powerups now contain ammo count
17160  *
17161  * Revision 1.105  1994/10/21  12:19:41  matt
17162  * Clear transient objects when saving (& loading) games
17163  *
17164  * Revision 1.104  1994/10/21  11:25:04  mike
17165  * Add IMMORTAL_TIME.
17166  *
17167  * Revision 1.103  1994/10/17  21:34:54  matt
17168  * Added support for new Control Center/Main Reactor
17169  *
17170  * Revision 1.102  1994/10/14  18:12:28  mike
17171  * Make egg dropping return object number.
17172  *
17173  * Revision 1.101  1994/10/12  21:07:19  matt
17174  * Killed unused field in object structure
17175  *
17176  * Revision 1.100  1994/10/12  10:38:24  mike
17177  * Add field OF_SILENT to obj->flags.
17178  *
17179  * Revision 1.99  1994/10/11  20:35:48  matt
17180  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
17181  *
17182  * Revision 1.98  1994/10/03  20:56:13  rob
17183  * Added velocity to shortpos strucutre.
17184  *
17185  * Revision 1.97  1994/09/30  18:24:00  rob
17186  * Added new control type CT_REMOTE for remote controlled objects.
17187  * Also added a union struct 'remote_info' for this type.
17188  *
17189  * Revision 1.96  1994/09/28  09:23:05  mike
17190  * Prototype Object_type_names.
17191  *
17192  * Revision 1.95  1994/09/25  23:32:37  matt
17193  * Changed the object load & save code to read/write the structure fields one
17194  * at a time (rather than the whole structure at once).  This mean that the
17195  * object structure can be changed without breaking the load/save functions.
17196  * As a result of this change, the local_object data can be and has been
17197  * incorporated into the object array.  Also, timeleft is now a property
17198  * of all objects, and the object structure has been otherwise cleaned up.
17199  *
17200  * Revision 1.94  1994/09/25  15:45:28  matt
17201  * Added OBJ_LIGHT, a type of object that casts light
17202  * Added generalized lifeleft, and moved it to local_object
17203  *
17204  * Revision 1.93  1994/09/24  17:41:19  mike
17205  * Add stuff to Local_object structure for materialization centers.
17206  *
17207  * Revision 1.92  1994/09/24  13:16:50  matt
17208  * Added (hacked in, really) support for overriding the bitmaps used on to
17209  * texture map a polygon object, and using a new bitmap for all the faces.
17210  *
17211  * Revision 1.91  1994/09/22  19:02:14  mike
17212  * Prototype functions extract_shortpos and create_shortpos which reside in
17213  * gameseg.c, but are prototyped here to prevent circular dependencies.
17214  *
17215  * Revision 1.90  1994/09/15  21:47:14  mike
17216  * Prototype dead_player_end().
17217  *
17218  * Revision 1.89  1994/09/15  16:34:47  mike
17219  * Add danger_laser_num and danger_laser_signature to object_local to
17220  * enable robots to efficiently (too efficiently!) avoid player fire.
17221  *
17222  * Revision 1.88  1994/09/11  22:46:19  mike
17223  * Death_sequence_aborted prototyped.
17224  *
17225  * Revision 1.87  1994/09/09  20:04:30  mike
17226  * Add vclips for weapons.
17227  *
17228  * Revision 1.86  1994/09/09  14:20:54  matt
17229  * Added flag that says object uses thrust
17230  *
17231  * Revision 1.85  1994/09/08  14:51:32  mike
17232  * Make a crucial name change to a field of local_object struct.
17233  *
17234  * Revision 1.84  1994/09/07  19:16:45  mike
17235  * Homing missile.
17236  *
17237  * Revision 1.83  1994/09/06  17:05:43  matt
17238  * Added new type for dead player
17239  *
17240  * Revision 1.82  1994/09/02  11:56:09  mike
17241  * Add persistency (PF_PERSISTENT) to physics_info.
17242  *
17243  * Revision 1.81  1994/08/28  19:10:28  mike
17244  * Add Player_is_dead.
17245  *
17246  * Revision 1.80  1994/08/18  15:11:44  mike
17247  * powerup stuff.
17248  *
17249  * Revision 1.79  1994/08/15  15:24:54  john
17250  * Made players know who killed them; Disabled cheat menu
17251  * during net player; fixed bug with not being able to turn
17252  * of invulnerability; Made going into edit/starting new leve
17253  * l drop you out of a net game; made death dialog box.
17254  *
17255  * Revision 1.78  1994/08/14  23:15:12  matt
17256  * Added animating bitmap hostages, and cleaned up vclips a bit
17257  *
17258  * Revision 1.77  1994/08/13  14:58:27  matt
17259  * Finished adding support for miscellaneous objects
17260  *
17261  * Revision 1.76  1994/08/09  16:04:13  john
17262  * Added network players to editor.
17263  *
17264  * Revision 1.75  1994/08/03  21:06:19  matt
17265  * Added prototype for fix_object_segs(), and renamed now-unused spawn_pos
17266  *
17267  * Revision 1.74  1994/08/02  12:30:27  matt
17268  * Added support for spinning objects
17269  *
17270  * Revision 1.73  1994/07/27  20:53:25  matt
17271  * Added rotational drag & thrust, so turning now has momemtum like moving
17272  *
17273  * Revision 1.72  1994/07/27  19:44:21  mike
17274  * Objects containing objects.
17275  *
17276  * Revision 1.71  1994/07/22  20:43:29  matt
17277  * Fixed flares, by adding a physics flag that makes them stick to walls.
17278  *
17279  * Revision 1.70  1994/07/21  12:42:10  mike
17280  * Prototype new find_object_seg and update_object_seg.
17281  *
17282  * Revision 1.69  1994/07/19  15:26:39  mike
17283  * New ai_static structure.
17284  *
17285  * Revision 1.68  1994/07/13  00:15:06  matt
17286  * Moved all (or nearly all) of the values that affect player movement to
17287  * bitmaps.tbl
17288  *
17289  * Revision 1.67  1994/07/12  12:40:12  matt
17290  * Revamped physics system
17291  *
17292  * Revision 1.66  1994/07/06  15:26:23  yuan
17293  * Added chase mode.
17294
17295 ------------------------------------------------------------------------
17296 main/paging.c:
17297
17298  * Revision 1.5  1995/10/30  11:06:58  allender
17299  * added change to paging code ala John -- check tmap_override
17300  * when paging in robots
17301  *
17302  * Revision 1.4  1995/09/13  08:48:28  allender
17303  * John's new paging code
17304  *
17305  * Revision 1.3  1995/08/18  10:20:31  allender
17306  * changed hard coded black pixel value to use BM_XRGB
17307  *
17308  * Revision 1.2  1995/07/26  17:02:10  allender
17309  * small fix to page in effect bitmaps correctly
17310  *
17311  * Revision 1.1  1995/05/16  15:29:35  allender
17312  * Initial revision
17313  *
17314  * Revision 2.5  1995/10/07  13:18:21  john
17315  * Added PSX debugging stuff that builds .PAG files.
17316  *
17317  * Revision 2.4  1995/08/24  13:40:03  john
17318  * Added code to page in vclip for powerup disapperance and to
17319  * fix bug that made robot makers not page in the correct bot
17320  * textures.
17321  *
17322  * Revision 2.3  1995/07/26  12:09:19  john
17323  * Made code that pages in weapon_info->robot_hit_vclip not
17324  * page in unless it is a badass weapon.  Took out old functionallity
17325  * of using this if no robot exp1_vclip, since all robots have these.
17326  *
17327  * Revision 2.2  1995/07/24  13:22:11  john
17328  * Made sure everything gets paged in at the
17329  * level start.  Fixed bug with robot effects not
17330  * getting paged in correctly.
17331  *
17332  * Revision 2.1  1995/05/12  15:50:16  allender
17333  * fix to check effects dest_bm_num > -1 before paging in
17334  *
17335  * Revision 2.0  1995/02/27  11:27:39  john
17336  * New version 2.0, which has no anonymous unions, builds with
17337  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17338  *
17339  * Revision 1.18  1995/02/22  14:12:28  allender
17340  * remove anonyous union from object structure
17341  *
17342  * Revision 1.17  1995/02/11  22:54:15  john
17343  * Made loading for pig not show up for demos.
17344  *
17345  * Revision 1.16  1995/02/11  22:37:04  john
17346  * Made cockpit redraw.
17347  *
17348  * Revision 1.15  1995/01/28  16:29:35  john
17349  * *** empty log message ***
17350  *
17351  * Revision 1.14  1995/01/27  17:16:18  john
17352  * Added code to page in all the weapons.
17353  *
17354  * Revision 1.13  1995/01/24  21:51:22  matt
17355  * Clear the boxed message to fix a mem leakage
17356  *
17357  * Revision 1.12  1995/01/23  13:00:46  john
17358  * Added hostage vclip paging.
17359  *
17360  * Revision 1.11  1995/01/23  12:29:52  john
17361  * Added code to page in eclip on robots, dead control center,
17362  * gauges bitmaps, and weapon pictures.
17363  *
17364  * Revision 1.10  1995/01/21  12:54:15  adam
17365  * *** empty log message ***
17366  *
17367  * Revision 1.9  1995/01/21  12:41:29  adam
17368  * changed orb to loading box
17369  *
17370  * Revision 1.8  1995/01/18  15:09:02  john
17371  * Added start/stop time around paging.
17372  * Made paging clear screen around globe.
17373  *
17374  * Revision 1.7  1995/01/18  10:37:00  john
17375  * Added code to page in exploding monitors.
17376  *
17377  * Revision 1.6  1995/01/17  19:03:35  john
17378  * Added cool spinning orb during loading.
17379  *
17380  * Revision 1.5  1995/01/17  14:49:26  john
17381  * Paged in weapons.
17382  *
17383  * Revision 1.4  1995/01/17  12:14:07  john
17384  * Made walls, object explosion vclips load at level start.
17385  *
17386  * Revision 1.3  1995/01/15  13:23:24  john
17387  * First working version
17388  *
17389  * Revision 1.2  1995/01/15  11:56:45  john
17390  * Working version of paging.
17391  *
17392  * Revision 1.1  1995/01/15  11:33:37  john
17393  * Initial revision
17394
17395 ------------------------------------------------------------------------
17396 main/paging.h:
17397
17398  * Revision 1.1  1995/05/16  16:00:48  allender
17399  * Initial revision
17400  *
17401  * Revision 2.0  1995/02/27  11:30:12  john
17402  * New version 2.0, which has no anonymous unions, builds with
17403  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17404  *
17405  * Revision 1.2  1995/01/15  11:56:39  john
17406  * Working version of paging.
17407  *
17408  * Revision 1.1  1995/01/15  11:33:52  john
17409  * Initial revision
17410
17411 ------------------------------------------------------------------------
17412 main/physics.c:
17413
17414  * Revision 1.5  1995/10/12  17:28:08  allender
17415  * put in code to move and object to center of segment in
17416  * do_physics sim when fvi fails with bad point
17417  *
17418  * Revision 1.4  1995/08/23  21:32:44  allender
17419  * fix mcc compiler warnings
17420  *
17421  * Revision 1.3  1995/07/28  15:38:56  allender
17422  * removed isqrt thing -- not required here
17423  *
17424  * Revision 1.2  1995/07/28  15:13:29  allender
17425  * fixed vector magnitude thing
17426  *
17427  * Revision 1.1  1995/05/16  15:29:42  allender
17428  * Initial revision
17429  *
17430  * Revision 2.2  1995/03/24  14:48:54  john
17431  * Added cheat for player to go thru walls.
17432  *
17433  * Revision 2.1  1995/03/20  18:15:59  john
17434  * Added code to not store the normals in the segment structure.
17435  *
17436  * Revision 2.0  1995/02/27  11:32:06  john
17437  * New version 2.0, which has no anonymous unions, builds with
17438  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17439  *
17440  * Revision 1.213  1995/02/22  13:40:48  allender
17441  * remove anonymous unions from object structure
17442  *
17443  * Revision 1.212  1995/02/22  13:24:42  john
17444  * Removed the vecmat anonymous unions.
17445  *
17446  * Revision 1.211  1995/02/06  19:46:59  matt
17447  * New function (untested), set_thrust_from_velocity()
17448  *
17449  * Revision 1.210  1995/02/02  16:26:12  matt
17450  * Changed assert that was causing a problem
17451  *
17452  * Revision 1.209  1995/02/02  14:07:00  matt
17453  * Fixed confusion about which segment you are touching when you're
17454  * touching a wall.  This manifested itself in spurious lava burns.
17455  *
17456  * Revision 1.208  1995/02/01  21:03:24  john
17457  * Lintified.
17458  *
17459  * Revision 1.207  1995/01/25  13:53:35  rob
17460  * Removed an Int3 from multiplayer games.
17461  *
17462  * Revision 1.206  1995/01/23  17:30:47  rob
17463  * Removed Int3 on bogus sim time.
17464  *
17465  * Revision 1.205  1995/01/17  11:08:56  matt
17466  * Disable new-ish FVI edge checking for all objects except the player,
17467  * since it was causing problems with the fusion cannon.
17468  *
17469  * Revision 1.204  1995/01/05  09:43:49  matt
17470  * Took out int3s from new code
17471  *
17472  * Revision 1.203  1995/01/04  22:19:23  matt
17473  * Added hack to keep player from squeezing through closed walls/doors
17474  *
17475  * Revision 1.202  1995/01/02  12:38:48  mike
17476  * physics hack to crazy josh not get hung up on proximity bombs.  Matt notified via email.
17477  *
17478  * Revision 1.201  1994/12/13  15:39:22  mike
17479  * #ifndef NDEBUG some code.
17480  *
17481  * Revision 1.200  1994/12/13  13:28:34  yuan
17482  * Fixed type.
17483  *
17484  * Revision 1.199  1994/12/13  13:25:00  matt
17485  * Made bump hack compile out if so desired
17486  *
17487  * Revision 1.198  1994/12/13  12:02:39  matt
17488  * Added hack to bump player a little if stuck
17489  *
17490  * Revision 1.197  1994/12/12  00:32:23  matt
17491  * When objects other than player go out of mine, jerk to center of segment
17492  *
17493  * Revision 1.196  1994/12/10  22:52:42  mike
17494  * make physics left-the-mine checking always be in.
17495  *
17496  * Revision 1.195  1994/12/08  00:53:01  mike
17497  * oops...phys rot bug.
17498  *
17499  * Revision 1.194  1994/12/07  12:54:54  mike
17500  * tweak rotvel applied from collisions.
17501  *
17502  * Revision 1.193  1994/12/07  00:36:08  mike
17503  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
17504  *
17505  * Revision 1.192  1994/12/05  17:23:10  matt
17506  * Made a bunch of debug code compile out
17507  *
17508  * Revision 1.191  1994/12/05  16:30:10  matt
17509  * Was illegally changing an object's segment...shoot me.
17510  *
17511  * Revision 1.190  1994/12/05  11:58:51  mike
17512  * fix stupid apply_force_rot() bug.
17513  *
17514  * Revision 1.189  1994/12/05  09:42:17  mike
17515  * fix 0 mag problem when object applies force to itself.
17516  *
17517  * Revision 1.188  1994/12/04  22:48:40  matt
17518  * Physics & FVI now only build seglist for player objects, and they
17519  * responsilby deal with buffer full conditions
17520  *
17521  * Revision 1.187  1994/12/04  22:14:07  mike
17522  * apply instantaneous rotation to an object due to a force blow.
17523  *
17524  * Revision 1.186  1994/12/04  18:51:30  matt
17525  * When weapons get stuck, delete them!
17526  *
17527  * Revision 1.185  1994/12/04  18:38:56  matt
17528  * Added better handling of point-not-in-seg problem
17529  *
17530  * Revision 1.184  1994/11/27  23:13:42  matt
17531  * Made changes for new mprintf calling convention
17532  *
17533  * Revision 1.183  1994/11/25  23:46:18  matt
17534  * Fixed drag problems with framerates over 60Hz
17535  *
17536  * Revision 1.182  1994/11/25  22:15:52  matt
17537  * Added asserts to try to trap frametime < 0 bug
17538  *
17539  * Revision 1.181  1994/11/21  11:42:44  mike
17540  * ndebug stuff.
17541  *
17542  * Revision 1.180  1994/11/19  15:15:04  mike
17543  * remove unused code and data
17544  *
17545  * Revision 1.179  1994/11/16  11:25:22  matt
17546  * Abort physics if negative frametime
17547  *
17548  * Revision 1.178  1994/10/05  19:50:41  rob
17549  * Removed a non-critical Int3 where an object's segnum is checked.
17550  * Left mprintf message.
17551  *
17552  * Revision 1.177  1994/10/03  22:57:50  matt
17553  * Fixed problem with matrix corruption of non-moving (but rotating) objects
17554  *
17555  * Revision 1.176  1994/09/28  09:23:28  mike
17556  * Add useful information to mprintf(1,... error messages.
17557  *
17558  * Revision 1.175  1994/09/21  17:16:54  mike
17559  * Make objects stuck in doors go away when door opens.
17560  *
17561  * Revision 1.174  1994/09/12  14:19:06  matt
17562  * Drag & thrust now handled differently
17563  *
17564  * Revision 1.173  1994/09/09  14:21:12  matt
17565  * Use new thrust flag
17566  *
17567  * Revision 1.172  1994/09/08  16:21:57  matt
17568  * Cleaned up player-hit-wall code, and added object scrape handling
17569  * Also added weapon-on-weapon hit sound
17570  *
17571  * Revision 1.171  1994/09/02  12:30:37  matt
17572  * Fixed weapons which go through objects
17573  *
17574  * Revision 1.170  1994/09/02  11:55:14  mike
17575  * Kill redefinition of a constant which is properly defined in object.h
17576  *
17577  * Revision 1.169  1994/09/02  11:35:01  matt
17578  * Fixed typo
17579  *
17580  * Revision 1.168  1994/09/02  11:32:48  matt
17581  * Fixed object/object collisions, so you can't fly through robots anymore.
17582  * Cleaned up object damage system.
17583  *
17584  * Revision 1.167  1994/08/30  21:58:15  matt
17585  * Made phys_apply_force() do nothing to an object if it's not a phys object
17586  *
17587  * Revision 1.166  1994/08/26  10:47:01  john
17588  * New version of controls.
17589  *
17590  * Revision 1.165  1994/08/25  21:53:57  mike
17591  * Prevent counts of -1 which eventually add up to a positive number in do_ai_frame, causing
17592  * the too-many-retries behavior.
17593  *
17594  * Revision 1.164  1994/08/25  18:43:33  john
17595  * First revision of new control code.
17596  *
17597  * Revision 1.163  1994/08/17  22:18:05  mike
17598  * Make robots which have rotvel or rotthrust, but not movement, move.
17599  *
17600  * Revision 1.162  1994/08/13  17:31:18  mike
17601  * retry count stuff.
17602  *
17603  * Revision 1.161  1994/08/11  18:59:16  mike
17604  * *** empty log message ***
17605  *
17606  * Revision 1.160  1994/08/10  19:53:47  mike
17607  * Debug code (which is still in...)
17608  * and adapt to changed interface to create_path_to_player.
17609  *
17610  * Revision 1.159  1994/08/08  21:38:43  matt
17611  * Cleaned up a code a little and optimized a little
17612  *
17613  * Revision 1.158  1994/08/08  15:21:50  mike
17614  * Trap retry count >= 4, but don't do AI hack unless >= 6.
17615  *
17616  * Revision 1.157  1994/08/08  11:47:15  matt
17617  * Cleaned up fvi and physics a little
17618  *
17619  * Revision 1.156  1994/08/05  10:10:10  yuan
17620  * Commented out debug stuff that was killing framerate.
17621  *
17622  * Revision 1.155  1994/08/04  19:12:36  matt
17623  * Changed a bunch of vecmat calls to use multiple-function routines, and to
17624  * allow the use of C macros for some functions
17625  *
17626  * Revision 1.154  1994/08/04  16:33:57  mike
17627  * Kill a pile of RCS stuff.
17628  * Call create_path_to_player for a stuck object.
17629  *
17630  * Revision 1.153  1994/08/04  00:21:02  matt
17631  * Cleaned up fvi & physics error handling; put in code to make sure objects
17632  * are in correct segment; simplified segment finding for objects and points
17633  *
17634  * Revision 1.152  1994/08/01  16:25:34  matt
17635  * Check for moved_time == 0 when computing hit speed
17636  *
17637  * Revision 1.151  1994/08/01  13:30:32  matt
17638  * Made fvi() check holes in transparent walls, and changed fvi() calling
17639  * parms to take all input data in query structure.
17640  *
17641  * Revision 1.150  1994/07/29  23:41:46  matt
17642  * Fixed turn banking, which changed when I added rotational velocity
17643  *
17644  * Revision 1.149  1994/07/27  20:53:23  matt
17645  * Added rotational drag & thrust, so turning now has momemtum like moving
17646
17647 ------------------------------------------------------------------------
17648 main/physics.h:
17649
17650  * Revision 1.2  1995/08/23  21:33:04  allender
17651  * fix mcc compiler warnings
17652  *
17653  * Revision 1.1  1995/05/16  16:00:56  allender
17654  * Initial revision
17655  *
17656  * Revision 2.0  1995/02/27  11:33:06  john
17657  * New version 2.0, which has no anonymous unions, builds with
17658  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17659  *
17660  * Revision 1.29  1995/02/06  19:47:18  matt
17661  * New function (untested), set_thrust_from_velocity()
17662  *
17663  * Revision 1.28  1994/12/04  22:14:20  mike
17664  * apply instantaneous rotation to an object due to a force blow.
17665  *
17666  * Revision 1.27  1994/08/01  13:29:42  matt
17667  * Made fvi() check holes in transparent walls, and changed fvi() calling
17668  * parms to take all input data in query structure.
17669  *
17670  * Revision 1.26  1994/07/28  12:35:22  matt
17671  * Added prototype
17672  *
17673  * Revision 1.25  1994/07/13  21:48:05  matt
17674  * FVI() and physics now keep lists of segments passed through which the
17675  * trigger code uses.
17676  *
17677  * Revision 1.24  1994/06/30  19:01:55  matt
17678  * Moved flying controls code from physics.c to controls.c
17679  *
17680  * Revision 1.23  1994/06/16  14:14:20  mike
17681  * Change physics_lookahead to return hit_info.
17682  *
17683  * Revision 1.22  1994/06/09  09:58:43  matt
17684  * Moved find_vector_intersection() from physics.c to new file fvi.c
17685  *
17686  * Revision 1.21  1994/05/20  16:11:07  matt
17687  * Added new parm, ignore_obj, to find_vector_intersection()
17688  *
17689  * Revision 1.20  1994/05/20  15:16:58  matt
17690  * Added new fvi return type; took out some troublesome (and troubling) asserts
17691
17692 ------------------------------------------------------------------------
17693 main/piggy.c:
17694
17695  * Revision 1.16  1995/11/09  17:27:47  allender
17696  * put in missing quote on new gauge name
17697  *
17698  * Revision 1.15  1995/11/08  17:28:03  allender
17699  * add PC gauges to gauge list of non-substitutatble bitmaps
17700  *
17701  * Revision 1.14  1995/11/08  15:14:49  allender
17702  * fixed horrible bug where the piggy cache size was incorrect
17703  * for mac shareware
17704  *
17705  * Revision 1.13  1995/11/03  12:53:37  allender
17706  * shareware changes
17707  *
17708  * Revision 1.12  1995/10/21  22:25:14  allender
17709  * added bald guy cheat
17710  *
17711  * Revision 1.11  1995/10/20  22:42:15  allender
17712  * changed load path of descent.pig to :data:descent.pig
17713  *
17714  * Revision 1.10  1995/10/20  00:08:01  allender
17715  * put in event loop calls when loading data (hides it nicely
17716  * from user) so TM can get it's strokes stuff
17717  *
17718  * Revision 1.9  1995/09/13  08:48:01  allender
17719  * added lower memory requirement to load alternate bitmaps
17720  *
17721  * Revision 1.8  1995/08/16  09:39:13  allender
17722  * moved "loading" text up a little
17723  *
17724  * Revision 1.7  1995/08/08  13:54:26  allender
17725  * added macsys header file
17726  *
17727  * Revision 1.6  1995/07/12  12:49:56  allender
17728  * total hack for bitmaps > 512 bytes wide -- check these by name
17729  *
17730  * Revision 1.5  1995/07/05  16:47:05  allender
17731  * kitchen stuff
17732  *
17733  * Revision 1.4  1995/06/23  08:55:28  allender
17734  * make "loading data" text y loc based off of curcanv
17735  *
17736  * Revision 1.3  1995/06/08  14:08:52  allender
17737  * PPC aligned data sets
17738  *
17739  * Revision 1.2  1995/05/26  06:54:27  allender
17740  * removed refences to sound data at end of pig file (since they will
17741  * now be Macintosh snd resources for effects
17742  *
17743  * Revision 1.1  1995/05/16  15:29:51  allender
17744  * Initial revision
17745  *
17746  * Revision 2.10  1995/10/07  13:17:26  john
17747  * Made all bitmaps paged out by default.
17748  *
17749  * Revision 2.9  1995/04/14  14:05:24  john
17750  * *** empty log message ***
17751  *
17752  * Revision 2.8  1995/04/12  13:39:37  john
17753  * Fixed bug with -lowmem not working.
17754  *
17755  * Revision 2.7  1995/03/29  23:23:17  john
17756  * Fixed major bug with sounds not building into pig right.
17757  *
17758  * Revision 2.6  1995/03/28  18:05:00  john
17759  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
17760  *
17761  * Revision 2.5  1995/03/16  23:13:06  john
17762  * Fixed bug with piggy paging in bitmap not checking for disk
17763  * error, hence bogifying textures if you pull the CD out.
17764  *
17765  * Revision 2.4  1995/03/14  16:22:27  john
17766  * Added cdrom alternate directory stuff.
17767  *
17768  * Revision 2.3  1995/03/06  15:23:20  john
17769  * New screen techniques.
17770  *
17771  * Revision 2.2  1995/02/27  13:13:40  john
17772  * Removed floating point.
17773  *
17774  * Revision 2.1  1995/02/27  12:31:25  john
17775  * Made work without editor.
17776  *
17777  * Revision 2.0  1995/02/27  11:28:02  john
17778  * New version 2.0, which has no anonymous unions, builds with
17779  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17780  *
17781  * Revision 1.85  1995/02/09  12:54:24  john
17782  * Made paged out bitmaps have bm_data be a valid pointer
17783  * instead of NULL, in case anyone accesses it.
17784  *
17785  * Revision 1.84  1995/02/09  12:50:59  john
17786  * Bullet-proofed the piggy loading code.
17787  *
17788  * Revision 1.83  1995/02/07  17:08:51  john
17789  * Added some error handling stuff instead of asserts.
17790  *
17791  * Revision 1.82  1995/02/03  17:06:48  john
17792  * Changed sound stuff to allow low memory usage.
17793  * Also, changed so that Sounds isn't an array of digi_sounds, it
17794  * is a ubyte pointing into GameSounds, this way the digi.c code that
17795  * locks sounds won't accidentally unlock a sound that is already playing, but
17796  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
17797  *
17798  * Revision 1.81  1995/02/02  21:56:39  matt
17799  * Added data for new gauge bitmaps
17800  *
17801  * Revision 1.80  1995/02/01  23:31:57  john
17802  * Took out loading bar.
17803  *
17804  * Revision 1.79  1995/01/28  15:13:18  allender
17805  * bumped up Piggy_bitmap_cache_size
17806  *
17807  * Revision 1.78  1995/01/26  12:30:43  john
17808  * Took out prev.
17809  *
17810  * Revision 1.77  1995/01/26  12:12:17  john
17811  * Made buffer be big for bitmaps.
17812  *
17813  * Revision 1.76  1995/01/25  20:15:38  john
17814  * Made editor allocate all mem.
17815  *
17816  * Revision 1.75  1995/01/25  14:52:56  john
17817  * Made bitmap buffer be 1.5 MB.
17818  *
17819  * Revision 1.74  1995/01/22  16:03:19  mike
17820  * localization.
17821  *
17822  * Revision 1.73  1995/01/22  15:58:36  mike
17823  * localization
17824  *
17825  * Revision 1.72  1995/01/18  20:51:20  john
17826  * Took out warnings.
17827  *
17828  * Revision 1.71  1995/01/18  20:47:21  john
17829  * Added code to allocate sounds & bitmaps into diff
17830  * buffers, also made sounds not be compressed for registered.
17831  *
17832  * Revision 1.70  1995/01/18  15:08:41  john
17833  * Added start/stop time around paging.
17834  * Made paging clear screen around globe.
17835  *
17836  * Revision 1.69  1995/01/18  10:07:51  john
17837  *
17838  * Took out debugging mprintfs.
17839  *
17840  * Revision 1.68  1995/01/17  14:27:42  john
17841  * y
17842  *
17843  * Revision 1.67  1995/01/17  12:14:39  john
17844  * Made walls, object explosion vclips load at level start.
17845  *
17846  * Revision 1.66  1995/01/15  13:15:44  john
17847  * Made so that paging always happens, lowmem just loads less.
17848  * Also, make KB load print to hud.
17849  *
17850  * Revision 1.65  1995/01/15  11:56:28  john
17851  * Working version of paging.
17852  *
17853  * Revision 1.64  1995/01/14  19:17:07  john
17854  * First version of new bitmap paging code.
17855  *
17856  * Revision 1.63  1994/12/15  12:26:44  john
17857  * Added -nolowmem function.
17858  *
17859  * Revision 1.62  1994/12/14  21:12:26  john
17860  * Fixed bug with page fault when exiting and using
17861  * -nosound.
17862  *
17863  * Revision 1.61  1994/12/14  11:35:31  john
17864  * Evened out thermometer for pig read.
17865  *
17866  * Revision 1.60  1994/12/14  10:51:00  john
17867  * Sped up sound loading.
17868  *
17869  * Revision 1.59  1994/12/14  10:12:08  john
17870  * Sped up pig loading.
17871  *
17872  * Revision 1.58  1994/12/13  09:14:47  john
17873  * *** empty log message ***
17874  *
17875  * Revision 1.57  1994/12/13  09:12:57  john
17876  * Made the bar always fill up.
17877  *
17878  * Revision 1.56  1994/12/13  03:49:08  john
17879  * Made -lowmem not load the unnecessary bitmaps.
17880  *
17881  * Revision 1.55  1994/12/06  16:06:35  john
17882  * Took out piggy sorting.
17883  *
17884  * Revision 1.54  1994/12/06  15:11:14  john
17885  * Fixed bug with reading pigs.
17886  *
17887  * Revision 1.53  1994/12/06  14:14:47  john
17888  * Added code to set low mem based on memory.
17889  *
17890  * Revision 1.52  1994/12/06  14:01:10  john
17891  * Fixed bug that was causing -lowmem all the time..
17892  *
17893  * Revision 1.51  1994/12/06  13:33:48  john
17894  * Added lowmem option.
17895  *
17896  * Revision 1.50  1994/12/05  19:40:10  john
17897  * If -nosound or no sound card selected, don't load sounds from pig.
17898  *
17899  * Revision 1.49  1994/12/05  12:17:44  john
17900  * Added code that locks/unlocks digital sounds on demand.
17901  *
17902  * Revision 1.48  1994/12/05  11:39:03  matt
17903  * Fixed little mistake
17904  *
17905  * Revision 1.47  1994/12/05  09:29:22  john
17906  * Added clength to the sound field.
17907  *
17908  * Revision 1.46  1994/12/04  15:27:15  john
17909  * Fixed my stupid bug that looked at -nosound instead of digi_driver_card
17910  * to see whether or not to lock down sound memory.
17911  *
17912  * Revision 1.45  1994/12/03  14:17:00  john
17913  * Took out my debug mprintf.
17914  *
17915  * Revision 1.44  1994/12/03  13:32:37  john
17916  * Fixed bug with offscreen bitmap.
17917  *
17918  * Revision 1.43  1994/12/03  13:07:13  john
17919  * Made the pig read/write compressed sounds.
17920  *
17921  * Revision 1.42  1994/12/03  11:48:51  matt
17922  * Added option to not dump sounds to pigfile
17923  *
17924  * Revision 1.41  1994/12/02  20:02:20  matt
17925  * Made sound files constant match constant for table
17926  *
17927  * Revision 1.40  1994/11/29  11:03:09  adam
17928  * upped # of sounds
17929  *
17930  * Revision 1.39  1994/11/27  23:13:51  matt
17931  * Made changes for new mprintf calling convention
17932  *
17933  * Revision 1.38  1994/11/20  18:40:34  john
17934  * MAde the piggy.lst and piggy.all not dump for release.
17935  *
17936  * Revision 1.37  1994/11/19  23:54:45  mike
17937  * up number of bitmaps for shareware version.
17938  *
17939  * Revision 1.36  1994/11/19  19:53:05  mike
17940  * change MAX_BITMAP_FILES
17941  *
17942  * Revision 1.35  1994/11/19  10:42:56  matt
17943  * Increased number of bitmaps for non-shareware version
17944  *
17945  * Revision 1.34  1994/11/19  09:11:52  john
17946  * Added avg_color to bitmaps saved in pig.
17947  *
17948  * Revision 1.33  1994/11/19  00:07:05  john
17949  * Fixed bug with 8 char sound filenames not getting read from pig.
17950  *
17951  * Revision 1.32  1994/11/18  22:24:54  john
17952  * Added -bigpig command line that doesn't rle your pig.
17953  *
17954  * Revision 1.31  1994/11/18  21:56:53  john
17955  * Added a better, leaner pig format.
17956  *
17957  * Revision 1.30  1994/11/16  12:06:16  john
17958  * Fixed bug with calling .bbms abms.
17959  *
17960  * Revision 1.29  1994/11/16  12:00:56  john
17961  * Added piggy.all dump.
17962  *
17963  * Revision 1.28  1994/11/10  21:16:02  adam
17964  * nothing important
17965  *
17966  * Revision 1.27  1994/11/10  13:42:00  john
17967  * Made sounds not lock down if using -nosound.
17968  *
17969  * Revision 1.26  1994/11/09  19:55:40  john
17970  * Added full rle support with texture rle caching.
17971  *
17972  * Revision 1.25  1994/11/09  16:36:42  john
17973  * First version with RLE bitmaps in Pig.
17974  *
17975  * Revision 1.24  1994/10/27  19:42:59  john
17976  * Disable the piglet option.
17977  *
17978  * Revision 1.23  1994/10/27  18:51:40  john
17979  * Added -piglet option that only loads needed textures for a
17980  * mine.  Only saved ~1MB, and code still doesn't free textures
17981  * before you load a new mine.
17982  *
17983  * Revision 1.22  1994/10/25  13:11:42  john
17984  * Made the sounds sort. Dumped piggy.lst.
17985  *
17986  * Revision 1.21  1994/10/06  17:06:23  john
17987  * Took out rle stuff.
17988  *
17989  * Revision 1.20  1994/10/06  15:45:36  adam
17990  * bumped MAX_BITMAP_FILES again!
17991  *
17992  * Revision 1.19  1994/10/06  11:01:17  yuan
17993  * Upped MAX_BITMAP_FILES
17994  *
17995  * Revision 1.18  1994/10/06  10:44:45  john
17996  * Added diagnostic message and psuedo run-length-encoder
17997  * to see how much memory we would save by storing bitmaps
17998  * in a RLE method.  Also, I commented out the code that
17999  * stores 4K bitmaps on a 4K boundry to reduce pig size
18000  * a bit.
18001  *
18002  * Revision 1.17  1994/10/04  20:03:13  matt
18003  * Upped maximum number of bitmaps
18004  *
18005  * Revision 1.16  1994/10/03  18:04:20  john
18006  * Fixed bug with data_offset not set right for bitmaps
18007  * that are 64x64 and not aligned on a 4k boundry.
18008  *
18009  * Revision 1.15  1994/09/28  11:30:55  john
18010  * changed inferno.pig to descent.pig, changed the way it
18011  * is read.
18012  *
18013  * Revision 1.14  1994/09/22  16:14:17  john
18014  * Redid intro sequecing.
18015  *
18016  * Revision 1.13  1994/09/19  14:42:47  john
18017  * Locked down sounds with Virtual memory.
18018  *
18019  * Revision 1.12  1994/09/10  17:31:52  mike
18020  * Increase number of loadable bitmaps.
18021  *
18022  * Revision 1.11  1994/09/01  19:32:49  mike
18023  * Boost texture map allocation.
18024  *
18025  * Revision 1.10  1994/08/16  11:51:02  john
18026  * Added grwased pigs.
18027  *
18028  * Revision 1.9  1994/07/06  09:18:03  adam
18029  * upped bitmap #s
18030  *
18031  * Revision 1.8  1994/06/20  22:02:15  matt
18032  * Fixed bug from last change
18033  *
18034  * Revision 1.7  1994/06/20  21:33:18  matt
18035  * Made bm.h not include sounds.h, to reduce dependencies
18036  *
18037  * Revision 1.6  1994/06/20  16:52:19  john
18038  * cleaned up init output a bit.
18039  *
18040  * Revision 1.5  1994/06/08  14:20:57  john
18041  * Made piggy dump before going into game.
18042  *
18043  * Revision 1.4  1994/06/02  18:59:22  matt
18044  * Clear selector field of bitmap loaded from pig file
18045  *
18046  * Revision 1.3  1994/05/06  15:31:41  john
18047  * Made name field a bit longer.
18048  *
18049  * Revision 1.2  1994/05/06  13:02:44  john
18050  * Added piggy stuff; worked on supertransparency
18051  *
18052  * Revision 1.1  1994/05/06  11:47:26  john
18053  * Initial revision
18054
18055 ------------------------------------------------------------------------
18056 main/piggy.h:
18057
18058  * Revision 1.1  1995/05/16  16:01:04  allender
18059  * Initial revision
18060  *
18061  * Revision 2.0  1995/02/27  11:31:21  john
18062  * New version 2.0, which has no anonymous unions, builds with
18063  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18064  *
18065  * Revision 1.10  1995/02/03  17:08:29  john
18066  * Changed sound stuff to allow low memory usage.
18067  * Also, changed so that Sounds isn't an array of digi_sounds, it
18068  * is a ubyte pointing into GameSounds, this way the digi.c code that
18069  * locks sounds won't accidentally unlock a sound that is already playing, but
18070  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
18071  *
18072  * Revision 1.9  1995/01/24  14:33:49  john
18073  * *** empty log message ***
18074  *
18075  * Revision 1.8  1995/01/24  14:32:35  john
18076  * Took out paging in code.
18077  *
18078  * Revision 1.7  1995/01/23  12:30:17  john
18079  * Made debug code that mprintf what bitmap gets paged in.
18080  *
18081  * Revision 1.6  1995/01/17  14:11:37  john
18082  * Added function that is called after level loaded.
18083  *
18084  * Revision 1.5  1995/01/14  19:16:58  john
18085  * First version of new bitmap paging code.
18086  *
18087  * Revision 1.4  1994/10/27  18:51:57  john
18088  * Added -piglet option that only loads needed textures for a
18089  * mine.  Only saved ~1MB, and code still doesn't free textures
18090  * before you load a new mine.
18091  *
18092  * Revision 1.3  1994/06/08  14:20:47  john
18093  * Made piggy dump before going into game.
18094  *
18095  * Revision 1.2  1994/05/06  13:02:40  john
18096  * Added piggy stuff; worked on supertransparency
18097  *
18098  * Revision 1.1  1994/05/06  11:47:46  john
18099  * Initial revision
18100
18101 ------------------------------------------------------------------------
18102 main/player.h:
18103
18104  * Revision 1.1  1995/05/16  16:01:11  allender
18105  * Initial revision
18106  *
18107  * Revision 2.0  1995/02/27  11:30:25  john
18108  * New version 2.0, which has no anonymous unions, builds with
18109  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18110  *
18111  * Revision 1.41  1994/12/20  17:56:43  yuan
18112  * Multiplayer object capability.
18113  *
18114  * Revision 1.40  1994/12/02  15:04:42  matt
18115  * Fixed bogus weapon constants and arrays
18116  *
18117  * Revision 1.39  1994/11/25  22:47:08  matt
18118  * Made saved game descriptions longer
18119  *
18120  * Revision 1.38  1994/11/21  17:29:38  matt
18121  * Cleaned up sequencing & game saving for secret levels
18122  *
18123  * Revision 1.37  1994/11/17  12:57:13  rob
18124  * Changed net_kills_level to net_killed_total.
18125  *
18126  * Revision 1.36  1994/11/14  17:20:33  rob
18127  * Bumped player file version.
18128  *
18129  * Revision 1.35  1994/11/04  19:55:06  rob
18130  * Changed a previously unused pad character to represent whether or not
18131  * the player is connected to a net game (used to be objnum=-1 but we
18132  * want to keep the objnum info in case of re-joins)
18133  *
18134  * Revision 1.34  1994/10/22  14:13:54  mike
18135  * Add homing_object_dist field to player struct.
18136  *
18137  * Revision 1.33  1994/10/22  00:08:45  matt
18138  * Fixed up problems with bonus & game sequencing
18139  * Player doesn't get credit for hostages unless he gets them out alive
18140  *
18141  * Revision 1.32  1994/10/21  20:43:03  mike
18142  * Add hostages_on_board to player struct.
18143  *
18144  * Revision 1.31  1994/10/19  20:00:00  john
18145  * Added bonus points at the end of level based on skill level.
18146  *
18147  * Revision 1.30  1994/10/19  15:14:24  john
18148  * Took % hits out of player structure, made %kills work properly.
18149  *
18150  * Revision 1.29  1994/10/19  12:12:27  john
18151  * Added hour variable.
18152  *
18153  * Revision 1.28  1994/10/17  17:24:48  john
18154  * Added starting_level to player struct.
18155  *
18156  * Revision 1.27  1994/10/13  15:42:02  mike
18157  * Remove afterburner.
18158  *
18159  * Revision 1.26  1994/10/10  17:00:23  mike
18160  * Lower number of players from 10 to 8.
18161  *
18162  * Revision 1.25  1994/10/09  14:53:26  matt
18163  * Made player cockpit state & window size save/restore with saved games & automap
18164  *
18165  * Revision 1.24  1994/10/08  20:24:10  matt
18166  * Added difficulty level to player structure for game load/save
18167  *
18168  * Revision 1.23  1994/10/05  17:39:53  rob
18169  * Changed killer_objnum to a short (was char)
18170  *
18171  * Revision 1.22  1994/10/03  22:59:07  matt
18172  * Limit callsign to 8 chars long, so we can use it as filename
18173  *
18174  * Revision 1.21  1994/09/23  10:14:30  mike
18175  * Rename PLAYER_FLAGS_INVINCIBLE to PLAYER_FLAGS_INVULNERABLE.
18176  * Add INVULNERABLE_TIME_MAX = 30 seconds.
18177  *
18178  * Revision 1.20  1994/09/21  20:44:22  matt
18179  * Player explosion fireball now specified in bitmaps.tbl
18180  *
18181  * Revision 1.19  1994/09/21  12:27:37  mike
18182  * Move CLOAK_TIME_MAX here from game.c
18183  *
18184  * Revision 1.18  1994/09/16  13:10:16  mike
18185  * Add afterburner and cloak stuff.
18186  *
18187  * Revision 1.17  1994/09/11  20:30:26  matt
18188  * Cleaned up thrust vars, changing a few names
18189  *
18190  * Revision 1.16  1994/09/09  14:22:45  matt
18191  * Added extra gun for player
18192  *
18193  * Revision 1.15  1994/09/07  13:30:11  john
18194  * Added code to tell how many packets were lost.
18195  *
18196  * Revision 1.14  1994/09/02  11:56:33  mike
18197  * Alignment on the player struct.
18198  *
18199  * Revision 1.13  1994/08/25  18:12:05  matt
18200  * Made player's weapons and flares fire from the positions on the 3d model.
18201  * Also added support for quad lasers.
18202  *
18203  * Revision 1.12  1994/08/22  15:49:40  mike
18204  * change spelling on num_missles -> num_missiles.
18205  *
18206  * Revision 1.11  1994/08/18  10:47:32  john
18207  * Cleaned up game sequencing and player death stuff
18208  * in preparation for making the player explode into
18209  * pieces when dead.
18210  *
18211  * Revision 1.10  1994/08/17  16:50:05  john
18212  * Added damaging fireballs, missiles.
18213  *
18214  * Revision 1.9  1994/08/15  00:24:10  john
18215  * First version of netgame with players killing
18216  * each other. still buggy...
18217  *
18218  * Revision 1.8  1994/08/12  22:41:26  john
18219  * Took away Player_stats; add Players array.
18220  *
18221  * Revision 1.7  1994/08/09  17:53:25  adam
18222  * *** empty log message ***
18223  *
18224  * Revision 1.6  1994/07/13  00:15:05  matt
18225  * Moved all (or nearly all) of the values that affect player movement to
18226  * bitmaps.tbl
18227  *
18228  * Revision 1.5  1994/07/08  21:44:17  matt
18229  * Made laser powerups saturate correctly
18230  *
18231  * Revision 1.4  1994/07/07  14:59:02  john
18232  * Made radar powerups.
18233  *
18234  *
18235  * Revision 1.3  1994/07/02  13:49:39  matt
18236  * Cleaned up includes
18237  *
18238  * Revision 1.2  1994/07/02  13:10:03  matt
18239  * Moved player stats struct from gameseq.h to player.h
18240  *
18241  * Revision 1.1  1994/07/02  11:00:43  matt
18242  * Initial revision
18243
18244 ------------------------------------------------------------------------
18245 main/playsave.c:
18246
18247  * Revision 1.1  1995/12/05  16:05:47  allender
18248  * Initial revision
18249  *
18250  * Revision 1.10  1995/11/03  12:53:24  allender
18251  * shareware changes
18252  *
18253  * Revision 1.9  1995/10/31  10:19:12  allender
18254  * shareware stuff
18255  *
18256  * Revision 1.8  1995/10/23  14:50:11  allender
18257  * set control type for new player *before* calling kc_set_controls
18258  *
18259  * Revision 1.7  1995/10/21  22:25:31  allender
18260  * *** empty log message ***
18261  *
18262  * Revision 1.6  1995/10/17  15:57:42  allender
18263  * removed line setting wrong COnfig_control_type
18264  *
18265  * Revision 1.5  1995/10/17  13:16:44  allender
18266  * new controller support
18267  *
18268  * Revision 1.4  1995/08/24  16:03:38  allender
18269  * call joystick code when player file uses joystick
18270  *
18271  * Revision 1.3  1995/08/03  15:15:39  allender
18272  * got player save file working (more to go for shareware)
18273  *
18274  * Revision 1.2  1995/08/01  13:57:20  allender
18275  * macified the player file stuff -- in a seperate folder
18276  *
18277  * Revision 1.1  1995/05/16  15:30:00  allender
18278  * Initial revision
18279  *
18280  * Revision 2.3  1995/05/26  16:16:23  john
18281  * Split SATURN into define's for requiring cd, using cd, etc.
18282  * Also started adding all the Rockwell stuff.
18283  *
18284  * Revision 2.2  1995/03/24  17:48:21  john
18285  * Made player files from saturn excrement the highest level for
18286  * normal descent levels.
18287  *
18288  * Revision 2.1  1995/03/21  14:38:49  john
18289  * Ifdef'd out the NETWORK code.
18290  *
18291  * Revision 2.0  1995/02/27  11:27:59  john
18292  * New version 2.0, which has no anonymous unions, builds with
18293  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18294  *
18295  * Revision 1.57  1995/02/13  20:34:55  john
18296  * Lintized
18297  *
18298  * Revision 1.56  1995/02/13  13:23:24  john
18299  * Fixed bug with new player joystick selection.
18300  *
18301  * Revision 1.55  1995/02/13  12:01:19  john
18302  * Fixed bug with joystick throttle still asking for
18303  * calibration with new pilots.
18304  *
18305  * Revision 1.54  1995/02/13  10:29:12  john
18306  * Fixed bug with creating new player not resetting everything to default.
18307  *
18308  * Revision 1.53  1995/02/03  10:58:46  john
18309  * Added code to save shareware style saved games into new format...
18310  * Also, made new player file format not have the saved game array in it.
18311  *
18312  * Revision 1.52  1995/02/02  21:09:28  matt
18313  * Let player start of level 8 if he made it to level 7 in the shareware
18314  *
18315  * Revision 1.51  1995/02/02  18:50:14  john
18316  * Added warning for FCS when new pilot chooses.
18317  *
18318  * Revision 1.50  1995/02/02  11:21:34  john
18319  * Made joystick calibrate when new user selects.
18320  *
18321  * Revision 1.49  1995/02/01  18:06:38  rob
18322  * Put defaults macros into descent.tex
18323  *
18324  * Revision 1.48  1995/01/25  14:37:53  john
18325  * Made joystick only prompt for calibration once...
18326  *
18327  * Revision 1.47  1995/01/24  19:37:12  matt
18328  * Took out incorrect mprintf
18329  *
18330  * Revision 1.46  1995/01/22  18:57:22  matt
18331  * Made player highest level work with missions
18332  *
18333  * Revision 1.45  1995/01/21  16:36:05  matt
18334  * Made starting level system work for now, pending integration with
18335  * mission code.
18336  *
18337  * Revision 1.44  1995/01/20  22:47:32  matt
18338  * Mission system implemented, though imcompletely
18339  *
18340  * Revision 1.43  1995/01/04  14:58:39  rob
18341  * Fixed for shareware build.
18342  *
18343  * Revision 1.42  1995/01/04  11:36:43  rob
18344  * Added compatibility with older shareware pilot files.
18345  *
18346  * Revision 1.41  1995/01/03  11:01:58  rob
18347  * fixed a default macro.
18348  *
18349  * Revision 1.40  1995/01/03  10:44:06  rob
18350  * Added default taunt macros.
18351  *
18352  * Revision 1.39  1994/12/13  10:01:16  allender
18353  * pop up message box when unable to correctly save player file
18354  *
18355  * Revision 1.38  1994/12/12  11:37:14  matt
18356  * Fixed auto leveling defaults & saving
18357  *
18358  * Revision 1.37  1994/12/12  00:26:59  matt
18359  * Added support for no-levelling option
18360  *
18361  * Revision 1.36  1994/12/10  19:09:54  matt
18362  * Added assert for valid player number when loading game
18363  *
18364  * Revision 1.35  1994/12/08  10:53:07  rob
18365  * Fixed a bug in highest_level tracking.
18366  *
18367  * Revision 1.34  1994/12/08  10:01:36  john
18368  * Changed the way the player callsign stuff works.
18369  *
18370  * Revision 1.33  1994/12/07  18:30:38  rob
18371  * Load highest level along with player (used to be only if higher)
18372  * Capped at LAST_LEVEL in case a person loads a registered player in shareware.
18373  *
18374  * Revision 1.32  1994/12/03  16:01:12  matt
18375  * When player file has bad version, force player to choose another
18376  *
18377  * Revision 1.31  1994/12/02  19:54:00  yuan
18378  * Localization.
18379  *
18380  * Revision 1.30  1994/12/02  11:01:36  yuan
18381  * Localization.
18382  *
18383  * Revision 1.29  1994/11/29  03:46:28  john
18384  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
18385  * command line arg.
18386  *
18387  * Revision 1.28  1994/11/29  01:10:23  john
18388  * Took out code that allowed new players to
18389  * configure keyboard.
18390  *
18391  * Revision 1.27  1994/11/25  22:47:10  matt
18392  * Made saved game descriptions longer
18393  *
18394  * Revision 1.26  1994/11/22  12:10:42  rob
18395  * Fixed file handle left open if player file versions don't
18396  * match.
18397  *
18398  * Revision 1.25  1994/11/21  19:35:30  john
18399  * Replaced calls to joy_init with if (joy_present)
18400  *
18401  * Revision 1.24  1994/11/21  17:29:34  matt
18402  * Cleaned up sequencing & game saving for secret levels
18403  *
18404  * Revision 1.23  1994/11/21  11:10:01  john
18405  * Fixed bug with read-only .plr file making the config file
18406  * not update.
18407  *
18408  * Revision 1.22  1994/11/20  19:03:08  john
18409  * Fixed bug with if not having a joystick, default
18410  * player input device is cyberman.
18411  *
18412  * Revision 1.21  1994/11/17  12:24:07  matt
18413  * Made an array the right size, to fix error loading games
18414  *
18415  * Revision 1.20  1994/11/14  17:52:54  allender
18416  * add call to WriteConfigFile when player files gets written
18417  *
18418  * Revision 1.19  1994/11/14  17:19:23  rob
18419  * Removed gamma, joystick calibration, and sound settings from player file.
18420  * Added default difficulty and multi macros.
18421  *
18422  * Revision 1.18  1994/11/07  14:01:23  john
18423  * Changed the gamma correction sequencing.
18424  *
18425  * Revision 1.17  1994/11/05  17:22:49  john
18426  * Fixed lots of sequencing problems with newdemo stuff.
18427  *
18428  * Revision 1.16  1994/11/01  16:40:11  john
18429  * Added Gamma correction.
18430  *
18431  * Revision 1.15  1994/10/24  19:56:50  john
18432  * Made the new user setup prompt for config options.
18433  *
18434  * Revision 1.14  1994/10/24  17:44:21  john
18435  * Added stereo channel reversing.
18436  *
18437  * Revision 1.13  1994/10/24  16:05:12  matt
18438  * Improved handling of player names that are the names of DOS devices
18439  *
18440  * Revision 1.12  1994/10/22  00:08:51  matt
18441  * Fixed up problems with bonus & game sequencing
18442  * Player doesn't get credit for hostages unless he gets them out alive
18443  *
18444  * Revision 1.11  1994/10/19  19:59:57  john
18445  * Added bonus points at the end of level based on skill level.
18446  *
18447  * Revision 1.10  1994/10/19  15:14:34  john
18448  * Took % hits out of player structure, made %kills work properly.
18449  *
18450  * Revision 1.9  1994/10/19  12:44:26  john
18451  * Added hours field to player structure.
18452  *
18453  * Revision 1.8  1994/10/17  17:24:34  john
18454  * Added starting_level to player struct.
18455  *
18456  * Revision 1.7  1994/10/17  13:07:15  john
18457  * Moved the descent.cfg info into the player config file.
18458  *
18459  * Revision 1.6  1994/10/09  14:54:31  matt
18460  * Made player cockpit state & window size save/restore with saved games & automap
18461  *
18462  * Revision 1.5  1994/10/08  23:08:09  matt
18463  * Added error check & handling for game load/save disk io
18464  *
18465  * Revision 1.4  1994/10/05  17:40:54  rob
18466  * Bumped save_file_version to 5 due to change in player.h
18467  *
18468  * Revision 1.3  1994/10/03  23:00:54  matt
18469  * New file version for shorter callsigns
18470  *
18471  * Revision 1.2  1994/09/28  17:25:05  matt
18472  * Added first draft of game save/load system
18473  *
18474  * Revision 1.1  1994/09/27  14:39:12  matt
18475  * Initial revision
18476
18477 ------------------------------------------------------------------------
18478 main/playsave.h:
18479
18480  * Revision 1.1  1995/05/16  16:01:19  allender
18481  * Initial revision
18482  *
18483  * Revision 2.0  1995/02/27  11:31:24  john
18484  * New version 2.0, which has no anonymous unions, builds with
18485  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18486  *
18487  * Revision 1.10  1995/01/22  18:57:04  matt
18488  * Made player highest level work with missions
18489  *
18490  * Revision 1.9  1994/12/12  11:37:15  matt
18491  * Fixed auto leveling defaults & saving
18492  *
18493  * Revision 1.8  1994/12/08  10:01:37  john
18494  * Changed the way the player callsign stuff works.
18495  *
18496  * Revision 1.7  1994/11/25  22:46:56  matt
18497  * Made saved game descriptions longer
18498  *
18499  * Revision 1.6  1994/10/24  20:00:02  john
18500  * Added prototype for read_player_file.
18501  *
18502  * Revision 1.5  1994/10/17  13:07:12  john
18503  * Moved the descent.cfg info into the player config file.
18504  *
18505  * Revision 1.4  1994/10/09  14:54:32  matt
18506  * Made player cockpit state & window size save/restore with saved games & automap
18507  *
18508  * Revision 1.3  1994/10/08  23:08:09  matt
18509  * Added error check & handling for game load/save disk io
18510  *
18511  * Revision 1.2  1994/09/28  17:25:06  matt
18512  * Added first draft of game save/load system
18513  *
18514  * Revision 1.1  1994/09/27  15:47:23  matt
18515  * Initial revision
18516
18517 ------------------------------------------------------------------------
18518 main/polyobj.c:
18519
18520  * Revision 1.3  1995/10/25  14:07:07  allender
18521  * removed load_poly_model function
18522  *
18523  * Revision 1.2  1995/09/14  14:10:20  allender
18524  * two funtions should be void
18525  *
18526  * Revision 1.1  1995/05/16  15:30:08  allender
18527  * Initial revision
18528  *
18529  * Revision 2.1  1995/05/26  16:10:37  john
18530  * Support for new 4-byte align v8 pof files.
18531  *
18532  * Revision 2.0  1995/02/27  11:32:44  john
18533  * New version 2.0, which has no anonymous unions, builds with
18534  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18535  *
18536  * Revision 1.64  1995/01/14  19:16:43  john
18537  * First version of new bitmap paging code.
18538  *
18539  * Revision 1.63  1994/12/14  18:06:54  matt
18540  * Removed compile warnings
18541  *
18542  * Revision 1.62  1994/12/09  17:54:31  john
18543  * Made the CFILE's close right after reading in data.
18544  *
18545  * Revision 1.61  1994/12/09  16:13:28  mike
18546  * speedup pof file reading, but still horribly slow using hog file...problem somewhere else.
18547  *
18548  * Revision 1.60  1994/12/08  17:41:20  yuan
18549  * Cfiling stuff.
18550  *
18551  * Revision 1.59  1994/11/21  11:02:19  matt
18552  * Added error checking
18553  *
18554  * Revision 1.58  1994/11/14  11:32:49  matt
18555  * Allow switching to simpler models even when alt_textures specified
18556  *
18557  * Revision 1.57  1994/11/13  21:15:24  matt
18558  * Added basic support for more than one level of detail simplification
18559  *
18560  * Revision 1.56  1994/11/11  19:29:25  matt
18561  * Added code to show low detail polygon models
18562  *
18563  * Revision 1.55  1994/11/10  14:02:57  matt
18564  * Hacked in support for player ships with different textures
18565  *
18566  * Revision 1.54  1994/11/03  11:01:59  matt
18567  * Made robot pics lighted
18568  *
18569  * Revision 1.53  1994/11/02  16:18:34  matt
18570  * Moved draw_model_picture() out of editor
18571  *
18572  * Revision 1.52  1994/10/18  14:38:11  matt
18573  * Restored assert now that bug is fixed
18574  *
18575  * Revision 1.51  1994/10/17  21:35:03  matt
18576  * Added support for new Control Center/Main Reactor
18577  *
18578  * Revision 1.50  1994/10/14  17:46:23  yuan
18579  * Made the soft Int3 only work in net mode.
18580  *
18581  * Revision 1.49  1994/10/14  17:43:47  yuan
18582  * Added soft int3's instead of Asserts  for some common network bugs.
18583  *
18584  * Revision 1.48  1994/10/14  17:09:04  yuan
18585  * Made Assert on line 610 be if in an attempt
18586  * to bypass.
18587  *
18588  * Revision 1.47  1994/09/09  14:23:42  matt
18589  * Added glow code to polygon models for engine glow
18590  *
18591  * Revision 1.46  1994/08/26  18:03:30  matt
18592  * Added code to remap polygon model numbers by matching filenames
18593  *
18594  * Revision 1.45  1994/08/26  15:35:58  matt
18595  * Made eclips usable on more than one object at a time
18596  *
18597  * Revision 1.44  1994/08/25  18:11:58  matt
18598  * Made player's weapons and flares fire from the positions on the 3d model.
18599  * Also added support for quad lasers.
18600  *
18601  * Revision 1.43  1994/07/25  00:14:18  matt
18602  * Made a couple of minor changes for the drivethrough
18603  *
18604  * Revision 1.42  1994/07/25  00:02:41  matt
18605  * Various changes to accomodate new 3d, which no longer takes point numbers
18606  * as parms, and now only takes pointers to points.
18607
18608 ------------------------------------------------------------------------
18609 main/polyobj.h:
18610
18611  * Revision 1.2  1995/09/14  14:10:30  allender
18612  * two functions should be void
18613  *
18614  * Revision 1.1  1995/05/16  16:01:27  allender
18615  * Initial revision
18616  *
18617  * Revision 2.1  1995/02/27  18:21:54  john
18618  * Added extern for robot_points.
18619  *
18620  * Revision 2.0  1995/02/27  11:29:58  john
18621  * New version 2.0, which has no anonymous unions, builds with
18622  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18623  *
18624  * Revision 1.28  1995/01/12  12:10:16  adam
18625  * *** empty log message ***
18626  *
18627  * Revision 1.27  1994/11/11  19:28:58  matt
18628  * Added code to show low detail polygon models
18629  *
18630  * Revision 1.26  1994/11/10  14:03:05  matt
18631  * Hacked in support for player ships with different textures
18632  *
18633  * Revision 1.25  1994/11/02  16:18:24  matt
18634  * Moved draw_model_picture() out of editor
18635  *
18636  * Revision 1.24  1994/10/18  10:55:57  adam
18637  * bumped MAX_POLYGON_OBJECTS up
18638  *
18639  * Revision 1.23  1994/10/17  21:35:01  matt
18640  * Added support for new Control Center/Main Reactor
18641  *
18642  * Revision 1.22  1994/09/09  14:23:42  matt
18643  * Added glow code to polygon models for engine glow
18644  *
18645  * Revision 1.21  1994/08/26  18:03:43  matt
18646  * Added code to remap polygon model numbers by matching filenames
18647  *
18648  * Revision 1.20  1994/08/26  15:36:00  matt
18649  * Made eclips usable on more than one object at a time
18650  *
18651  * Revision 1.19  1994/07/22  20:44:23  matt
18652  * Killed unused fields in polygon model structure
18653  *
18654  * Revision 1.18  1994/06/16  17:52:11  matt
18655  * Made submodels rotate around their centers, not their pivot points
18656  *
18657  * Revision 1.17  1994/06/14  12:22:05  matt
18658  * Integrated with drive code, using #defines to switch versions
18659  *
18660  * Revision 1.16  1994/06/09  16:25:01  matt
18661  * Fixed confusion with two constants, MAX_SUBOBJS & MAX_SUBMODELS, which
18662  * were used for the same things, but had different values.
18663  *
18664  * Revision 1.15  1994/06/08  10:56:38  matt
18665  * Improved debris: now get submodel size from new POF files; debris now has
18666  * limited life; debris can now be blown up.
18667  *
18668  * Revision 1.14  1994/06/07  16:51:57  matt
18669  * Made object lighting work correctly; changed name of Ambient_light to
18670  * Dynamic_light; cleaned up polygobj object rendering a little.
18671  *
18672  * Revision 1.13  1994/05/26  21:08:59  matt
18673  * Moved robot stuff out of polygon model and into robot_info struct
18674  * Made new file, robot.c, to deal with robots
18675  *
18676  * Revision 1.12  1994/05/18  19:35:05  matt
18677  * Added fields for the rest of the subobj data
18678  *
18679  * Revision 1.11  1994/05/16  16:17:13  john
18680  * Bunch of stuff on my Inferno Task list May16-23
18681  *
18682  * Revision 1.10  1994/05/13  11:08:31  matt
18683  * Added support for multiple gun positions on polygon models
18684  *
18685  * Revision 1.9  1994/04/29  09:18:04  matt
18686  * Added support for multiple-piece explosions
18687  *
18688  * Revision 1.8  1994/04/28  18:44:18  matt
18689  * Took out code for old-style (non-interpreted) objects.
18690  *
18691  * Revision 1.7  1994/03/25  16:54:38  matt
18692  * draw_polygon_object() now takes pointer to animation data
18693  *
18694  * Revision 1.6  1994/03/15  17:44:33  matt
18695  * Changed a bunch of names
18696  *
18697  * Revision 1.5  1994/03/07  20:02:29  matt
18698  * Added pointer to normals in polyobj struct
18699  * Added prototype for draw_polygon_object()
18700  *
18701  * Revision 1.4  1994/03/01  17:16:19  matt
18702  * Lots of changes to support loadable binary ".pof" robot files
18703  *
18704  * Revision 1.3  1994/01/31  15:51:20  matt
18705  * Added ptr for rgb table for robot colors
18706  *
18707  * Revision 1.2  1994/01/28  13:52:01  matt
18708  * Added flesh to this previously skeletal file.
18709  *
18710  * Revision 1.1  1994/01/28  13:47:42  matt
18711  * Initial revision
18712
18713 ------------------------------------------------------------------------
18714 main/powerup.c:
18715
18716  * Revision 1.2  1995/10/31  10:18:55  allender
18717  * shareware stuff
18718  *
18719  * Revision 1.1  1995/05/16  15:30:16  allender
18720  * Initial revision
18721  *
18722  * Revision 2.2  1995/03/24  13:50:36  john
18723  * Added mega-wowie zowie to release.
18724  *
18725  * Revision 2.1  1995/03/21  14:38:39  john
18726  * Ifdef'd out the NETWORK code.
18727  *
18728  * Revision 2.0  1995/02/27  11:27:15  john
18729  * New version 2.0, which has no anonymous unions, builds with
18730  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18731  *
18732  * Revision 1.94  1995/02/22  13:46:03  allender
18733  * remove anonymous unions from object structure
18734  *
18735  * Revision 1.93  1995/02/06  15:52:51  mike
18736  * add mini megawow powerup for giving reasonable weapons.
18737  *
18738  * Revision 1.92  1995/01/23  22:49:59  mike
18739  * drop energy instead of primary weapon if you have primary weapon
18740  * (drop nothing if want to drop vulcan ammo and you are maxed out)
18741  * if you have primary weapon and primary weapon there, get energy instead.
18742  *
18743  * Revision 1.91  1995/01/19  09:42:22  allender
18744  * record laser levels for demos
18745  *
18746  * Revision 1.90  1994/12/31  12:28:01  rob
18747  * Added sound for coop key grabs.
18748  *
18749  * Revision 1.89  1994/12/19  19:55:17  rob
18750  * Fixing key semantics for coop game.
18751  *
18752  * Revision 1.88  1994/12/07  12:55:21  mike
18753  * tweak vulcan amounts.
18754  *
18755  * Revision 1.87  1994/12/06  13:55:36  matt
18756  * Made shield & energy powerup messages round to match HUD message
18757  *
18758  * Revision 1.86  1994/12/03  19:03:57  matt
18759  * Fixed vulcan ammo HUD message
18760  *
18761  * Revision 1.85  1994/11/29  11:35:41  rob
18762  * Added sound casting for grabbing powerups.
18763  *
18764  * Revision 1.84  1994/11/28  11:26:38  matt
18765  * Cleaned up hud message printing for picking up weapons
18766  *
18767  * Revision 1.83  1994/11/27  23:14:01  matt
18768  * Made changes for new mprintf calling convention
18769  *
18770  * Revision 1.82  1994/11/21  16:02:51  mike
18771  * comment out unused powerups.
18772  *
18773  * Revision 1.81  1994/11/20  18:25:47  john
18774  * Fixed some #ifndef RELEASE inconsistancies.
18775  *
18776  * Revision 1.80  1994/11/19  23:54:13  mike
18777  * limit megawowiezowie to shareware powerups if in shareware version.
18778  *
18779  * Revision 1.79  1994/11/14  16:06:16  yuan
18780  * Made cloak and invulnerability only picked up once.
18781  *
18782  * Revision 1.78  1994/11/07  17:41:06  mike
18783  * messages for when you're fully stocked with missiles.
18784  *
18785  * Revision 1.77  1994/10/28  14:42:50  john
18786  * Added sound volumes to all sound calls.
18787  *
18788  * Revision 1.76  1994/10/26  15:55:23  yuan
18789  * Made vulcan cannon give 100 ammo if it has less than that.
18790  *
18791  * Revision 1.75  1994/10/26  15:54:57  yuan
18792  * *** empty log message ***
18793  *
18794  * Revision 1.74  1994/10/25  14:31:25  allender
18795  * Fixed bug where getting cloak powerup while cloaked resulted in
18796  * player being cloaked forever.
18797  *
18798  * Revision 1.73  1994/10/25  10:51:21  matt
18799  * Vulcan cannon powerups now contain ammo count
18800  *
18801  * Revision 1.72  1994/10/21  20:41:32  mike
18802  * Fix silly backwards (- instead of +) bug in invulnerability powerup.
18803  *
18804  * Revision 1.71  1994/10/20  09:49:23  mike
18805  * Fix up powerups in some way.
18806  *
18807  * Revision 1.70  1994/10/19  11:16:25  mike
18808  * Limit amount of each type of ammo player can hold.
18809  *
18810  * Revision 1.69  1994/10/17  14:12:11  matt
18811  * Added sound for powerup disappearance effect
18812  *
18813  * Revision 1.68  1994/10/17  14:07:04  mike
18814  * Make shields and energy max out at 200.
18815  *
18816  * Revision 1.67  1994/10/16  12:43:37  mike
18817  * Don't allow you to pick up a primary weapon, or invulnerability, you already have.
18818  * Make cloak time additive.
18819  *
18820  * Revision 1.66  1994/10/15  19:05:30  mike
18821  * Define constants for vulcan ammo amounts.
18822  *
18823  * Revision 1.65  1994/10/14  15:57:28  mike
18824  * When you pick up a laser boost or quad_laser powerup, update weapon display.
18825  *
18826  * Revision 1.64  1994/10/13  10:57:51  adam
18827  * fiddled with powerup disappearance
18828  *
18829  * Revision 1.63  1994/10/12  13:07:33  mike
18830  * Make powerup play vclip when it goes away.
18831  *
18832  * Revision 1.62  1994/10/12  08:04:42  mike
18833  * Make proximity powerup worth 4 bombs.
18834  *
18835  * Revision 1.61  1994/10/08  23:37:33  matt
18836  * Don't pick up weapons you already have; also fixed auto_select bug
18837  * for seconary weapons
18838  *
18839  * Revision 1.60  1994/10/08  15:41:00  mike
18840  * Diminish palette effect due to powerups.
18841  *
18842  * Revision 1.59  1994/10/07  23:37:45  matt
18843  * Made weapons select when pick up better one
18844  *
18845  * Revision 1.58  1994/10/07  22:09:20  rob
18846  * Added network hook for grabbing the cloaking device.
18847
18848 ------------------------------------------------------------------------
18849 main/powerup.h:
18850
18851  * Revision 1.1  1995/05/16  16:01:35  allender
18852  * Initial revision
18853  *
18854  * Revision 2.0  1995/02/27  11:27:35  john
18855  * New version 2.0, which has no anonymous unions, builds with
18856  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18857  *
18858  * Revision 1.34  1995/02/06  15:52:37  mike
18859  * add mini megawow powerup for giving reasonable weapons.
18860  *
18861  * Revision 1.33  1995/01/30  17:14:11  mike
18862  * halve rate of vulcan ammo consumption.
18863  *
18864  * Revision 1.32  1995/01/15  20:47:56  mike
18865  * add lighting field to powerups.
18866  *
18867  * Revision 1.31  1994/12/12  21:39:58  matt
18868  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
18869  *
18870  * Revision 1.30  1994/12/07  12:55:26  mike
18871  * tweak vulcan amounts.
18872  *
18873  * Revision 1.29  1994/12/02  20:06:46  matt
18874  * Made vulcan ammo print at approx 25 times actual
18875  *
18876  * Revision 1.28  1994/10/26  15:56:27  yuan
18877  * Made vulcan cannon give 100 ammo if it has less than that.
18878  *
18879  * Revision 1.27  1994/10/15  19:07:10  mike
18880  * Define constants for amount of vulcan ammo per powerup.
18881  *
18882  * Revision 1.26  1994/09/26  13:29:38  matt
18883  * Added extra life each 100,000 points, and show icons on HUD for num lives
18884  *
18885  * Revision 1.25  1994/09/22  19:00:25  mike
18886  * Kill constants ENERGY_BOOST and SHIELD_BOOST: it's now difficulty level dependent.
18887  *
18888  * Revision 1.24  1994/09/20  19:46:11  mike
18889  * Fix powerup number assignments.
18890  *
18891  * Revision 1.23  1994/09/02  11:53:34  mike
18892  * Add the megawow powerup.  If you don't know about it, that's because it's a secret.
18893  *
18894  * Revision 1.22  1994/09/01  10:41:35  matt
18895  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
18896  * correctly if width & height of bitmap are different.
18897  *
18898  * Revision 1.21  1994/08/31  19:26:14  mike
18899  * Start adding new pile of powerups.
18900  *
18901  * Revision 1.20  1994/08/25  17:56:08  matt
18902  * Added quad laser powerup
18903  *
18904  * Revision 1.19  1994/08/18  15:11:50  mike
18905  * missile powerups.
18906  *
18907  * Revision 1.18  1994/08/09  17:54:33  adam
18908  * upped no. of powerup types
18909  *
18910  * Revision 1.17  1994/08/09  17:53:39  adam
18911  * *** empty log message ***
18912  *
18913  * Revision 1.16  1994/07/27  19:44:16  mike
18914  * Objects containing objects.
18915  *
18916  * Revision 1.15  1994/07/26  18:31:32  mike
18917  * Move some constants here from eobject.c.
18918  *
18919  * Revision 1.14  1994/07/20  17:35:03  yuan
18920  * Some minor bug fixes and new key gauges...
18921  *
18922  * Revision 1.13  1994/07/12  15:53:23  john
18923  * *** empty log message ***
18924  *
18925  * Revision 1.12  1994/07/12  15:30:47  mike
18926  * Prototype diminish_towards_max.
18927  *
18928  * Revision 1.11  1994/07/07  14:59:04  john
18929  * Made radar powerups.
18930  *
18931  *
18932  * Revision 1.10  1994/07/01  16:35:40  yuan
18933  * Added key system
18934  *
18935  * Revision 1.9  1994/06/29  19:43:33  matt
18936  * Made powerup animation not happen in render routine
18937  *
18938  * Revision 1.8  1994/06/21  18:54:03  matt
18939  * Added support for powerups that don't get picked up if not needed, but this
18940  * feature is commented out at the end of do_powerup(), since the physics gave
18941  * me all sorts of problems, with the player getting stuck on a powerup.
18942  *
18943  * Revision 1.7  1994/06/08  18:16:32  john
18944  * Bunch of new stuff that basically takes constants out of the code
18945  * and puts them into bitmaps.tbl.
18946  *
18947  * Revision 1.6  1994/05/18  13:26:30  yuan
18948  * *** empty log message ***
18949  *
18950  * Revision 1.5  1994/05/17  17:01:48  yuan
18951  * Added constant for boosts.
18952  *
18953  * Revision 1.4  1994/04/06  14:42:50  yuan
18954  * Adding new powerups.
18955  *
18956  * Revision 1.3  1994/04/01  14:36:59  yuan
18957  * John's head is an extra life...
18958  *
18959  * Revision 1.2  1994/04/01  11:15:22  yuan
18960  * Added multiple bitmap functionality to all objects...
18961  * (hostages, powerups, lasers, etc.)
18962  * Hostages and powerups are implemented in the object system,
18963  * just need to finish function call to "affect" player.
18964  *
18965  * Revision 1.1  1994/03/31  17:01:43  yuan
18966  * Initial revision
18967
18968 ------------------------------------------------------------------------
18969 main/render.c:
18970
18971  * Revision 1.9  1995/11/20  17:17:48  allender
18972  * *** empty log message ***
18973  *
18974  * Revision 1.8  1995/10/26  14:08:35  allender
18975  * added assigment for physics optimization
18976  *
18977  * Revision 1.7  1995/09/22  14:28:46  allender
18978  * changed render_zoom to make game match PC aspect
18979  *
18980  * Revision 1.6  1995/08/14  14:35:54  allender
18981  * change transparency to 0
18982  *
18983  * Revision 1.5  1995/08/12  11:32:02  allender
18984  * removed #ifdef NEWDEMO -- always in
18985  *
18986  * Revision 1.4  1995/07/05  16:48:31  allender
18987  * kitchen stuff
18988  *
18989  * Revision 1.3  1995/06/23  10:22:54  allender
18990  * fix outline mode
18991  *
18992  * Revision 1.2  1995/06/16  16:11:18  allender
18993  * changed sort func to accept const parameters
18994  *
18995  * Revision 1.1  1995/05/16  15:30:24  allender
18996  * Initial revision
18997  *
18998  * Revision 2.5  1995/12/19  15:31:36  john
18999  * Made stereo mode only record 1 eye in demo.
19000  *
19001  * Revision 2.4  1995/03/20  18:15:53  john
19002  * Added code to not store the normals in the segment structure.
19003  *
19004  * Revision 2.3  1995/03/13  16:11:05  john
19005  * Maybe fixed bug that lighting didn't work with vr helmets.
19006  *
19007  * Revision 2.2  1995/03/09  15:33:49  john
19008  * Fixed bug with iglasses timeout too long, and objects
19009  * disappearing from left eye.
19010  *
19011  * Revision 2.1  1995/03/06  15:23:59  john
19012  * New screen techniques.
19013  *
19014  * Revision 2.0  1995/02/27  11:31:01  john
19015  * New version 2.0, which has no anonymous unions, builds with
19016  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19017  *
19018  * Revision 1.252  1995/02/22  13:49:38  allender
19019  * remove anonymous unions from object structure
19020  *
19021  * Revision 1.251  1995/02/11  15:07:26  matt
19022  * Took out code which was mostly intended as part of a larger renderer
19023  * change which never happened.  This new code was causing problems with
19024  * the level 4 control center.
19025  *
19026  * Revision 1.250  1995/02/07  16:28:53  matt
19027  * Fixed problem with new code
19028  *
19029  * Revision 1.249  1995/02/06  14:38:58  matt
19030  * Took out some code that didn't compile when editor in
19031  *
19032  * Revision 1.248  1995/02/06  13:45:25  matt
19033  * Structural changes, plus small sorting improvements
19034  *
19035  * Revision 1.247  1995/02/02  15:59:26  matt
19036  * Changed assert to int3.
19037  *
19038  * Revision 1.246  1995/02/01  21:02:27  matt
19039  * Added partial fix for rendering bugs
19040  * Ripped out laser hack system
19041  *
19042  * Revision 1.245  1995/01/20  15:14:30  matt
19043  * Added parens to fix precedence bug
19044  *
19045  * Revision 1.244  1995/01/14  19:16:59  john
19046  * First version of new bitmap paging code.
19047  *
19048  * Revision 1.243  1995/01/03  20:19:25  john
19049  * Pretty good working version of game save.
19050  *
19051  * Revision 1.242  1994/12/29  13:51:05  john
19052  * Made the floating reticle draw in the spot
19053  * regardless of the eye offset.
19054  *
19055  * Revision 1.241  1994/12/23  15:02:55  john
19056  * Tweaked floating reticle.
19057  *
19058  * Revision 1.240  1994/12/23  14:27:45  john
19059  * Changed offset of floating reticle to line up with
19060  * lasers a bit better.
19061  *
19062  * Revision 1.239  1994/12/23  14:22:50  john
19063  * Added floating reticle for VR helments.
19064  *
19065  * Revision 1.238  1994/12/13  14:07:50  matt
19066  * Fixed tmap_num2 bug in search mode
19067  *
19068  * Revision 1.237  1994/12/11  00:45:53  matt
19069  * Fixed problem when object sort buffer got full
19070  *
19071  * Revision 1.236  1994/12/09  18:46:06  matt
19072  * Added a little debugging
19073  *
19074  * Revision 1.235  1994/12/09  14:59:16  matt
19075  * Added system to attach a fireball to another object for rendering purposes,
19076  * so the fireball always renders on top of (after) the object.
19077  *
19078  * Revision 1.234  1994/12/08  15:46:54  matt
19079  * Fixed buffer overflow that caused seg depth screwup
19080  *
19081  * Revision 1.233  1994/12/08  11:51:53  matt
19082  * Took out some unused stuff
19083  *
19084  * Revision 1.232  1994/12/06  16:31:48  mike
19085  * fix detriangulation problems.
19086  *
19087  * Revision 1.231  1994/12/05  15:32:51  matt
19088  * Changed an assert to an int3 & return
19089  *
19090  * Revision 1.230  1994/12/04  17:28:04  matt
19091  * Got rid of unused no_render_flag array, and took out box clear when searching
19092  *
19093  * Revision 1.229  1994/12/04  15:51:14  matt
19094  * Fixed linear tmap transition for objects
19095  *
19096  * Revision 1.228  1994/12/03  20:16:50  matt
19097  * Turn off window clip for objects
19098  *
19099  * Revision 1.227  1994/12/03  14:48:00  matt
19100  * Restored some default settings
19101  *
19102  * Revision 1.226  1994/12/03  14:44:32  matt
19103  * Fixed another difficult bug in the window clip system
19104  *
19105  * Revision 1.225  1994/12/02  13:19:56  matt
19106  * Fixed rect clears at terminus of rendering
19107  * Made a bunch of debug code compile out
19108  *
19109  * Revision 1.224  1994/12/02  11:58:21  matt
19110  * Fixed window clip bug
19111  *
19112  * Revision 1.223  1994/11/28  21:50:42  mike
19113  * optimizations.
19114  *
19115  * Revision 1.222  1994/11/28  01:32:15  mike
19116  * turn off window clearing.
19117  *
19118  * Revision 1.221  1994/11/27  23:11:52  matt
19119  * Made changes for new mprintf calling convention
19120  *
19121  * Revision 1.220  1994/11/20  15:58:55  matt
19122  * Don't migrate the control center, since it doesn't move out of its segment
19123  *
19124  * Revision 1.219  1994/11/19  23:54:36  mike
19125  * change window colors.
19126  *
19127  * Revision 1.218  1994/11/19  15:20:25  mike
19128  * rip out unused code and data
19129  *
19130  * Revision 1.217  1994/11/18  13:21:24  mike
19131  * Clear only view portals into rest of world based on value of Clear_window.
19132  *
19133  * Revision 1.216  1994/11/15  17:02:10  matt
19134  * Re-added accidentally deleted variable
19135  *
19136  * Revision 1.215  1994/11/15  16:51:50  matt
19137  * Made rear view only switch to rear cockpit if cockpit on in front view
19138  *
19139  * Revision 1.214  1994/11/14  20:47:57  john
19140  * Attempted to strip out all the code in the game
19141  * directory that uses any ui code.
19142  *
19143  * Revision 1.213  1994/11/11  15:37:07  mike
19144  * write orange for background to show render bugs.
19145  *
19146  * Revision 1.212  1994/11/09  22:57:18  matt
19147  * Keep tract of depth of segments rendered, for detail level optimization
19148  *
19149  * Revision 1.211  1994/11/01  23:40:14  matt
19150  * Elegantly handler buffer getting full
19151  *
19152  * Revision 1.210  1994/10/31  22:28:13  mike
19153  * Fix detriangulation bug.
19154  *
19155  * Revision 1.209  1994/10/31  11:48:56  mike
19156  * Optimize detriangulation, speedup of about 4% in many cases, 0% in many.
19157  *
19158  * Revision 1.208  1994/10/30  20:08:34  matt
19159  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
19160  * go out; made more explosions on walls.
19161  *
19162  * Revision 1.207  1994/10/27  14:14:35  matt
19163  * Don't do light flash during endlevel sequence
19164  *
19165  * Revision 1.206  1994/10/11  12:05:42  mike
19166  * Improve detriangulation.
19167  *
19168  * Revision 1.205  1994/10/07  15:27:00  john
19169  * Commented out the code that moves your eye
19170  * forward.
19171  *
19172  * Revision 1.204  1994/10/05  16:07:38  mike
19173  * Don't detriangulate sides if in player's segment.  Prevents player going behind a wall,
19174  * though there are cases in which it would be ok to detriangulate these.
19175  *
19176  * Revision 1.203  1994/10/03  12:44:05  matt
19177  * Took out unreferenced code
19178  *
19179  * Revision 1.202  1994/09/28  14:08:45  john
19180  * Added Zoom stuff back in, but ifdef'd it out.
19181  *
19182  * Revision 1.201  1994/09/25  23:41:49  matt
19183  * Changed the object load & save code to read/write the structure fields one
19184  * at a time (rather than the whole structure at once).  This mean that the
19185  * object structure can be changed without breaking the load/save functions.
19186  * As a result of this change, the local_object data can be and has been
19187  * incorporated into the object array.  Also, timeleft is now a property
19188  * of all objects, and the object structure has been otherwise cleaned up.
19189  *
19190  * Revision 1.200  1994/09/25  15:50:10  mike
19191  * Integrate my debug changes which shows how many textures were rendered
19192  * this frame.
19193  *
19194  * Revision 1.199  1994/09/25  15:45:22  matt
19195  * Added OBJ_LIGHT, a type of object that casts light
19196  * Added generalized lifeleft, and moved it to local_object
19197  *
19198  * Revision 1.198  1994/09/15  21:23:32  matt
19199  * Changed system to keep track of whether & what cockpit is up
19200  *
19201  * Revision 1.197  1994/09/15  16:30:12  mike
19202  * Comment out call to object_render_targets, which did nothing.
19203  *
19204  * Revision 1.196  1994/09/07  22:25:51  matt
19205  * Don't migrate through semi-transparent walls
19206  *
19207  * Revision 1.195  1994/09/07  19:16:21  mike
19208  * Homing missile.
19209  *
19210  * Revision 1.194  1994/08/31  20:54:17  matt
19211  * Don't do flash effect while whiting out
19212  *
19213  * Revision 1.193  1994/08/23  17:20:12  john
19214  * Added rear-view cockpit.
19215  *
19216  * Revision 1.192  1994/08/22  14:36:35  john
19217  * Made R key make a "reverse" view render.
19218  *
19219  * Revision 1.191  1994/08/19  20:09:26  matt
19220  * Added end-of-level cut scene with external scene
19221  *
19222  * Revision 1.190  1994/08/10  19:56:17  john
19223  * Changed font stuff; Took out old menu; messed up lots of
19224  * other stuff like game sequencing messages, etc.
19225  *
19226  * Revision 1.189  1994/08/10  14:45:05  john
19227  * *** empty log message ***
19228  *
19229  * Revision 1.188  1994/08/09  16:04:06  john
19230  * Added network players to editor.
19231  *
19232  * Revision 1.187  1994/08/05  17:07:05  john
19233  * Made lasers be two objects, one drawing after the other
19234  * all the time.
19235  *
19236  * Revision 1.186  1994/08/05  10:07:57  matt
19237  * Disable window check checking (i.e., always use window check)
19238  *
19239  * Revision 1.185  1994/08/04  19:11:30  matt
19240  * Changed a bunch of vecmat calls to use multiple-function routines, and to
19241  * allow the use of C macros for some functions
19242  *
19243  * Revision 1.184  1994/08/04  00:21:14  matt
19244  * Cleaned up fvi & physics error handling; put in code to make sure objects
19245  * are in correct segment; simplified segment finding for objects and points
19246  *
19247  * Revision 1.183  1994/08/02  19:04:28  matt
19248  * Cleaned up vertex list functions
19249  *
19250  * Revision 1.182  1994/07/29  15:13:33  matt
19251  * When window check turned off, cut render depth in half
19252  *
19253  * Revision 1.181  1994/07/29  11:03:50  matt
19254  * Use highest_segment_index instead of num_segments so render works from
19255  * the editor
19256  *
19257  * Revision 1.180  1994/07/29  10:04:34  mike
19258  * Update Cursegp when an object is selected.
19259  *
19260  * Revision 1.179  1994/07/25  00:02:50  matt
19261  * Various changes to accomodate new 3d, which no longer takes point numbers
19262  * as parms, and now only takes pointers to points.
19263  *
19264  * Revision 1.178  1994/07/24  14:37:49  matt
19265  * Added angles for player head
19266  *
19267  * Revision 1.177  1994/07/20  19:08:07  matt
19268  * If in editor, don't move eye from center of viewer object
19269
19270 ------------------------------------------------------------------------
19271 main/render.h:
19272
19273  * Revision 1.1  1995/05/16  16:01:51  allender
19274  * Initial revision
19275  *
19276  * Revision 2.0  1995/02/27  11:33:00  john
19277  * New version 2.0, which has no anonymous unions, builds with
19278  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19279  *
19280  * Revision 1.17  1994/11/30  12:33:33  mike
19281  * prototype Clear_window.
19282  *
19283  * Revision 1.16  1994/11/02  16:19:52  matt
19284  * Increased size of extra object buffer
19285  *
19286  * Revision 1.15  1994/07/25  00:02:49  matt
19287  * Various changes to accomodate new 3d, which no longer takes point numbers
19288  * as parms, and now only takes pointers to points.
19289  *
19290  * Revision 1.14  1994/07/24  14:37:42  matt
19291  * Added angles for player head
19292  *
19293  * Revision 1.13  1994/06/24  17:01:34  john
19294  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
19295  * took it out of game.c and into gameseq.c
19296  *
19297  * Revision 1.12  1994/06/16  10:55:57  matt
19298  * Made a bunch of test code dependent on #defines
19299  *
19300  * Revision 1.11  1994/06/01  00:01:36  matt
19301  * Added mine destruction flashing effect
19302  *
19303  * Revision 1.10  1994/05/22  18:47:36  mike
19304  * make Render_list a globally accessible variable.
19305  *
19306  * Revision 1.9  1994/05/22  15:29:32  mike
19307  * Separation of lighting from render.c to lighting.c.
19308  *
19309  * Revision 1.8  1994/05/14  17:59:39  matt
19310  * Added extern.
19311  *
19312  * Revision 1.7  1994/05/14  17:15:17  matt
19313  * Got rid of externs in source (non-header) files
19314  *
19315  * Revision 1.6  1994/02/17  11:32:41  matt
19316  * Changes in object system
19317  *
19318  * Revision 1.5  1994/01/21  17:31:48  matt
19319  * Moved code from render_frame() to caller, making code cleaner
19320  *
19321  * Revision 1.4  1994/01/06  09:46:12  john
19322  * Added removable walls... all code that checked for
19323  * children to see if a wall was a doorway, i changed
19324  * to yuan's wall_is_doorway function that is in wall.c...
19325  * doesn't work yet.
19326  *
19327  * Revision 1.3  1994/01/05  11:25:47  john
19328  * Changed Player_zoom to Render_zoom
19329  *
19330  * Revision 1.2  1994/01/05  10:53:43  john
19331  * New object code by John.
19332  *
19333  * Revision 1.1  1993/11/04  14:01:43  matt
19334  * Initial revision
19335
19336 ------------------------------------------------------------------------
19337 main/robot.c:
19338
19339  * Revision 1.1  1995/05/16  15:30:34  allender
19340  * Initial revision
19341  *
19342  * Revision 2.1  1995/03/07  16:52:02  john
19343  * Fixed robots not moving without edtiro bug.
19344  *
19345  * Revision 2.0  1995/02/27  11:31:11  john
19346  * New version 2.0, which has no anonymous unions, builds with
19347  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19348  *
19349  * Revision 1.19  1995/02/22  13:58:09  allender
19350  * remove anonymous unions from object structure
19351  *
19352  * Revision 1.18  1995/01/27  11:17:06  rob
19353  * Avoid problems with illegal gun num.
19354  *
19355  * Revision 1.17  1994/11/19  15:15:02  mike
19356  * remove unused code and data
19357  *
19358  * Revision 1.16  1994/11/05  16:41:31  adam
19359  * upped MAX_ROBOT_JOINTS
19360  *
19361  * Revision 1.15  1994/09/26  15:29:29  matt
19362  * Allow morphing objects to fire
19363  *
19364  * Revision 1.14  1994/06/20  14:31:02  matt
19365  * Don't include joint zero in animation data
19366  *
19367  * Revision 1.13  1994/06/10  14:39:58  matt
19368  * Increased limit of robot joints
19369  *
19370  * Revision 1.12  1994/06/10  10:59:18  matt
19371  * Do error checking on list of angles
19372  *
19373  * Revision 1.11  1994/06/09  16:21:32  matt
19374  * Took out special-case and test code.
19375  *
19376  * Revision 1.10  1994/06/07  13:21:14  matt
19377  * Added support for new chunk-based POF files, with robot animation data.
19378  *
19379  * Revision 1.9  1994/06/01  17:58:24  mike
19380  * Greater flinch effect.
19381  *
19382  * Revision 1.8  1994/06/01  14:59:25  matt
19383  * Fixed calc_gun_position(), which was rotating the wrong way for the
19384  * object orientation.
19385  *
19386  * Revision 1.7  1994/06/01  12:44:04  matt
19387  * Added flinch state for test robot
19388  *
19389  * Revision 1.6  1994/05/31  19:17:24  matt
19390  * Fixed test robot angles
19391  *
19392  * Revision 1.5  1994/05/30  19:43:50  mike
19393  * Call set_test_robot.
19394  *
19395  *
19396  * Revision 1.4  1994/05/30  00:02:44  matt
19397  * Got rid of robot render type, and generally cleaned up polygon model
19398  * render objects.
19399  *
19400  * Revision 1.3  1994/05/29  18:46:15  matt
19401  * Added stuff for getting robot animation info for different states
19402  *
19403  * Revision 1.2  1994/05/26  21:09:15  matt
19404  * Moved robot stuff out of polygon model and into robot_info struct
19405  * Made new file, robot.c, to deal with robots
19406  *
19407  * Revision 1.1  1994/05/26  18:02:04  matt
19408  * Initial revision
19409
19410 ------------------------------------------------------------------------
19411 main/robot.h:
19412
19413  * Revision 1.1  1995/05/16  16:01:59  allender
19414  * Initial revision
19415  *
19416  * Revision 2.1  1995/03/07  16:52:00  john
19417  * Fixed robots not moving without edtiro bug.
19418  *
19419  * Revision 2.0  1995/02/27  11:30:59  john
19420  * New version 2.0, which has no anonymous unions, builds with
19421  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19422  *
19423  * Revision 1.25  1994/11/30  14:02:44  mike
19424  * fields for see/attack/claw sounds.
19425  *
19426  * Revision 1.24  1994/10/27  15:55:41  adam
19427  * *** empty log message ***
19428  *
19429  * Revision 1.23  1994/10/20  15:17:03  mike
19430  * Add boss flag.
19431  *
19432  * Revision 1.22  1994/10/20  09:51:00  adam
19433  * *** empty log message ***
19434  *
19435  * Revision 1.21  1994/10/18  10:52:54  mike
19436  * Support robots lunging as an attack_type.
19437  *
19438  * Revision 1.20  1994/10/17  21:19:02  mike
19439  * robot cloaking.
19440  *
19441  * Revision 1.19  1994/09/27  00:03:39  mike
19442  * Add score_value to robot_info struct.
19443  *
19444  * Revision 1.18  1994/09/22  19:01:12  mike
19445  * Move NDL from here to game.h
19446  *
19447  * Revision 1.17  1994/09/22  15:46:55  mike
19448  * Add default contained objects for robots.
19449  *
19450  * Revision 1.16  1994/09/22  10:46:57  mike
19451  * Add difficulty levels.
19452  *
19453  * Revision 1.15  1994/09/15  16:34:16  mike
19454  * Change rapidfire_count to a byte, add evade_speed, dum1, dum2.
19455  *
19456  * Revision 1.14  1994/09/09  14:21:58  matt
19457  * Increased maximum number of games
19458  *
19459  * Revision 1.13  1994/08/25  18:12:13  matt
19460  * Made player's weapons and flares fire from the positions on the 3d model.
19461  * Also added support for quad lasers.
19462  *
19463  * Revision 1.12  1994/08/23  16:37:24  mike
19464  * Add rapidfire_count to robot_info.
19465  *
19466  * Revision 1.11  1994/07/27  19:45:01  mike
19467  * Objects containing objects.
19468  *
19469  * Revision 1.10  1994/07/12  12:40:01  matt
19470  * Revamped physics system
19471  *
19472  * Revision 1.9  1994/06/21  12:17:12  mike
19473  * Add circle_distance to robot_info.
19474  *
19475  * Revision 1.8  1994/06/09  16:22:28  matt
19476  * Moved header for calc_gun_point() here, where it belongs
19477  *
19478  * Revision 1.7  1994/06/08  18:16:23  john
19479  * Bunch of new stuff that basically takes constants out of the code
19480  * and puts them into bitmaps.tbl.
19481  *
19482  * Revision 1.6  1994/06/03  11:38:09  john
19483  * Made robots get their strength for RobotInfo->strength, which
19484  * is read in from bitmaps.tbl
19485  *
19486  * Revision 1.5  1994/05/30  19:43:31  mike
19487  * Add voluminous comment for robot_get_anim_state.
19488  *
19489  * Revision 1.4  1994/05/30  00:03:18  matt
19490  * Got rid of robot render type, and generally cleaned up polygon model
19491  * render objects.
19492  *
19493  * Revision 1.3  1994/05/29  18:46:37  matt
19494  * Added stuff for getting robot animation info for different states
19495  *
19496  * Revision 1.2  1994/05/26  21:09:18  matt
19497  * Moved robot stuff out of polygon model and into robot_info struct
19498  * Made new file, robot.c, to deal with robots
19499  *
19500  * Revision 1.1  1994/05/26  18:02:12  matt
19501  * Initial revision
19502
19503 ------------------------------------------------------------------------
19504 main/scores.c:
19505
19506  * Revision 1.1  1995/12/05  16:06:29  allender
19507  * Initial revision
19508  *
19509  * Revision 1.3  1995/08/14  09:25:16  allender
19510  * add byteswap header
19511  *
19512  * Revision 1.2  1995/07/14  13:45:17  allender
19513  * fixed up high score code to work and look pretty good
19514  * needs some work tho'
19515  *
19516  * Revision 1.1  1995/05/16  15:30:42  allender
19517  * Initial revision
19518  *
19519  * Revision 2.2  1995/06/15  12:13:54  john
19520  * Made end game, win game and title sequences all go
19521  * on after 5 minutes automatically.
19522  *
19523  * Revision 2.1  1995/03/06  15:23:57  john
19524  * New screen techniques.
19525  *
19526  * Revision 2.0  1995/02/27  11:30:53  john
19527  * New version 2.0, which has no anonymous unions, builds with
19528  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19529  *
19530  * Revision 1.109  1995/02/09  12:23:19  rob
19531  * Added assert for length of filename.
19532  *
19533  * Revision 1.108  1995/01/03  17:33:24  john
19534  * Made scrolling textbox. Used it for scores cool saying.
19535  *
19536  * Revision 1.107  1994/12/28  10:42:51  john
19537  * More VFX tweaking.
19538  *
19539  * Revision 1.106  1994/12/28  10:26:19  john
19540  * Fixed some VFX problems.
19541  *
19542  * Revision 1.105  1994/12/15  16:42:12  adam
19543  * some fix
19544  *
19545  * Revision 1.104  1994/12/14  11:59:19  john
19546  * Changed the default high scores.
19547  *
19548  * Revision 1.103  1994/12/09  00:41:12  mike
19549  * fix hang in automap print screen
19550  *
19551  * Revision 1.102  1994/12/07  00:36:26  mike
19552  * scores sequencing stuff.
19553  *
19554  * Revision 1.101  1994/12/06  15:14:21  yuan
19555  * Localization
19556  *
19557  * Revision 1.100  1994/12/03  17:07:52  yuan
19558  * Localization 368
19559  *
19560  * Revision 1.99  1994/12/03  14:49:27  mark
19561  * Fixed john's bug with previous.
19562  *
19563  * Revision 1.98  1994/12/03  14:43:54  john
19564  * Added enter, space  to exit scores.
19565  *
19566  * Revision 1.97  1994/12/03  14:32:34  john
19567  * Added integrated-super-deluxe-ctrl-r to reset high scores.
19568  *
19569  * Revision 1.96  1994/12/01  20:15:20  yuan
19570  * Localization
19571  *
19572  * Revision 1.95  1994/11/30  19:36:36  john
19573  * Made Gravis Ultrasound work again.  Made the scores blink
19574  * at a constant rate.  Revamped the newmenu background storage,
19575  * which hopefully fixed some bugs.  Made menus in ame not pause
19576  * sound, except for the pause key.               ^== Game!
19577  *
19578  * Revision 1.94  1994/11/30  12:32:08  john
19579  * Made secret levels print correctly.
19580  *
19581  * Revision 1.93  1994/11/30  12:06:47  mike
19582  * fix bug: looper not initialized.
19583  *
19584  * Revision 1.92  1994/11/29  13:20:04  john
19585  * changed the "Wow! You placed .." to something better.
19586  *
19587  * Revision 1.91  1994/11/29  01:35:38  john
19588  * Made it so that even if you don't get a high score, you still show
19589  * up on the chart..
19590  *
19591  * Revision 1.90  1994/11/23  17:29:29  mike
19592  * fix xx-xx level bug in high scores.
19593  *
19594  * Revision 1.89  1994/11/22  16:55:27  mike
19595  * allow high scores even in pudly trainee level.
19596  *
19597  * Revision 1.88  1994/11/21  17:28:33  john
19598  * Changed default score values.
19599  *
19600  * Revision 1.87  1994/11/18  23:37:53  john
19601  * Changed some shorts to ints.
19602  *
19603  * Revision 1.86  1994/11/13  15:39:24  john
19604  * Added critical error handler to game.  Took out -editor command line
19605  * option because it didn't work anymore and wasn't worth fixing.  Made scores
19606  * not use MINER enviroment variable on release version, and made scores
19607  * not print an error if there is no descent.hi.
19608  *
19609  * Revision 1.85  1994/11/06  10:15:58  john
19610  * Took out kill % and hostage %
19611  *
19612  * Revision 1.84  1994/11/05  15:03:39  john
19613  * Added non-popup menu for the main menu, so that scores and credits don't have to save
19614  * the background.
19615  *
19616  * Revision 1.83  1994/11/05  14:05:57  john
19617  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
19618  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
19619  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
19620  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
19621  *
19622  * Revision 1.82  1994/11/04  20:11:41  john
19623  * Neatening up palette stuff with demos.
19624  *
19625  * Revision 1.81  1994/11/04  12:02:34  john
19626  * Fixed fading transitions a bit more.
19627  *
19628  * Revision 1.80  1994/10/27  12:10:39  john
19629  * Moved kill % a little to the right.
19630  *
19631  * Revision 1.79  1994/10/24  20:25:03  john
19632  * Fixed bug with space at end of 1 line message.
19633  * Made Enter go between the two input lines.
19634  *
19635  * Revision 1.78  1994/10/24  18:20:18  john
19636  * Made the current high score flash.
19637  *
19638  * Revision 1.77  1994/10/24  13:37:22  mike
19639  * Fix grammar error.  --anal Mike.
19640  *
19641  * Revision 1.76  1994/10/22  13:19:19  john
19642  * Made joy/mouse buttons leave score screen.
19643  *
19644  * Revision 1.75  1994/10/21  15:26:57  john
19645  * Used PrtScr instead of F2.
19646  *
19647  * Revision 1.74  1994/10/21  13:54:21  matt
19648  * Replace '1' with special wide '1' to make numbers line up
19649  *
19650  * Revision 1.73  1994/10/19  20:48:01  john
19651  * Made so that people playing on wimp level
19652  * can't get high scores.
19653  *
19654  * Revision 1.72  1994/10/19  15:14:05  john
19655  * Took % hits out of player structure, made %kills work properly.
19656  *
19657  * Revision 1.71  1994/10/19  14:39:27  john
19658  * Finished up; added keys to prtscr, int3.
19659  *
19660  * Revision 1.70  1994/10/19  12:44:09  john
19661  * Added hours field to player structure.
19662  *
19663  * Revision 1.69  1994/10/19  11:25:21  john
19664  * Looking good.
19665  *
19666  * Revision 1.68  1994/10/19  10:54:12  john
19667  * Test version.
19668  *
19669  * Revision 1.67  1994/10/19  10:00:27  john
19670  * *** empty log message ***
19671  *
19672  * Revision 1.66  1994/10/19  09:59:03  john
19673  * Made cool saying have the potential to be up to 50 chars
19674  *
19675  * Revision 1.65  1994/10/19  09:53:30  john
19676  * Working version of scores.
19677  *
19678  * Revision 1.64  1994/10/18  21:07:46  john
19679  * Fixed bug that didn't print name correctly.
19680  *
19681  * Revision 1.63  1994/10/18  18:21:46  john
19682  * NEw score system.
19683  *
19684  * Revision 1.62  1994/10/17  20:31:42  john
19685  * Made the text for the difficulty labels global so that
19686  * the high score screen can print "rookie" or whatever.
19687  *
19688  * Revision 1.61  1994/10/17  17:27:44  john
19689  * Added starting_level to high score system.
19690  *
19691  * Revision 1.60  1994/10/17  16:56:35  john
19692  * Added starting level to stats menu.
19693  *
19694  * Revision 1.59  1994/10/17  16:55:25  john
19695  * Added starting level, but didn't hook it to anything.
19696  *
19697  * Revision 1.58  1994/10/17  16:47:17  john
19698  * Added diff. level.
19699  *
19700  * Revision 1.57  1994/10/17  15:49:53  john
19701  * Added stats screen.
19702  *
19703  * Revision 1.56  1994/10/03  23:02:29  matt
19704  * After player added or not to scores, scores are now displayed
19705  *
19706  * Revision 1.55  1994/09/01  18:09:38  john
19707  * Made commas in scores work correctly .
19708  *
19709  *
19710  * Revision 1.54  1994/09/01  18:03:57  john
19711  * Neatened up scores a bit.
19712  *
19713  * Revision 1.53  1994/08/26  14:27:37  john
19714  * Made it prompt for name
19715  *
19716  * Revision 1.52  1994/08/26  13:03:17  john
19717  * *** empty log message ***
19718  *
19719  * Revision 1.51  1994/08/26  13:01:52  john
19720  * Put high score system in.
19721  *
19722  * Revision 1.50  1994/08/10  19:57:01  john
19723  * Changed font stuff; Took out old menu; messed up lots of
19724  * other stuff like game sequencing messages, etc.
19725  *
19726  * Revision 1.49  1994/07/25  15:40:27  matt
19727  * Took out debugging code accidentally left in.
19728
19729 ------------------------------------------------------------------------
19730 main/scores.h:
19731
19732  * Revision 1.1  1995/05/16  16:02:07  allender
19733  * Initial revision
19734  *
19735  * Revision 2.0  1995/02/27  11:31:53  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.13  1994/12/07  00:36:36  mike
19740  * scores sequencing stuff.
19741  *
19742  * Revision 1.12  1994/11/28  11:26:09  matt
19743  * Took out scores for weapons, which are no longer used
19744  *
19745  * Revision 1.11  1994/10/24  18:20:03  john
19746  * Made the current high score flash.
19747  *
19748  * Revision 1.10  1994/10/18  18:21:36  john
19749  * NEw score system.
19750  *
19751  * Revision 1.9  1994/10/03  23:01:58  matt
19752  * New parms for scores_view()
19753  *
19754  *
19755  * Revision 1.8  1994/09/27  16:10:37  adam
19756  * changed scores of course
19757  *
19758  * Revision 1.7  1994/08/31  19:25:46  mike
19759  * Add score values for new powerups.
19760  *
19761  * Revision 1.6  1994/08/26  16:00:18  mike
19762  * enhanced (?) scoring.
19763  *
19764  * Revision 1.5  1994/08/26  13:01:45  john
19765  * Put high score system in.
19766  *
19767  * Revision 1.4  1994/05/30  16:33:21  yuan
19768  * Revamping high scores.
19769  *
19770  * Revision 1.3  1994/05/14  17:15:07  matt
19771  * Got rid of externs in source (non-header) files
19772  *
19773  * Revision 1.2  1994/05/13  13:13:57  yuan
19774  * Added player death...
19775  *
19776  * When you die, if just pops up a a message.
19777  * When game is over, a message is popped up, and if you have a high score,
19778  * you get to enter it.
19779  *
19780  * Revision 1.1  1994/05/13  10:22:16  yuan
19781  * Initial revision
19782
19783 ------------------------------------------------------------------------
19784 main/screens.h:
19785
19786  * Revision 1.1  1995/05/16  16:02:15  allender
19787  * Initial revision
19788  *
19789  * Revision 2.2  1995/03/14  12:14:00  john
19790  * Made VR helmets have 4 resolutions to choose from.
19791  *
19792  * Revision 2.1  1995/03/06  15:24:09  john
19793  * New screen techniques.
19794  *
19795  * Revision 2.0  1995/02/27  11:31:40  john
19796  * New version 2.0, which has no anonymous unions, builds with
19797  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19798  *
19799  * Revision 1.15  1994/08/10  19:56:45  john
19800  * Changed font stuff; Took out old menu; messed up lots of
19801  * other stuff like game sequencing messages, etc.
19802  *
19803  * Revision 1.14  1994/07/20  21:04:26  john
19804  * Add VictorMax VR helment support.
19805  *
19806  * Revision 1.13  1994/06/24  17:01:28  john
19807  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
19808  * took it out of game.c and into gameseq.c
19809  *
19810  * Revision 1.12  1994/04/20  20:30:03  john
19811  * *** empty log message ***
19812  *
19813  * Revision 1.11  1994/03/30  21:12:05  yuan
19814  * Use only 119 lines (saves 3 scanlines)
19815  *
19816  * Revision 1.10  1994/03/17  16:49:37  john
19817  * *** empty log message ***
19818  *
19819  * Revision 1.9  1994/02/11  15:07:44  matt
19820  * Added extern of Canv_game_offscrn
19821  *
19822  * Revision 1.8  1994/01/31  16:52:43  john
19823  * redid cockpit bounds.
19824  *
19825  * Revision 1.7  1994/01/26  18:13:53  john
19826  * Changed 3d constants..
19827  *
19828  * Revision 1.6  1994/01/25  17:11:46  john
19829  * *** empty log message ***
19830  *
19831  * Revision 1.5  1994/01/25  11:43:25  john
19832  * Changed game window size.
19833  *
19834  * Revision 1.4  1993/12/13  16:32:39  yuan
19835  * Fixed menu system memory errors, and other bugs.
19836  *
19837  * Revision 1.3  1993/12/10  16:07:23  yuan
19838  * Working on menu system.  Updated the title screen.
19839  *
19840  * Revision 1.2  1993/12/09  21:27:46  matt
19841  * Added 3d window sizing constants
19842  *
19843  * Revision 1.1  1993/12/06  09:50:33  matt
19844  * Initial revision
19845
19846 ------------------------------------------------------------------------
19847 main/segment.h:
19848
19849  * Revision 1.4  1995/11/03  12:53:11  allender
19850  * shareware changes
19851  *
19852  * Revision 1.3  1995/07/26  16:53:45  allender
19853  * put sides and segment structure back the PC way for checksumming reasons
19854  *
19855  * Revision 1.2  1995/06/19  07:55:22  allender
19856  * rearranged structure members for possible better alignment
19857  *
19858  * Revision 1.1  1995/05/16  16:02:22  allender
19859  * Initial revision
19860  *
19861  * Revision 2.1  1995/03/20  18:15:22  john
19862  * Added code to not store the normals in the segment structure.
19863  *
19864  * Revision 2.0  1995/02/27  11:26:49  john
19865  * New version 2.0, which has no anonymous unions, builds with
19866  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19867  *
19868  * Revision 1.89  1995/01/24  15:07:55  yuan
19869  * *** empty log message ***
19870  *
19871  * Revision 1.88  1994/12/12  01:04:06  yuan
19872  * Boosted MAX_GAME_VERTS.
19873  *
19874  * Revision 1.87  1994/12/11  16:18:14  mike
19875  * add constants so we can detect too-large mines for game while in editor.
19876  *
19877  * Revision 1.86  1994/12/08  15:07:29  yuan
19878  * *** empty log message ***
19879  *
19880  * Revision 1.85  1994/12/01  21:06:39  matt
19881  * Moved plane tolerance constant to gameseg.c, the only file that used it.
19882  *
19883  * Revision 1.84  1994/11/27  14:01:41  matt
19884  * Fixed segment structure so LVLs work
19885  *
19886  * Revision 1.83  1994/11/26  22:50:20  matt
19887  * Removed editor-only fields from segment structure when editor is compiled
19888  * out, and padded segment structure to even multiple of 4 bytes.
19889  *
19890  * Revision 1.82  1994/11/21  11:43:36  mike
19891  * smaller segment and vertex buffers.
19892  *
19893  * Revision 1.81  1994/11/17  11:39:35  matt
19894  * Ripped out code to load old mines
19895  *
19896  * Revision 1.80  1994/10/30  14:12:05  mike
19897  * rip out local segments stuff.
19898  *
19899  * Revision 1.79  1994/10/27  11:33:58  mike
19900  * lower number of segments by 100, saving 116K.
19901  *
19902  * Revision 1.78  1994/08/25  21:54:50  mike
19903  * Add macro IS_CHILD to make checking for the presence of a child centralized.
19904  *
19905  * Revision 1.77  1994/08/11  18:58:16  mike
19906  * Add prototype for Side_to_verts_int.
19907  *
19908  * Revision 1.76  1994/08/01  11:04:13  yuan
19909  * New materialization centers.
19910  *
19911  * Revision 1.75  1994/07/25  00:04:19  matt
19912  * Various changes to accomodate new 3d, which no longer takes point numbers
19913  * as parms, and now only takes pointers to points.
19914  *
19915  * Revision 1.74  1994/07/21  19:01:30  mike
19916  * new lsegment structure.
19917  *
19918  * Revision 1.73  1994/06/08  14:30:48  matt
19919  * Added static_light field to segment structure, and padded side struct
19920  * to be longword aligned.
19921  *
19922  * Revision 1.72  1994/05/19  23:25:17  mike
19923  * Change MINE_VERSION to 15, DEFAULT_LIGHTING to 0
19924  *
19925  * Revision 1.71  1994/05/12  14:45:54  mike
19926  * New segment data structure (!!), group, special, object, value = short.
19927  *
19928  * Revision 1.70  1994/05/03  11:06:46  mike
19929  * Remove constants VMAG and UMAG which are editor specific..
19930  *
19931  * Revision 1.69  1994/04/18  10:40:28  yuan
19932  * Increased segment limit to 1000
19933  * (From 500)
19934
19935 ------------------------------------------------------------------------
19936 main/segpoint.h:
19937
19938  * Revision 1.1  1995/05/16  16:02:38  allender
19939  * Initial revision
19940  *
19941  * Revision 2.0  1995/02/27  11:26:54  john
19942  * New version 2.0, which has no anonymous unions, builds with
19943  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19944  *
19945  * Revision 1.2  1994/02/16  17:14:40  matt
19946  * Added include of 3d.h
19947  *
19948  * Revision 1.1  1993/12/06  09:51:37  matt
19949  * Initial revision
19950
19951 ------------------------------------------------------------------------
19952 main/slew.c:
19953
19954  * Revision 1.1  1995/05/16  15:30:57  allender
19955  * Initial revision
19956  *
19957  * Revision 2.0  1995/02/27  11:29:32  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.34  1995/02/22  14:23:28  allender
19962  * remove anonymous unions from object structure
19963  *
19964  * Revision 1.33  1995/02/22  13:24:26  john
19965  * Removed the vecmat anonymous unions.
19966  *
19967  * Revision 1.32  1994/09/10  15:46:42  john
19968  * First version of new keyboard configuration.
19969  *
19970  * Revision 1.31  1994/08/31  18:29:58  matt
19971  * Made slew work with new key system
19972  *
19973  * Revision 1.30  1994/08/31  14:10:48  john
19974  * Made slew go faster.
19975  *
19976  * Revision 1.29  1994/08/29  19:16:38  matt
19977  * Made slew object not have physics movement type, so slew objects don't
19978  * get bumped.
19979  *
19980  * Revision 1.28  1994/08/24  18:59:59  john
19981  * Changed key_down_time to return fixed seconds instead of
19982  * milliseconds.
19983  *
19984  * Revision 1.27  1994/07/01  11:33:05  john
19985  * Fixed bug with looking for stick even if one not present.
19986  *
19987  * Revision 1.26  1994/05/20  11:56:33  matt
19988  * Cleaned up find_vector_intersection() interface
19989  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
19990  *
19991  * Revision 1.25  1994/05/19  12:08:41  matt
19992  * Use new vecmat macros and globals
19993  *
19994  * Revision 1.24  1994/05/14  17:16:18  matt
19995  * Got rid of externs in source (non-header) files
19996  *
19997  * Revision 1.23  1994/05/03  12:26:38  matt
19998  * Removed use of physics_info var rotvel, which wasn't used for rotational
19999  * velocity at all.
20000  *
20001  * Revision 1.22  1994/02/17  11:32:34  matt
20002  * Changes in object system
20003  *
20004  * Revision 1.21  1994/01/18  14:03:53  john
20005  * made joy_get_pos use the new ints instead of
20006  * shorts.
20007  *
20008  * Revision 1.20  1994/01/10  17:11:35  mike
20009  * Add prototype for check_object_seg
20010  *
20011  * Revision 1.19  1994/01/05  10:53:38  john
20012  * New object code by John.
20013  *
20014  * Revision 1.18  1993/12/22  15:32:50  john
20015  * took out previos code that attempted to make
20016  * modifiers cancel keydowntime.
20017  *
20018  * Revision 1.17  1993/12/22  11:41:56  john
20019  * Made so that keydowntime recognizes editor special case!
20020  *
20021  * Revision 1.16  1993/12/14  18:13:52  matt
20022  * Made slew work in editor even when game isn't in slew mode
20023  *
20024  * Revision 1.15  1993/12/07  23:53:39  matt
20025  * Made slew work in editor even when game isn't in slew mode
20026  *
20027  * Revision 1.14  1993/12/05  22:47:49  matt
20028  * Reworked include files in an attempt to cut down on build times
20029  *
20030  * Revision 1.13  1993/12/01  11:44:14  matt
20031  * Chagned Frfract to FrameTime
20032  *
20033  * Revision 1.12  1993/11/08  16:21:42  john
20034  * made stop_slew or whatever return an int
20035  *
20036  * Revision 1.11  1993/11/01  13:59:49  john
20037  * more slew experiments.
20038
20039 ------------------------------------------------------------------------
20040 main/slew.h:
20041
20042  * Revision 1.1  1995/05/16  16:03:09  allender
20043  * Initial revision
20044  *
20045  * Revision 2.0  1995/02/27  11:33:05  john
20046  * New version 2.0, which has no anonymous unions, builds with
20047  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20048  *
20049  * Revision 1.5  1994/12/15  16:43:58  matt
20050  * Made slew functions compile out for release versions
20051  *
20052  * Revision 1.4  1994/02/17  11:32:41  matt
20053  * Changes in object system
20054  *
20055  * Revision 1.3  1994/01/05  10:53:42  john
20056  * New object code by John.
20057  *
20058  * Revision 1.2  1993/12/05  22:48:57  matt
20059  * Reworked include files in an attempt to cut down on build times
20060  *
20061  * Revision 1.1  1993/12/05  20:20:16  matt
20062  * Initial revision
20063
20064 ------------------------------------------------------------------------
20065 main/songs.c:
20066
20067  * Revision 1.5  1995/11/03  12:52:59  allender
20068  * shareware changes
20069  *
20070  * Revision 1.4  1995/10/18  01:51:33  allender
20071  * fixed up stuff for redbook
20072  *
20073  * Revision 1.3  1995/10/17  13:13:44  allender
20074  * dont' add resource value to songs to play -- now done in digi
20075  * code
20076  *
20077  * Revision 1.2  1995/07/17  08:50:35  allender
20078  * make work with new music system
20079  *
20080  * Revision 1.1  1995/05/16  15:31:05  allender
20081  * Initial revision
20082  *
20083  * Revision 2.1  1995/05/02  16:15:21  john
20084  * Took out printf.
20085  *
20086  * Revision 2.0  1995/02/27  11:27:13  john
20087  * New version 2.0, which has no anonymous unions, builds with
20088  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20089  *
20090  * Revision 1.2  1995/02/11  12:42:12  john
20091  * Added new song method, with FM bank switching..
20092  *
20093  * Revision 1.1  1995/02/11  10:20:33  john
20094  * Initial revision
20095
20096 ------------------------------------------------------------------------
20097 main/songs.h:
20098
20099  * Revision 2.0  1995/02/27  11:30:52  john
20100  * New version 2.0, which has no anonymous unions, builds with
20101  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20102  *
20103  * Revision 1.6  1995/02/11  22:21:44  adam
20104  * *** empty log message ***
20105  *
20106  * Revision 1.5  1995/02/11  19:10:49  adam
20107  * *** empty log message ***
20108  *
20109  * Revision 1.4  1995/02/11  18:34:40  adam
20110  * *** empty log message ***
20111  *
20112  * Revision 1.3  1995/02/11  18:04:51  adam
20113  * upped songs
20114  *
20115  * Revision 1.2  1995/02/11  12:42:12  john
20116  * Added new song method, with FM bank switching..
20117  *
20118  * Revision 1.1  1995/02/11  10:20:18  john
20119  * Initial revision
20120
20121 ------------------------------------------------------------------------
20122 main/sounds.h:
20123
20124  * Revision 1.1  1995/05/16  16:03:32  allender
20125  * Initial revision
20126  *
20127  * Revision 2.0  1995/02/27  11:27:32  john
20128  * New version 2.0, which has no anonymous unions, builds with
20129  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20130  *
20131  * Revision 1.41  1995/02/03  17:08:28  john
20132  * Changed sound stuff to allow low memory usage.
20133  * Also, changed so that Sounds isn't an array of digi_sounds, it
20134  * is a ubyte pointing into GameSounds, this way the digi.c code that
20135  * locks sounds won't accidentally unlock a sound that is already playing, but
20136  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
20137  *
20138  * Revision 1.40  1995/01/30  21:45:17  adam
20139  * added weapon change sounds
20140  *
20141  * Revision 1.39  1995/01/30  21:11:57  mike
20142  * Use new weapon selection sounds, different for primary and secondary.
20143  *
20144  * Revision 1.38  1995/01/26  17:02:58  mike
20145  * make fusion cannon have more chrome, make fusion, mega rock you!
20146  *
20147  * Revision 1.37  1995/01/18  19:46:15  matt
20148  * Added sound for invulnerability wearing off, and voice message for cheating
20149  *
20150  * Revision 1.36  1995/01/18  19:05:04  john
20151  * Increased MAX_SOUNDS.
20152  *
20153  * Revision 1.35  1994/12/14  16:57:08  adam
20154  * *** empty log message ***
20155  *
20156  * Revision 1.34  1994/12/08  21:31:40  adam
20157  * *** empty log message ***
20158  *
20159  * Revision 1.33  1994/12/08  12:33:01  mike
20160  * make boss dying more interesting.
20161  *
20162  * Revision 1.32  1994/12/04  21:39:40  matt
20163  * Added sound constants for endlevel explosions
20164  *
20165  * Revision 1.31  1994/11/30  14:02:58  mike
20166  * see/claw/attack sounds.
20167  *
20168  * Revision 1.30  1994/11/29  20:43:54  matt
20169  * Deleted a bunch of unused constants
20170  *
20171  * Revision 1.29  1994/11/29  15:48:11  matt
20172  * Cleaned up, & added new sounds
20173  *
20174  * Revision 1.28  1994/11/29  14:35:36  adam
20175  * moved lava noise index
20176  *
20177  * Revision 1.27  1994/11/29  13:23:30  matt
20178  * Cleaned up sound constants
20179  *
20180  * Revision 1.26  1994/11/29  13:01:04  rob
20181  * ADded badass explosion define.
20182  *
20183  * Revision 1.25  1994/11/29  11:34:23  rob
20184  * Added new HUD sounds.
20185  *
20186  * Revision 1.24  1994/11/15  16:52:01  mike
20187  * hiss sound placeholder.
20188  *
20189  * Revision 1.23  1994/10/25  16:21:45  adam
20190  * changed homing sound
20191  *
20192  * Revision 1.22  1994/10/23  00:27:34  matt
20193  * Made exploding wall do one long sound, instead of lots of small ones
20194  *
20195  * Revision 1.21  1994/10/22  14:12:35  mike
20196  * Add sound for missile tracking player.
20197  *
20198  * Revision 1.20  1994/10/11  12:25:21  matt
20199  * Added "hot rocks" that create badass explosion when hit by weapons
20200  *
20201  * Revision 1.19  1994/10/10  20:57:50  matt
20202  * Added sound for exploding wall (hostage door)
20203  *
20204  * Revision 1.18  1994/10/04  15:33:31  john
20205  * Took out the old PLAY_SOUND??? code and replaced it
20206  * with direct calls into digi_link_??? so that all sounds
20207  * can be made 3d.
20208  *
20209  * Revision 1.17  1994/09/29  21:13:41  john
20210  * Added Master volumes for digi and midi. Also took out panning,
20211  * because it doesn't work with MasterVolume stuff.
20212  *
20213  * Revision 1.16  1994/09/29  00:42:29  matt
20214  * Made hitting a locked door play a sound
20215  *
20216  * Revision 1.15  1994/09/20  19:14:34  john
20217  * Massaged the sound system; used a better formula for determining
20218  * which l/r balance, also, put in Mike's stuff that searches for a connection
20219  * between the 2 sounds' segments, stopping for closed doors, etc.
20220  *
20221  * Revision 1.14  1994/07/06  15:23:59  john
20222  * Revamped hostage sound.
20223  *
20224  * Revision 1.13  1994/06/21  19:13:27  john
20225  * *** empty log message ***
20226  *
20227  * Revision 1.12  1994/06/21  12:09:54  adam
20228  * *** empty log message ***
20229  *
20230  * Revision 1.11  1994/06/21  12:03:15  john
20231  * Added more sounds.
20232  *
20233  * Revision 1.10  1994/06/20  22:01:54  matt
20234  * Added prototype for Play3D()
20235  *
20236  * Revision 1.9  1994/06/20  21:06:06  yuan
20237  * Fixed up menus.
20238  *
20239  * Revision 1.8  1994/06/17  12:21:54  mike
20240  * Hook for robot hits player.
20241  *
20242  * Revision 1.7  1994/06/15  19:01:35  john
20243  * Added the capability to make 3d sounds play just once for the
20244  * laser hit wall effects.
20245  *
20246  * Revision 1.6  1994/06/08  11:43:03  john
20247  * Enable 3D sound.
20248  *
20249  * Revision 1.5  1994/06/07  18:21:20  john
20250  * Start changing sound to the new 3D system.
20251  *
20252  * Revision 1.4  1994/05/16  16:17:41  john
20253  * Bunch of stuff on my Inferno Task list May16-23
20254  *
20255  * Revision 1.3  1994/05/09  21:11:38  john
20256  * Sound changes; pass index instead of pointer to digi routines.
20257  * Made laser sound cut off the last laser sound.
20258  *
20259  * Revision 1.2  1994/04/27  11:47:46  john
20260  * First version.
20261  *
20262  * Revision 1.1  1994/04/26  10:44:36  john
20263  * Initial revision
20264
20265 ------------------------------------------------------------------------
20266 main/state.c:
20267
20268  * Revision 1.7  1995/10/31  10:18:25  allender
20269  * shareware stuff
20270  *
20271  * Revision 1.6  1995/10/21  22:25:45  allender
20272  * put in creator code and file type for saved games.
20273  * put save games in players folder
20274  *
20275  * Revision 1.5  1995/10/20  00:51:21  allender
20276  * close boxes and proper mouse support on save game stuff
20277  *
20278  * Revision 1.4  1995/10/17  13:19:02  allender
20279  * close boxes for load and save game
20280  *
20281  * Revision 1.3  1995/09/18  08:09:15  allender
20282  * made larger thumbnail and handled NULL gr_bitmap pointers
20283  * better
20284  *
20285  * Revision 1.2  1995/08/14  14:36:12  allender
20286  * change transparency to 0
20287  *
20288  * Revision 1.1  1995/05/16  15:31:12  allender
20289  * Initial revision
20290  *
20291  * Revision 2.14  1995/05/26  16:16:10  john
20292  * Split SATURN into define's for requiring cd, using cd, etc.
20293  * Also started adding all the Rockwell stuff.
20294  *
20295  * Revision 2.13  1995/04/06  15:12:20  john
20296  * Fixed bug with lunacy not working.
20297  *
20298  * Revision 2.12  1995/04/04  13:33:05  john
20299  * Removed multiplayer save.
20300  *
20301  * Revision 2.11  1995/03/31  13:42:10  john
20302  * Made saved games from the bogus saturn version read in
20303  * correctly.
20304  *
20305  * Revision 2.10  1995/03/31  12:45:28  john
20306  * Fixed bug with previous.
20307  *
20308  * Revision 2.9  1995/03/31  12:24:40  john
20309  * I had changed alt_textures from a pointer to a byte. This hosed old
20310  * saved games, so I restored it to an int.
20311  *
20312  * Revision 2.8  1995/03/28  11:22:47  john
20313  * Added cheats to save file. Changed lunacy text.
20314  *
20315  * Revision 2.7  1995/03/27  21:41:03  john
20316  * Added code to verify that the proper multi save file
20317  * is used when restoring a network game.
20318  *
20319  * Revision 2.6  1995/03/27  18:04:18  john
20320  * Made multi save/restore require the -multisave command line arg.
20321  *
20322  * Revision 2.5  1995/03/27  17:01:52  john
20323  * Made deafult choice work better.
20324  *
20325  * Revision 2.4  1995/03/27  15:49:44  john
20326  * Added slots to save games.
20327  *
20328  * Revision 2.3  1995/03/27  12:59:19  john
20329  * Initial version of multiplayer save games.
20330  *
20331  * Revision 2.2  1995/03/24  13:11:35  john
20332  * Added save game during briefing screens.
20333  *
20334  * Revision 2.1  1995/03/21  14:38:36  john
20335  * Ifdef'd out the NETWORK code.
20336  *
20337  * Revision 2.0  1995/02/27  11:27:00  john
20338  * New version 2.0, which has no anonymous unions, builds with
20339  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20340  *
20341  * Revision 1.43  1995/02/22  14:32:41  allender
20342  * remove anonymous unions from object structure
20343  *
20344  * Revision 1.42  1995/02/13  20:34:33  john
20345  * Lintized
20346  *
20347  * Revision 1.41  1995/02/13  10:37:30  john
20348  * Saved Buggin' cheat mode to save file.
20349  *
20350  * Revision 1.40  1995/02/09  10:24:25  john
20351  * *** empty log message ***
20352  *
20353  * Revision 1.39  1995/02/09  10:22:20  john
20354  * Fixed bug with callsign getting trashed if you copy somebody else
20355  * 's save game file into your directory.
20356  *
20357  * Revision 1.38  1995/02/08  21:01:27  john
20358  * Closed state file around the code that shows briefing screens so that the
20359  * code works on machines with clean boot with only 5 file handles.
20360  *
20361  * Revision 1.37  1995/02/07  14:02:33  john
20362  * Added code to verify game restore.
20363  *
20364  * Revision 1.36  1995/02/07  11:07:43  john
20365  * Added hooks for confirm on game state restore.
20366  *
20367  * Revision 1.35  1995/02/03  11:27:36  john
20368  * Made inbetween level save's thumbnail's have correct aspect.
20369  *
20370  * Revision 1.34  1995/02/03  10:58:43  john
20371  * Added code to save shareware style saved games into new format...
20372  * Also, made new player file format not have the saved game array in it.
20373  *
20374  * Revision 1.33  1995/02/02  19:40:52  john
20375  * Added 10 save game slots.
20376  *
20377  * Revision 1.32  1995/02/02  12:23:20  john
20378  * Made between level saves have picture.
20379  *
20380  * Revision 1.31  1995/01/31  11:21:43  john
20381  * Added code for fixed with menus.
20382  *
20383  * Revision 1.30  1995/01/29  21:37:29  mike
20384  * initialize variables on game load so you don't drain your energy when you fire.
20385  *
20386  * Revision 1.29  1995/01/29  13:47:58  mike
20387  * Restore some variables on game load (in game).
20388  *
20389  * Revision 1.28  1995/01/26  10:46:57  john
20390  * Fixed bug with state names getting hosed.
20391  *
20392  * Revision 1.27  1995/01/26  09:51:23  john
20393  * Fixed bug with game descriptions getting hosed.
20394  *
20395  * Revision 1.26  1995/01/25  16:35:49  john
20396  * Made so that when you hit enter during
20397  * game save, -empty- goes away.
20398  *
20399  * Revision 1.25  1995/01/25  15:01:39  john
20400  * Upped the save file version.
20401  *
20402  * Revision 1.24  1995/01/24  20:35:35  john
20403  * *** empty log message ***
20404  *
20405  * Revision 1.23  1995/01/24  20:34:24  john
20406  * Fixed bug with player stats not being set right for in
20407  * between level saves.
20408  *
20409  * Revision 1.22  1995/01/23  10:39:03  john
20410  * Added mission stuff to game saves.
20411  *
20412  * Revision 1.21  1995/01/22  16:07:12  mike
20413  * localization.
20414  *
20415  * Revision 1.20  1995/01/22  15:58:32  mike
20416  * localization
20417  *
20418  * Revision 1.19  1995/01/20  11:04:40  john
20419  * Upped state save version.
20420  *
20421  * Revision 1.18  1995/01/19  17:00:44  john
20422  * Made save game work between levels.
20423  *
20424  * Revision 1.17  1995/01/17  14:27:33  john
20425  * *** empty log message ***
20426  *
20427  * Revision 1.16  1995/01/17  13:36:37  john
20428  * Moved pig loading into StartNewLevelSub.
20429  *
20430  * Revision 1.15  1995/01/16  16:53:38  john
20431  * Added code to save cheat state during save game.
20432  *
20433  * Revision 1.14  1995/01/15  16:55:22  john
20434  * Improved mine texture parsing.
20435  *
20436  * Revision 1.13  1995/01/12  10:45:15  john
20437  * Added difficulty level to save/restore game.
20438  *
20439  * Revision 1.12  1995/01/05  15:46:55  john
20440  * Made weapons not rearm when starting a saved game.
20441  *
20442  * Revision 1.11  1995/01/05  11:51:45  john
20443  * Added better Abort game menu.
20444  * Made save state return success or nopt.
20445  *
20446  * Revision 1.10  1995/01/05  11:34:51  john
20447  * Took out endlevel save stuff for registered.
20448  *
20449  * Revision 1.9  1995/01/04  18:19:52  john
20450  * Added automap visited list saving.
20451  *
20452  * Revision 1.8  1995/01/04  17:29:56  john
20453  * Made save/restore ALT+F?. Also made them not work
20454  * in network mode, and if recording a demo, will
20455  * quit recording.
20456  *
20457  * Revision 1.7  1995/01/04  13:18:31  john
20458  * Added cool 6 game save.
20459  *
20460  * Revision 1.6  1995/01/03  20:38:46  john
20461  * Saved morph objects.
20462  *
20463  * Revision 1.5  1995/01/03  20:19:29  john
20464  * Pretty good working version of game save.
20465  *
20466  * Revision 1.4  1995/01/03  14:18:18  matt
20467  * ifdefs added to compile code add.  Added by Mike, I think.
20468  *
20469  * Revision 1.3  1994/12/29  18:40:19  john
20470  * Initial version.
20471  *
20472  * Revision 1.2  1994/12/29  15:26:40  john
20473  * Put in hooks for saving/restoring game state.
20474  *
20475  * Revision 1.1  1994/12/29  15:16:02  john
20476  * Initial revision
20477
20478 ------------------------------------------------------------------------
20479 main/state.h:
20480
20481  * Revision 1.1  1995/05/16  16:03:40  allender
20482  * Initial revision
20483  *
20484  * Revision 2.1  1995/03/27  21:40:35  john
20485  * Added code to verify that the proper multi save file
20486  * is used when restoring a network game.
20487  *
20488  * Revision 2.0  1995/02/27  11:28:44  john
20489  * New version 2.0, which has no anonymous unions, builds with
20490  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20491  *
20492  * Revision 1.6  1995/02/07  10:54:05  john
20493  * *** empty log message ***
20494  *
20495  * Revision 1.5  1995/02/03  10:58:12  john
20496  * Added code to save shareware style saved games into new format...
20497  * Also, made new player file format not have the saved game array in it.
20498  *
20499  * Revision 1.4  1995/01/19  17:00:51  john
20500  * Made save game work between levels.
20501  *
20502  * Revision 1.3  1995/01/05  11:51:44  john
20503  * Added better Abort game menu.
20504  * Made save state return success or nopt.
20505  *
20506  * Revision 1.2  1994/12/29  15:26:39  john
20507  * Put in hooks for saving/restoring game state.
20508  *
20509  * Revision 1.1  1994/12/29  15:15:47  john
20510  * Initial revision
20511
20512 ------------------------------------------------------------------------
20513 main/switch.c:
20514
20515  * Revision 1.2  1995/10/31  10:18:10  allender
20516  * shareware stuff
20517  *
20518  * Revision 1.1  1995/05/16  15:31:21  allender
20519  * Initial revision
20520  *
20521  * Revision 2.1  1995/03/21  14:39:08  john
20522  * Ifdef'd out the NETWORK code.
20523  *
20524  * Revision 2.0  1995/02/27  11:28:41  john
20525  * New version 2.0, which has no anonymous unions, builds with
20526  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20527  *
20528  * Revision 1.51  1995/01/31  15:26:23  rob
20529  * Don't trigger matcens in anarchy games.
20530  *
20531  * Revision 1.50  1995/01/26  12:18:26  rob
20532  * Changed network_do_frame call.
20533  *
20534  * Revision 1.49  1995/01/18  18:50:35  allender
20535  * don't process triggers if in demo playback mode.  Fix for Rob to only do
20536  * multi_send_endlevel_start if in multi player game
20537  *
20538  * Revision 1.48  1995/01/13  11:59:40  rob
20539  * Added palette fade after secret level exit.
20540  *
20541  * Revision 1.47  1995/01/12  17:00:41  rob
20542  * Fixed a problem with switches and secret levels.
20543  *
20544  * Revision 1.46  1995/01/12  13:35:11  rob
20545  * Added data flush after secret level exit.
20546  *
20547  * Revision 1.45  1995/01/03  15:25:11  rob
20548  * Fixed a compile error.
20549  *
20550  * Revision 1.44  1995/01/03  15:12:02  rob
20551  * Adding multiplayer switching.
20552  *
20553  * Revision 1.43  1994/11/29  16:52:12  yuan
20554  * Removed some obsolete commented out code.
20555  *
20556  * Revision 1.42  1994/11/27  23:15:07  matt
20557  * Made changes for new mprintf calling convention
20558  *
20559  * Revision 1.41  1994/11/22  18:36:45  rob
20560  * Added new hook for endlevel for secret doors.
20561  *
20562  * Revision 1.40  1994/11/21  17:29:43  matt
20563  * Cleaned up sequencing & game saving for secret levels
20564  *
20565  * Revision 1.39  1994/11/19  15:20:32  mike
20566  * rip out unused code and data
20567  *
20568  * Revision 1.38  1994/10/25  16:09:52  yuan
20569  * Fixed byte bug.
20570  *
20571  * Revision 1.37  1994/10/24  16:05:28  matt
20572  * Removed clear of fuelcen_control_center_destroyed
20573  *
20574  * Revision 1.36  1994/10/08  14:21:13  matt
20575  * Added include
20576  *
20577  * Revision 1.35  1994/10/07  12:34:09  matt
20578  * Added code fot going to/from secret levels
20579  *
20580  * Revision 1.34  1994/10/05  15:16:10  rob
20581  * Used to be that only player #0 could trigger switches, now only the
20582  * LOCAL player can do it (and he's expected to tell the other guy with
20583  * a com message if its important!)
20584  *
20585  * Revision 1.33  1994/09/24  17:42:03  mike
20586  * Kill temporary version of function written by Yuan, replaced by MK.
20587  *
20588  * Revision 1.32  1994/09/24  17:10:00  yuan
20589  * Added Matcen triggers.
20590  *
20591  * Revision 1.31  1994/09/23  18:02:21  yuan
20592  * Completed wall checking.
20593  *
20594  * Revision 1.30  1994/08/19  20:09:41  matt
20595  * Added end-of-level cut scene with external scene
20596  *
20597  * Revision 1.29  1994/08/18  10:47:36  john
20598  * Cleaned up game sequencing and player death stuff
20599  * in preparation for making the player explode into
20600  * pieces when dead.
20601  *
20602  * Revision 1.28  1994/08/12  22:42:11  john
20603  * Took away Player_stats; added Players array.
20604  *
20605  * Revision 1.27  1994/07/02  13:50:44  matt
20606  * Cleaned up includes
20607  *
20608  * Revision 1.26  1994/06/27  16:32:25  yuan
20609  * Commented out incomplete code...
20610  *
20611  * Revision 1.25  1994/06/27  15:53:27  john
20612  * #define'd out the newdemo stuff
20613  *
20614  *
20615  * Revision 1.24  1994/06/27  15:10:04  yuan
20616  * Might mess up triggers.
20617  *
20618  * Revision 1.23  1994/06/24  17:01:43  john
20619  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
20620  * took it out of game.c and into gameseq.c
20621  *
20622  * Revision 1.22  1994/06/16  16:20:15  john
20623  * Made player start out in physics mode; Neatend up game loop a bit.
20624  *
20625  * Revision 1.21  1994/06/15  14:57:22  john
20626  * Added triggers to demo recording.
20627  *
20628  * Revision 1.20  1994/06/10  17:44:25  mike
20629  * Assert on result of find_connect_side == -1
20630  *
20631  * Revision 1.19  1994/06/08  10:20:15  yuan
20632  * Removed unused testing.
20633  *
20634  *
20635  * Revision 1.18  1994/06/07  13:10:48  yuan
20636  * Fixed bug in check trigger... Still working on other bugs.
20637  *
20638  * Revision 1.17  1994/05/30  20:22:04  yuan
20639  * New triggers.
20640  *
20641  * Revision 1.16  1994/05/27  10:32:46  yuan
20642  * New dialog boxes (Walls and Triggers) added.
20643  *
20644  *
20645  * Revision 1.15  1994/05/25  18:06:46  yuan
20646  * Making new dialog box controls for walls and triggers.
20647  *
20648  * Revision 1.14  1994/05/10  19:05:32  yuan
20649  * Made end of level flag rather than menu popping up
20650  *
20651  * Revision 1.13  1994/04/29  15:05:25  yuan
20652  * Added menu pop-up at exit trigger.
20653
20654 ------------------------------------------------------------------------
20655 main/switch.h:
20656
20657  * Revision 1.1  1995/05/16  16:03:48  allender
20658  * Initial revision
20659  *
20660  * Revision 2.0  1995/02/27  11:26:52  john
20661  * New version 2.0, which has no anonymous unions, builds with
20662  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20663  *
20664  * Revision 1.19  1995/01/12  17:00:36  rob
20665  * Fixed a problem with switches and secret levels.
20666  *
20667  * Revision 1.18  1994/10/06  21:24:40  matt
20668  * Added switch for exit to secret level
20669  *
20670  * Revision 1.17  1994/09/29  17:05:52  matt
20671  * Removed unused constant
20672  *
20673  * Revision 1.16  1994/09/24  17:10:07  yuan
20674  * Added Matcen triggers.
20675  *
20676  * Revision 1.15  1994/08/15  18:06:39  yuan
20677  * Added external trigger.
20678  *
20679  * Revision 1.14  1994/06/16  16:20:52  john
20680  * Made player start out in physics mode; Neatend up game loop a bit.
20681  *
20682  * Revision 1.13  1994/05/30  20:22:08  yuan
20683  * New triggers.
20684  *
20685  * Revision 1.12  1994/05/27  10:32:44  yuan
20686  * New dialog boxes (Walls and Triggers) added.
20687  *
20688  *
20689  * Revision 1.11  1994/05/25  18:06:32  yuan
20690  * Making new dialog box controls for walls and triggers.
20691  *
20692  * Revision 1.10  1994/04/28  18:04:40  yuan
20693  * Gamesave added.
20694  * Trigger problem fixed (seg pointer is replaced by index now.)
20695  *
20696  * Revision 1.9  1994/04/26  11:19:01  yuan
20697  * Make it so a trigger can only be triggered every 5 seconds.
20698
20699 ------------------------------------------------------------------------
20700 main/terrain.c:
20701
20702  * Revision 1.1  1995/05/16  15:31:29  allender
20703  * Initial revision
20704  *
20705  * Revision 2.0  1995/02/27  11:31:27  john
20706  * New version 2.0, which has no anonymous unions, builds with
20707  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20708  *
20709  * Revision 1.12  1994/12/03  00:18:00  matt
20710  * Made endlevel sequence cut off early
20711  * Made exit model and bit explosion always plot last (after all terrain)
20712  *
20713  * Revision 1.11  1994/11/27  23:13:46  matt
20714  * Made changes for new mprintf calling convention
20715  *
20716  * Revision 1.10  1994/11/21  18:04:36  matt
20717  * Fixed alloc/free problem with height array
20718  *
20719  * Revision 1.9  1994/11/21  17:30:42  matt
20720  * Properly free light array
20721  *
20722  * Revision 1.8  1994/11/19  12:40:55  matt
20723  * Added system to read endlevel data from file, and to make it work
20724  * with any exit tunnel.
20725  *
20726  * Revision 1.7  1994/11/16  11:49:44  matt
20727  * Added code to rotate terrain to match mine
20728  *
20729  * Revision 1.6  1994/11/02  16:22:59  matt
20730  * Killed mprintf
20731  *
20732  * Revision 1.5  1994/10/30  20:09:19  matt
20733  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
20734  * go out; made more explosions on walls.
20735  *
20736  * Revision 1.4  1994/10/27  21:15:07  matt
20737  * Added better error handling
20738  *
20739  * Revision 1.3  1994/10/27  01:03:17  matt
20740  * Made terrain renderer use aribtary point in height array as origin
20741  *
20742  * Revision 1.2  1994/08/19  20:09:44  matt
20743  * Added end-of-level cut scene with external scene
20744  *
20745  * Revision 1.1  1994/08/17  20:20:49  matt
20746  * Initial revision
20747
20748 ------------------------------------------------------------------------
20749 main/terrain.h:
20750
20751  * Revision 1.1  1995/05/16  16:03:56  allender
20752  * Initial revision
20753  *
20754  * Revision 2.0  1995/02/27  11:32:53  john
20755  * New version 2.0, which has no anonymous unions, builds with
20756  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20757  *
20758  * Revision 1.3  1994/10/27  01:03:51  matt
20759  * Made terrain renderer use aribtary point in height array as origin
20760  *
20761  * Revision 1.2  1994/08/19  20:09:45  matt
20762  * Added end-of-level cut scene with external scene
20763  *
20764  * Revision 1.1  1994/08/17  20:33:36  matt
20765  * Initial revision
20766
20767 ------------------------------------------------------------------------
20768 main/texmerge.c:
20769
20770  * Revision 1.1  1995/05/16  15:31:36  allender
20771  * Initial revision
20772  *
20773  * Revision 2.0  1995/02/27  11:31:08  john
20774  * New version 2.0, which has no anonymous unions, builds with
20775  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20776  *
20777  * Revision 1.28  1995/01/14  19:16:56  john
20778  * First version of new bitmap paging code.
20779  *
20780  * Revision 1.27  1994/12/14  18:21:58  yuan
20781  * *** empty log message ***
20782  *
20783  * Revision 1.26  1994/12/13  09:50:08  john
20784  * Added Asserts to stop if wall looks like door.
20785  *
20786  * Revision 1.25  1994/12/07  00:35:24  mike
20787  * change how flat shading average color is computed for paste-ons.
20788  *
20789  * Revision 1.24  1994/11/19  15:20:29  mike
20790  * rip out unused code and data
20791  *
20792  * Revision 1.23  1994/11/12  16:38:51  mike
20793  * deal with avg_color in texture merging.
20794  *
20795  * Revision 1.22  1994/11/09  19:55:39  john
20796  * Added full rle support with texture rle caching.
20797  *
20798  * Revision 1.21  1994/10/20  15:21:16  john
20799  * Took out the texmerge caching.
20800  *
20801  * Revision 1.20  1994/10/10  19:00:57  john
20802  * Made caching info print every 1000 frames.
20803  *
20804  * Revision 1.19  1994/10/10  18:41:21  john
20805  * Printed out texture caching info.
20806  *
20807  * Revision 1.18  1994/08/11  18:59:02  mike
20808  * Use new assembler version of merge functions.
20809  *
20810  * Revision 1.17  1994/06/09  12:13:14  john
20811  * Changed selectors so that all bitmaps have a selector of
20812  * 0, but inside the texture mapper they get a selector set.
20813  *
20814  * Revision 1.16  1994/05/14  17:15:15  matt
20815  * Got rid of externs in source (non-header) files
20816  *
20817  * Revision 1.15  1994/05/09  17:21:09  john
20818  * Took out mprintf with cache hits/misses.
20819  *
20820  * Revision 1.14  1994/05/05  12:55:07  john
20821  * Made SuperTransparency work.
20822  *
20823  * Revision 1.13  1994/05/04  11:15:37  john
20824  * Added Super Transparency
20825  *
20826  * Revision 1.12  1994/04/28  23:36:04  john
20827  * Took out a debugging mprintf.
20828  *
20829  * Revision 1.11  1994/04/22  17:44:48  john
20830  * Made top 2 bits of paste-ons pick the
20831  * orientation of the bitmap.
20832  *
20833  * Revision 1.10  1994/03/31  12:05:51  matt
20834  * Cleaned up includes
20835  *
20836  * Revision 1.9  1994/03/15  16:31:52  yuan
20837  * Cleaned up bm-loading code.
20838  * (And structures)
20839  *
20840  * Revision 1.8  1994/01/24  13:15:19  john
20841  * Made caching work with pointers, not texture numbers,
20842  * that way, the animated textures cache.
20843  *
20844  * Revision 1.7  1994/01/21  16:38:10  john
20845  * Took out debug info.
20846  *
20847  * Revision 1.6  1994/01/21  16:28:43  john
20848  * added warning to print cache hit/miss.
20849  *
20850  * Revision 1.5  1994/01/21  16:22:30  john
20851  * Put in caching/
20852  *
20853  * Revision 1.4  1994/01/21  15:34:49  john
20854  * *** empty log message ***
20855  *
20856  * Revision 1.3  1994/01/21  15:33:08  john
20857  * *** empty log message ***
20858  *
20859  * Revision 1.2  1994/01/21  15:15:35  john
20860  * Created new module texmerge, that merges textures together and
20861  * caches the results.
20862  *
20863  * Revision 1.1  1994/01/21  14:55:29  john
20864  * Initial revision
20865
20866 ------------------------------------------------------------------------
20867 main/texmerge.h:
20868
20869  * Revision 1.1  1995/05/16  16:04:03  allender
20870  * Initial revision
20871  *
20872  * Revision 2.0  1995/02/27  11:28:05  john
20873  * New version 2.0, which has no anonymous unions, builds with
20874  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20875  *
20876  * Revision 1.4  1995/01/14  19:16:26  john
20877  * First version of new bitmap paging code.
20878  *
20879  * Revision 1.3  1994/01/21  15:23:26  john
20880  * made texmerge_close return void.
20881  *
20882  *
20883  * Revision 1.2  1994/01/21  15:16:01  john
20884  * Created new module texmerge, that merges textures together and
20885  * caches the results.
20886  *
20887  * Revision 1.1  1994/01/21  15:03:36  john
20888  * Initial revision
20889
20890 ------------------------------------------------------------------------
20891 main/text.c:
20892
20893  * Revision 1.1  1995/05/16  15:31:44  allender
20894  * Initial revision
20895  *
20896  * Revision 2.0  1995/02/27  11:33:09  john
20897  * New version 2.0, which has no anonymous unions, builds with
20898  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20899  *
20900  * Revision 1.11  1994/12/14  12:53:23  matt
20901  * Improved error handling
20902  *
20903  * Revision 1.10  1994/12/09  18:36:44  john
20904  * Added code to make text read from hogfile.
20905  *
20906  * Revision 1.9  1994/12/08  20:56:34  john
20907  * More cfile stuff.
20908  *
20909  * Revision 1.8  1994/12/08  17:20:06  yuan
20910  * Cfiling stuff.
20911  *
20912  * Revision 1.7  1994/12/05  15:10:36  allender
20913  * support encoded descent.tex file (descent.txb)
20914  *
20915  * Revision 1.6  1994/12/01  14:18:34  matt
20916  * Now support backslash chars in descent.tex file
20917  *
20918  * Revision 1.5  1994/10/27  00:13:10  john
20919  * Took out cfile.
20920  *
20921  * Revision 1.4  1994/07/11  15:33:49  matt
20922  * Put in command-line switch to load different text files
20923  *
20924  * Revision 1.3  1994/07/10  09:56:25  yuan
20925  * #include <stdio.h> added for FILE type.
20926  *
20927  * Revision 1.2  1994/07/09  22:48:14  matt
20928  * Added localizable text
20929  *
20930  * Revision 1.1  1994/07/09  21:30:46  matt
20931  * Initial revision
20932
20933 ------------------------------------------------------------------------
20934 main/text.h:
20935
20936  * Revision 1.3  1995/10/18  23:30:29  allender
20937  * fixed horrendous misspelling
20938  *
20939  * Revision 1.2  1995/10/18  23:27:33  allender
20940  * added new printscreen line to end of text string
20941  *
20942  * Revision 1.1  1995/05/16  16:04:11  allender
20943  * Initial revision
20944  *
20945  * Revision 2.2  1995/03/30  16:36:22  mike
20946  * text localization.
20947  *
20948  * Revision 2.1  1995/03/08  15:33:24  allender
20949  * *** empty log message ***
20950  *
20951  * Revision 2.0  1995/02/27  11:30:21  john
20952  * New version 2.0, which has no anonymous unions, builds with
20953  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
20954  *
20955  * Revision 1.63  1995/02/11  14:59:42  rob
20956  * Added string for controlcen invul.
20957  *
20958  * Revision 1.62  1995/02/10  15:19:38  allender
20959  * added text for bad write on demo write
20960  *
20961  * Revision 1.61  1995/02/08  10:59:11  rob
20962  * Added string used in kill list view.
20963  *
20964  * Revision 1.60  1995/02/07  20:38:40  rob
20965  * Added new localized strings for new multi options.
20966  *
20967  * Revision 1.59  1995/02/02  15:29:17  matt
20968  * Changed & localized secret level text
20969  *
20970  * Revision 1.58  1995/02/02  12:24:14  adam
20971  * added automap string
20972  *
20973  * Revision 1.57  1995/02/01  18:06:50  rob
20974  * Localize default macros, other stuff frm network.c
20975  *
20976  * Revision 1.56  1995/01/30  15:29:53  rob
20977  * Localizing.
20978  *
20979  * Revision 1.55  1995/01/30  13:54:25  allender
20980  * added mission/demo text
20981  *
20982  * Revision 1.54  1995/01/24  22:03:22  mike
20983  * text localization.
20984  *
20985  * Revision 1.53  1995/01/23  13:05:59  adam
20986  * added save/load game text
20987  *
20988  * Revision 1.52  1995/01/22  15:58:42  mike
20989  * localization
20990  *
20991  * Revision 1.51  1994/12/29  12:08:47  rob
20992  * removed new text strings.
20993  *
20994  * Revision 1.50  1994/12/28  16:47:14  rob
20995  * Added new com setup strings.
20996  *
20997  * Revision 1.49  1994/12/15  23:24:22  rob
20998  * Added string for rejoin failure.
20999  *
21000  * Revision 1.48  1994/12/15  10:16:06  adam
21001  * added lame trademark notice
21002  *
21003  * Revision 1.47  1994/12/14  18:21:23  yuan
21004  * *** empty log message ***
21005  *
21006  * Revision 1.46  1994/12/14  16:57:01  matt
21007  * Added text for hat2
21008  *
21009  * Revision 1.45  1994/12/14  08:50:12  allender
21010  * *** empty log message ***
21011  *
21012  * Revision 1.44  1994/12/13  19:43:29  rob
21013  * Added string.
21014  *
21015  * Revision 1.43  1994/12/13  12:54:45  mike
21016  * add strings for hostages on board when you die.
21017  *
21018  * Revision 1.42  1994/12/13  10:04:09  allender
21019  * *** empty log message ***
21020  *
21021  * Revision 1.41  1994/12/12  22:20:23  rob
21022  * Added two new localized strings for modem.c
21023  *
21024  * Revision 1.40  1994/12/09  19:46:26  yuan
21025  * Localized the sucker.
21026  *
21027  * Revision 1.39  1994/12/09  14:35:30  yuan
21028  * Added localization string for Rob.
21029  *
21030  * Revision 1.38  1994/12/09  14:08:16  mike
21031  * text message for remaining ships at end bonus.
21032  *
21033  * Revision 1.37  1994/12/09  00:28:26  rob
21034  * Added "died in mine" string.
21035  *
21036  * Revision 1.36  1994/12/08  14:30:31  yuan
21037  * Fixed off by one problem.
21038  *
21039  * Revision 1.35  1994/12/08  11:18:56  allender
21040  * demo text string
21041  *
21042  * Revision 1.33  1994/12/07  19:14:33  matt
21043  * Cleaned up command-line options and command-line help message
21044  *
21045  * Revision 1.32  1994/12/07  17:20:34  yuan
21046  * Localization
21047  *
21048  * Revision 1.31  1994/12/07  16:49:15  yuan
21049  * More localization
21050  *
21051  * Revision 1.30  1994/12/07  14:52:11  yuan
21052  * Localization 492
21053  *
21054  * Revision 1.29  1994/12/07  11:28:12  matt
21055  * Did a little localization support
21056  *
21057  * Revision 1.28  1994/12/06  18:29:31  mike
21058  * Add text for cheat: Start at any level.
21059  *
21060  * Revision 1.27  1994/12/06  16:30:39  yuan
21061  * Localization
21062  *
21063  * Revision 1.26  1994/12/06  15:14:55  yuan
21064  * Fixed number of textstrings.
21065  *
21066  * Revision 1.25  1994/12/06  15:13:52  yuan
21067  * Localization
21068  *
21069  * Revision 1.24  1994/12/06  13:46:24  adam
21070  * *** empty log message ***
21071  *
21072  * Revision 1.23  1994/12/05  23:17:28  yuan
21073  * Localization bugs fixed.
21074  *
21075  * Revision 1.22  1994/12/05  23:05:41  yuan
21076  * Localization 425
21077  *
21078  * Revision 1.21  1994/12/05  22:42:27  rob
21079  * Added new connect status strings
21080  *
21081  * Revision 1.20  1994/12/05  16:47:30  rob
21082  * Added a new string.
21083  *
21084  *
21085  * Revision 1.19  1994/12/03  22:35:17  yuan
21086  * Localization 412
21087  *
21088  * Revision 1.18  1994/12/03  17:53:42  yuan
21089  * 382.
21090
21091 ------------------------------------------------------------------------
21092 main/textures.h:
21093
21094  * Revision 1.1  1995/05/16  16:04:20  allender
21095  * Initial revision
21096  *
21097  * Revision 2.0  1995/02/27  11:31:54  john
21098  * New version 2.0, which has no anonymous unions, builds with
21099  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21100  *
21101  * Revision 1.3  1994/03/15  16:32:56  yuan
21102  * Cleaned up bm-loading code.
21103  * (Fixed structures too)
21104  *
21105  * Revision 1.2  1993/12/05  22:49:53  matt
21106  * Reworked include files in an attempt to cut down on build times
21107  *
21108  * Revision 1.1  1993/12/05  20:16:26  matt
21109  * Initial revision
21110
21111 ------------------------------------------------------------------------
21112 main/titles.c:
21113
21114  * Revision 1.13  1995/11/03  12:52:23  allender
21115  * shareware changes
21116  *
21117  * Revision 1.12  1995/10/31  10:17:56  allender
21118  * shareware stuff
21119  *
21120  * Revision 1.11  1995/10/24  18:12:02  allender
21121  * don't do special processing on do_appl_quit anymore
21122  *
21123  * Revision 1.10  1995/10/21  22:25:02  allender
21124  * added bald guy cheat
21125  *
21126  * Revision 1.9  1995/10/17  13:14:30  allender
21127  * mouse will now move through title stuff
21128  *
21129  * Revision 1.8  1995/10/15  23:00:34  allender
21130  * made mouse move through screens and do event processing
21131  * at title screens
21132  *
21133  * Revision 1.7  1995/10/10  11:52:10  allender
21134  * use appropriate end01 file for registered
21135  *
21136  * Revision 1.6  1995/09/24  10:53:09  allender
21137  * added cmd-q to quit during titles screens and briefing screens
21138  *
21139  * Revision 1.5  1995/08/25  15:39:37  allender
21140  * save and resotre interpolation method during briefing screens
21141  *
21142  * Revision 1.4  1995/08/24  16:10:57  allender
21143  * endgame screen changes, and fixups to other stuff
21144  *
21145  * Revision 1.3  1995/08/14  14:40:37  allender
21146  * fixed up briefing screens to look correct.
21147  * made robot canvas smaller for now for speec
21148  *
21149  * Revision 1.2  1995/06/13  13:07:05  allender
21150  * do a bitblt during tight loops to get spinning robots and cursor flashing
21151  *
21152  * Revision 1.1  1995/05/16  15:31:52  allender
21153  * Initial revision
21154  *
21155  * Revision 2.10  1995/06/15  12:14:16  john
21156  * Made end game, win game and title sequences all go
21157  * on after 5 minutes automatically.
21158  *
21159  * Revision 2.9  1995/06/14  17:25:48  john
21160  * Fixed bug with VFX palette not getting loaded for credits, titles.
21161  *
21162  * Revision 2.8  1995/05/26  16:16:30  john
21163  * Split SATURN into define's for requiring cd, using cd, etc.
21164  * Also started adding all the Rockwell stuff.
21165  *
21166  * Revision 2.7  1995/03/24  13:11:36  john
21167  * Added save game during briefing screens.
21168  *
21169  * Revision 2.6  1995/03/21  14:41:17  john
21170  * Ifdef'd out the NETWORK code.
21171  *
21172  * Revision 2.5  1995/03/15  14:33:45  john
21173  * Added code to force the Descent CD-rom in the drive.
21174  *
21175  * Revision 2.4  1995/03/14  18:24:50  john
21176  * Force Destination Saturn to use CD-ROM drive.
21177  *
21178  * Revision 2.3  1995/03/10  13:05:52  john
21179  * Added code so that palette is correct for VFX1 helmets.
21180  *
21181  * Revision 2.2  1995/03/07  14:19:28  mike
21182  * More destination saturn stuff.
21183  *
21184  * Revision 2.1  1995/03/06  15:24:16  john
21185  * New screen techniques.
21186  *
21187  * Revision 2.0  1995/02/27  11:32:50  john
21188  * New version 2.0, which has no anonymous unions, builds with
21189  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21190  *
21191  * Revision 1.95  1995/02/12  04:07:19  matt
21192  * After freeing Robot_canv, set ptr to NULL
21193  *
21194  * Revision 1.94  1995/02/11  12:41:57  john
21195  * Added new song method, with FM bank switching..
21196  *
21197  * Revision 1.93  1995/02/11  09:51:59  john
21198  * Stripped out all SVGA references.
21199  *
21200  * Revision 1.92  1995/02/07  09:56:10  john
21201  * Fixed bug with wrong title screen drawing during save btwn lvls.
21202  *
21203  * Revision 1.91  1995/02/04  13:53:16  john
21204  * Added code to display the correct titles between levels
21205  * that have robot maps..
21206  *
21207  * Revision 1.90  1995/02/02  16:36:33  adam
21208  * *** empty log message ***
21209  *
21210  * Revision 1.89  1995/02/02  12:23:30  john
21211  * Made between level saves have picture.
21212  *
21213  * Revision 1.88  1995/02/02  01:50:16  adam
21214  * rearranged robot briefings.
21215  *
21216  * Revision 1.87  1995/02/01  22:28:54  mike
21217  * *** empty log message ***
21218  *
21219  * Revision 1.86  1995/02/01  17:12:21  mike
21220  * Make score come after endgame screens.
21221  *
21222  * Revision 1.85  1995/02/01  14:04:17  adam
21223  * mucked with screens
21224  *
21225  * Revision 1.84  1995/01/28  16:59:30  adam
21226  * added hook for special first briefing music
21227  *
21228  * Revision 1.83  1995/01/21  17:04:35  mike
21229  * fix endgame text bogosity.
21230  *
21231  * Revision 1.82  1995/01/21  16:26:29  matt
21232  * Made endlevel briefing work with missions
21233  *
21234  * Revision 1.81  1995/01/21  13:15:20  adam
21235  * added new robot briefings.
21236  *
21237  * Revision 1.80  1995/01/20  22:47:33  matt
21238  * Mission system implemented, though imcompletely
21239  *
21240  * Revision 1.79  1995/01/20  14:57:52  mike
21241  * support arbitrary number of screens/level.
21242  *
21243  * Revision 1.78  1995/01/15  14:29:12  john
21244  * Made the exit door page in.
21245  *
21246  * Revision 1.77  1995/01/15  14:27:09  adam
21247  * messed with endgame stuff
21248  *
21249  * Revision 1.76  1995/01/14  15:42:49  mike
21250  * Make endgame for registered support 3 screens.
21251  *
21252  * Revision 1.75  1995/01/14  14:00:59  adam
21253  * *** empty log message ***
21254  *
21255  * Revision 1.74  1995/01/09  11:28:53  mike
21256  * Support new $O thingy for bitmaps which cycle and are not the exit door.
21257  *
21258  * Revision 1.73  1995/01/02  12:39:13  mike
21259  * fix secret level sequencing.
21260  *
21261  * Revision 1.72  1994/12/12  19:44:14  rob
21262  * Added kill matrix to end of game sequence.
21263  *
21264  * Revision 1.71  1994/12/09  22:32:57  adam
21265  * messed with text positioning
21266  *
21267  * Revision 1.70  1994/12/09  14:08:37  mike
21268  * make briefing text work with hog files.
21269  *
21270  * Revision 1.69  1994/12/09  00:41:47  mike
21271  * fix hang in automap print screen.
21272  *
21273  * Revision 1.68  1994/12/08  20:56:36  john
21274  * More cfile stuff.
21275  *
21276  * Revision 1.67  1994/12/08  17:19:11  yuan
21277  * Cfiling stuff.
21278  *
21279  * Revision 1.66  1994/12/07  11:28:00  matt
21280  * Did a localization suppport
21281  *
21282  * Revision 1.65  1994/12/06  17:10:23  yuan
21283  * Fixed missing )
21284  *
21285  * Revision 1.64  1994/12/06  17:00:45  rob
21286  * Fixed problem with finishing the game in modem/serial mode.
21287  *
21288  * Revision 1.63  1994/12/06  16:58:37  matt
21289  * Killed warnings
21290  *
21291  * Revision 1.62  1994/12/06  15:54:28  mike
21292  * fix guy at end...
21293
21294 ------------------------------------------------------------------------
21295 main/titles.h:
21296
21297  * Revision 2.0  1995/02/27  11:27:40  john
21298  * New version 2.0, which has no anonymous unions, builds with
21299  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21300  *
21301  * Revision 1.12  1995/02/02  12:23:29  john
21302  * Made between level saves have picture.
21303  *
21304  * Revision 1.11  1995/01/21  16:27:11  matt
21305  * Made endlevel briefing work with missions
21306  *
21307  * Revision 1.10  1995/01/20  22:48:02  matt
21308  * Mission system implemented, though imcompletely
21309  *
21310  * Revision 1.9  1994/12/07  19:14:07  matt
21311  * Kill briefing screen disable switch for release version
21312  *
21313  * Revision 1.8  1994/11/21  16:40:24  matt
21314  * Added prototype
21315  *
21316  * Revision 1.7  1994/11/05  14:05:54  john
21317  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
21318  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
21319  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
21320  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
21321  *
21322  * Revision 1.6  1994/11/01  17:57:48  mike
21323  * Briefing screens.
21324  *
21325  * Revision 1.5  1994/10/31  22:28:04  mike
21326  * briefing screens
21327  *
21328  * Revision 1.4  1994/09/16  16:14:31  john
21329  * Added acrade sequencing.
21330  *
21331  * Revision 1.3  1994/06/22  00:26:53  matt
21332  * Added support for Interplay's animating title sequence
21333  *
21334  * Revision 1.2  1994/06/17  12:13:36  john
21335  * More newdemo stuff; made editor->game transition start in slew mode.
21336  *
21337  * Revision 1.1  1994/06/17  10:50:12  john
21338  * Initial revision
21339
21340 ------------------------------------------------------------------------
21341 main/vclip.c:
21342
21343  * Revision 1.2  1995/09/14  14:14:31  allender
21344  * return void in draw_vclip_object
21345  *
21346  * Revision 1.1  1995/05/16  15:32:00  allender
21347  * Initial revision
21348  *
21349  * Revision 2.0  1995/02/27  11:32:41  john
21350  * New version 2.0, which has no anonymous unions, builds with
21351  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21352  *
21353  * Revision 1.8  1994/09/25  23:40:52  matt
21354  * Changed the object load & save code to read/write the structure fields one
21355  * at a time (rather than the whole structure at once).  This mean that the
21356  * object structure can be changed without breaking the load/save functions.
21357  * As a result of this change, the local_object data can be and has been
21358  * incorporated into the object array.  Also, timeleft is now a property
21359  * of all objects, and the object structure has been otherwise cleaned up.
21360  *
21361  * Revision 1.7  1994/09/25  15:45:26  matt
21362  * Added OBJ_LIGHT, a type of object that casts light
21363  * Added generalized lifeleft, and moved it to local_object
21364  *
21365  * Revision 1.6  1994/09/09  20:05:57  mike
21366  * Add vclips for weapons.
21367  *
21368  * Revision 1.5  1994/06/14  21:14:35  matt
21369  * Made rod objects draw lighted or not depending on a parameter, so the
21370  * materialization effect no longer darkens.
21371  *
21372  * Revision 1.4  1994/06/08  18:16:24  john
21373  * Bunch of new stuff that basically takes constants out of the code
21374  * and puts them into bitmaps.tbl.
21375  *
21376  * Revision 1.3  1994/06/03  10:47:17  matt
21377  * Made vclips (used by explosions) which can be either rods or blobs, as
21378  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
21379  *
21380  * Revision 1.2  1994/05/11  09:25:25  john
21381  * Abandoned new vclip system for now because each wallclip, vclip,
21382  * etc, is different and it would be a huge pain to change all of them.
21383  *
21384  * Revision 1.1  1994/05/10  15:21:12  john
21385  * Initial revision
21386
21387 ------------------------------------------------------------------------
21388 main/vclip.h:
21389
21390  * Revision 1.2  1995/09/14  14:14:45  allender
21391  * return void in draw_vclip_object
21392  *
21393  * Revision 1.1  1995/05/16  16:04:35  allender
21394  * Initial revision
21395  *
21396  * Revision 2.0  1995/02/27  11:32:42  john
21397  * New version 2.0, which has no anonymous unions, builds with
21398  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21399  *
21400  * Revision 1.33  1994/11/21  11:17:57  adam
21401  * *** empty log message ***
21402  *
21403  * Revision 1.32  1994/10/12  13:07:07  mike
21404  * Add VCLIP_POWERUP_DISAPPEARANCE.
21405  *
21406  * Revision 1.31  1994/10/12  10:23:54  adam
21407  * *** empty log message ***
21408  *
21409  * Revision 1.30  1994/10/11  12:25:21  matt
21410  * Added "hot rocks" that create badass explosion when hit by weapons
21411  *
21412  * Revision 1.29  1994/10/06  14:10:07  matt
21413  * Added constant for player appearence effect
21414  *
21415  * Revision 1.28  1994/09/26  08:40:30  adam
21416  * *** empty log message ***
21417  *
21418  * Revision 1.27  1994/09/10  17:30:57  mike
21419  * move a prototype here, had been defined in object.c
21420  *
21421  * Revision 1.26  1994/09/09  20:04:25  mike
21422  * Add weapon_vclip.
21423  *
21424  * Revision 1.25  1994/08/31  19:27:09  mike
21425  * Increase max number of Vclips for new pile of weapon powerups.
21426  *
21427  * Revision 1.24  1994/08/14  23:14:43  matt
21428  * Added animating bitmap hostages, and cleaned up vclips a bit
21429  *
21430  * Revision 1.23  1994/07/23  19:56:39  matt
21431  * Took out unused constant
21432  *
21433  * Revision 1.22  1994/07/22  10:42:10  adam
21434  * upped max no. of vclips
21435  *
21436  * Revision 1.21  1994/06/14  21:15:14  matt
21437  * Made rod objects draw lighted or not depending on a parameter, so the
21438  * materialization effect no longer darkens.
21439  *
21440  * Revision 1.20  1994/06/09  19:38:16  john
21441  * Made each Vclip have its own sound... but only used in the
21442  * materialization center.
21443  *
21444  * Revision 1.19  1994/06/09  11:46:26  john
21445  * Took out unused vclip defines.
21446  *
21447  * Revision 1.18  1994/06/08  18:16:33  john
21448  * Bunch of new stuff that basically takes constants out of the code
21449  * and puts them into bitmaps.tbl.
21450  *
21451  * Revision 1.17  1994/06/08  12:49:01  mike
21452  * Add light_value to vclip.
21453  *
21454  * Revision 1.16  1994/06/08  11:43:28  mike
21455  * Allow 20 vclips, I think (anyway, more than it used to be, probably 12).
21456  *
21457  * Revision 1.15  1994/06/03  10:48:22  matt
21458  * Made vclips (used by explosions) which can be either rods or blobs, as
21459  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
21460  *
21461  * Revision 1.14  1994/06/01  17:21:08  john
21462  * Added muzzle flash
21463  *
21464  * Revision 1.13  1994/06/01  10:34:02  john
21465  * Added robot morphing effect.
21466  *
21467  * Revision 1.12  1994/05/16  16:17:38  john
21468  * Bunch of stuff on my Inferno Task list May16-23
21469  *
21470  * Revision 1.11  1994/05/10  18:32:50  john
21471  * *** empty log message ***
21472  *
21473  * Revision 1.10  1994/04/29  14:35:52  matt
21474  * Added second kind of fireball
21475  *
21476  * Revision 1.9  1994/04/11  10:36:31  yuan
21477  * Started adding types for exploding hostages.
21478  *
21479  * Revision 1.8  1994/04/07  16:27:43  yuan
21480  * Added SUPERPIG the robot with 200 hit points.
21481  * Now robots can take multiple hits before blowing up.
21482  *
21483  * Revision 1.7  1994/04/07  13:45:58  yuan
21484  * Defined Pclips... maybe shouldn't be in this file.
21485  *
21486  * Revision 1.6  1994/03/28  20:58:22  yuan
21487  * Added blood vclip constant
21488  *
21489  * Revision 1.5  1994/03/15  16:31:56  yuan
21490  * Cleaned up bm-loading code.
21491  * (And structures)
21492  *
21493  * Revision 1.4  1994/03/04  17:09:43  yuan
21494  * New wall stuff
21495  *
21496  * Revision 1.3  1994/01/11  10:59:01  yuan
21497  * Added effects
21498  *
21499  * Revision 1.2  1994/01/06  17:13:15  john
21500  * Added Video clip functionality
21501  *
21502  * Revision 1.1  1994/01/06  15:10:15  john
21503  * Initial revision
21504
21505 ------------------------------------------------------------------------
21506 main/wall.c:
21507
21508  * Revision 1.1  1995/05/16  15:32:08  allender
21509  * Initial revision
21510  *
21511  * Revision 2.1  1995/03/21  14:39:04  john
21512  * Ifdef'd out the NETWORK code.
21513  *
21514  * Revision 2.0  1995/02/27  11:28:32  john
21515  * New version 2.0, which has no anonymous unions, builds with
21516  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21517  *
21518  * Revision 1.112  1995/02/22  13:53:07  allender
21519  * remove anonymous unions from object structure
21520  *
21521  * Revision 1.111  1995/02/01  17:32:17  adam
21522  * Took out a bogus int3.
21523  *
21524  * Revision 1.110  1995/02/01  17:20:24  john
21525  * Lintized.
21526  *
21527  * Revision 1.109  1995/01/21  17:39:50  matt
21528  * Cleaned up laser/player hit wall confusions
21529  *
21530  * Revision 1.108  1995/01/21  17:14:17  rob
21531  * Fixed bug in multiplayer door-butting.
21532  *
21533  * Revision 1.107  1995/01/18  18:57:11  rob
21534  * Added new hostage door hooks.
21535  *
21536  * Revision 1.106  1995/01/18  18:48:18  allender
21537  * removed #ifdef newdemo's.  Added function call to record a door that
21538  * starts to open. This fixes the rewind problem
21539  *
21540  * Revision 1.105  1995/01/16  11:55:39  mike
21541  * make control center (and robots whose id == your playernum) not able to open doors.
21542  *
21543  * Revision 1.104  1994/12/11  23:07:21  matt
21544  * Fixed stuck objects & blastable walls
21545  *
21546  * Revision 1.103  1994/12/10  16:44:34  matt
21547  * Added debugging code to track down door that turns into rock
21548  *
21549  * Revision 1.102  1994/12/06  16:27:05  matt
21550  * Added debugging
21551  *
21552  * Revision 1.101  1994/12/02  10:50:27  yuan
21553  * Localization
21554  *
21555  * Revision 1.100  1994/11/30  19:41:22  rob
21556  * Put in a fix so that door opening sounds travel through the door.
21557  *
21558  * Revision 1.99  1994/11/28  11:59:50  yuan
21559  * *** empty log message ***
21560  *
21561  * Revision 1.98  1994/11/28  11:25:45  matt
21562  * Cleaned up key hud messages
21563  *
21564  * Revision 1.97  1994/11/27  23:15:11  matt
21565  * Made changes for new mprintf calling convention
21566  *
21567  * Revision 1.96  1994/11/19  15:18:29  mike
21568  * rip out unused code and data.
21569  *
21570  * Revision 1.95  1994/11/17  14:57:12  mike
21571  * moved segment validation functions from editor to main.
21572  *
21573  * Revision 1.94  1994/11/07  08:47:30  john
21574  * Made wall state record.
21575  *
21576  * Revision 1.93  1994/11/04  16:06:37  rob
21577  * Fixed network damage of blastable walls.
21578  *
21579  * Revision 1.92  1994/11/02  21:54:01  matt
21580  * Don't let objects with zero size keep door from shutting
21581  *
21582  * Revision 1.91  1994/10/31  13:48:42  rob
21583  * Fixed bug in opening doors over network/modem.  Added a new message
21584  * type to multi.c that communicates door openings across the net.
21585  * Changed includes in multi.c and wall.c to accomplish this.
21586  *
21587  * Revision 1.90  1994/10/28  14:42:41  john
21588  * Added sound volumes to all sound calls.
21589  *
21590  * Revision 1.89  1994/10/23  19:16:55  matt
21591  * Fixed bug with "no key" messages
21592
21593 ------------------------------------------------------------------------
21594 main/wall.h:
21595
21596  * Revision 1.1  1995/05/16  16:05:14  allender
21597  * Initial revision
21598  *
21599  * Revision 2.0  1995/02/27  11:31:36  john
21600  * New version 2.0, which has no anonymous unions, builds with
21601  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21602  *
21603  * Revision 1.47  1994/11/19  15:20:35  mike
21604  * rip out unused code and data
21605  *
21606  * Revision 1.46  1994/10/25  15:40:12  yuan
21607  * MAX_WALLS pumped up
21608  *
21609  * Revision 1.45  1994/10/23  19:17:07  matt
21610  * Fixed bug with "no key" messages
21611  *
21612  * Revision 1.44  1994/10/18  15:38:03  mike
21613  * Define hidden walls.
21614  *
21615  * Revision 1.43  1994/10/04  13:32:26  adam
21616  * commented out MAX_DOOR_ANIMS
21617  *
21618  * Revision 1.42  1994/10/04  13:31:21  adam
21619  * upped MAX_WALL_ANIMS to 30
21620  *
21621  * Revision 1.41  1994/09/29  00:42:30  matt
21622  * Made hitting a locked door play a sound
21623  *
21624  * Revision 1.40  1994/09/27  15:42:41  mike
21625  * Prototype Wall_names.
21626  *
21627  * Revision 1.39  1994/09/23  22:15:32  matt
21628  * Made doors not close on objects, made doors open again if shot while
21629  * closing, and cleaned up walls/doors a bit.
21630  *
21631  * Revision 1.38  1994/09/22  15:31:33  matt
21632  * Mucked with, and hopefully improved, exploding walls
21633  *
21634  * Revision 1.37  1994/09/21  17:17:05  mike
21635  * Make objects stuck in doors go away when door opens.
21636  *
21637  * Revision 1.36  1994/09/13  21:10:46  matt
21638  * Added wclips that use tmap1 instead of tmap2, saving lots of merging
21639  *
21640  * Revision 1.35  1994/09/13  20:11:08  yuan
21641  * *** empty log message ***
21642  *
21643  * Revision 1.34  1994/09/10  13:31:53  matt
21644  * Made exploding walls a type of blastable walls.
21645  * Cleaned up blastable walls, making them tmap2 bitmaps.
21646  *
21647  * Revision 1.33  1994/08/17  12:55:34  matt
21648  * Added external walls to wall_is_doorway
21649  *
21650  * Revision 1.32  1994/08/15  17:54:35  john
21651  * *** empty log message ***
21652  *
21653  * Revision 1.31  1994/08/15  17:46:56  yuan
21654  * Added external walls, fixed blastable walls.
21655  *
21656  * Revision 1.30  1994/08/05  21:17:21  matt
21657  * Allow two doors to be linked together
21658  *
21659  * Revision 1.29  1994/08/01  10:39:10  matt
21660  * Parenthesized parms to WID() macro
21661  *
21662  * Revision 1.28  1994/07/20  17:35:03  yuan
21663  * Some minor bug fixes and new key gauges...
21664  *
21665  * Revision 1.27  1994/07/19  14:32:03  yuan
21666  * Fixed keys bug... renumbered some constants.
21667  *
21668  * Revision 1.26  1994/07/14  22:38:29  matt
21669  * Added exploding doors
21670  *
21671  * Revision 1.25  1994/07/11  15:08:43  yuan
21672  * Wall anim file names stored in structure.
21673
21674 ------------------------------------------------------------------------
21675 main/weapon.c:
21676
21677  * Revision 1.2  1995/10/31  10:17:39  allender
21678  * new shareware stuff
21679  *
21680  * Revision 1.1  1995/05/16  15:32:16  allender
21681  * Initial revision
21682  *
21683  * Revision 2.1  1995/03/21  14:38:43  john
21684  * Ifdef'd out the NETWORK code.
21685  *
21686  * Revision 2.0  1995/02/27  11:27:25  john
21687  * New version 2.0, which has no anonymous unions, builds with
21688  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21689  *
21690  * Revision 1.54  1995/02/15  15:21:48  mike
21691  * make smart missile select if mega missiles used up.
21692  *
21693  *
21694  * Revision 1.53  1995/02/12  02:12:30  john
21695  * Fixed bug with state restore making weapon beeps.
21696  *
21697  * Revision 1.52  1995/02/09  20:42:15  mike
21698  * change weapon autoselect, always autoselect smart, mega.
21699  *
21700  * Revision 1.51  1995/02/07  20:44:26  mike
21701  * autoselect mega, smart when you pick them up.
21702  *
21703  * Revision 1.50  1995/02/07  13:32:25  rob
21704  * Added include of multi.h
21705  *
21706  * Revision 1.49  1995/02/07  13:21:33  yuan
21707  * Fixed 2nd typo
21708  *
21709  * Revision 1.48  1995/02/07  13:16:39  yuan
21710  * Fixed typo.
21711  *
21712  * Revision 1.47  1995/02/07  12:53:12  rob
21713  * Added network sound prop. to weapon switch.
21714  *
21715  * Revision 1.46  1995/02/06  15:53:17  mike
21716  * don't autoselect smart or mega missile when you pick it up.
21717  *
21718  * Revision 1.45  1995/02/02  21:43:34  mike
21719  * make autoselection better.
21720  *
21721  * Revision 1.44  1995/02/02  16:27:21  mike
21722  * make concussion missiles trade up.
21723  *
21724  * Revision 1.43  1995/02/01  23:34:57  adam
21725  * messed with weapon change sounds
21726  *
21727  * Revision 1.42  1995/02/01  17:12:47  mike
21728  * Make smart missile, mega missile not auto-select.
21729  *
21730  * Revision 1.41  1995/02/01  15:50:54  mike
21731  * fix bogus weapon selection sound code.
21732  *
21733  * Revision 1.40  1995/01/31  16:16:31  mike
21734  * Separate smart blobs for robot and player.
21735  *
21736  * Revision 1.39  1995/01/30  21:12:11  mike
21737  * Use new weapon selection sounds, different for primary and secondary.
21738  *
21739  * Revision 1.38  1995/01/29  13:46:52  mike
21740  * Don't auto-select fusion cannon when you run out of energy.
21741  *
21742  * Revision 1.37  1995/01/20  11:11:13  allender
21743  * record weapon changes again.  (John somehow lost my 1.35 changes).
21744  *
21745  * Revision 1.36  1995/01/19  17:00:46  john
21746  * Made save game work between levels.
21747  *
21748  * Revision 1.34  1995/01/09  17:03:48  mike
21749  * fix autoselection of weapons.
21750  *
21751  * Revision 1.33  1995/01/05  15:46:31  john
21752  * Made weapons not rearm when starting a saved game.
21753  *
21754  * Revision 1.32  1995/01/03  12:34:23  mike
21755  * autoselect next lower weapon if run out of smart or mega missile.
21756  *
21757  * Revision 1.31  1994/12/12  21:39:37  matt
21758  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
21759  *
21760  * Revision 1.30  1994/12/09  19:55:04  matt
21761  * Added weapon name in "not available in shareware" message
21762  *
21763  * Revision 1.29  1994/12/06  13:50:24  adam
21764  * added shareware msg. when choosing 4 top weapons
21765  *
21766  * Revision 1.28  1994/12/02  22:07:13  mike
21767  * if you gots 19 concussion missiles and you runs over 4, say you picks up 1, not 4, we do the math, see?
21768  *
21769  * Revision 1.27  1994/12/02  20:06:24  matt
21770  * Made vulcan ammo print at approx 25 times actual
21771  *
21772  * Revision 1.26  1994/12/02  15:05:03  matt
21773  * Fixed bogus weapon constants and arrays
21774  *
21775  * Revision 1.25  1994/12/02  10:50:34  yuan
21776  * Localization
21777  *
21778  * Revision 1.24  1994/11/29  15:48:28  matt
21779  * selecting weapon now makes sound
21780  *
21781  * Revision 1.23  1994/11/28  11:26:58  matt
21782  * Cleaned up hud message printing for picking up weapons
21783  *
21784  * Revision 1.22  1994/11/27  23:13:39  matt
21785  * Made changes for new mprintf calling convention
21786  *
21787  * Revision 1.21  1994/11/12  16:38:34  mike
21788  * clean up default ammo stuff.
21789  *
21790  * Revision 1.20  1994/11/07  17:41:18  mike
21791  * messages for when you try to fire a weapon you don't have or don't have ammo for.
21792  *
21793  * Revision 1.19  1994/10/21  20:40:05  mike
21794  * fix double vulcan ammo.
21795  *
21796  * Revision 1.18  1994/10/20  09:49:05  mike
21797  * kill messages no one liked...*sniff* *sniff*
21798  *
21799  * Revision 1.17  1994/10/19  11:17:07  mike
21800  * Limit amount of player ammo.
21801  *
21802  * Revision 1.16  1994/10/12  08:04:18  mike
21803  * Fix proximity/homing confusion.
21804  *
21805  * Revision 1.15  1994/10/11  18:27:58  matt
21806  * Changed auto selection of secondary weapons
21807  *
21808  * Revision 1.14  1994/10/08  23:37:54  matt
21809  * Don't pick up weapons you already have; also fixed auto_select bug
21810  * for seconary weapons
21811  *
21812  * Revision 1.13  1994/10/08  14:55:47  matt
21813  * Fixed bug that selected vulcan cannon when picked up ammo, even though
21814  * you didn't have the weapon.
21815  *
21816  * Revision 1.12  1994/10/08  12:50:32  matt
21817  * Fixed bug that let you select weapons you don't have
21818  *
21819  * Revision 1.11  1994/10/07  23:37:56  matt
21820  * Made weapons select when pick up better one
21821  *
21822  * Revision 1.10  1994/10/07  16:02:08  matt
21823  * Fixed problem with weapon auto-select
21824  *
21825  * Revision 1.9  1994/10/05  17:00:20  matt
21826  * Made player_has_weapon() public and moved constants to header file
21827  *
21828  * Revision 1.8  1994/09/26  11:27:13  mike
21829  * Fix auto selection of weapon when you run out of ammo.
21830  *
21831  * Revision 1.7  1994/09/13  16:40:45  mike
21832  * Add rearm delay and missile firing delay.
21833  *
21834  * Revision 1.6  1994/09/13  14:43:12  matt
21835  * Added cockpit weapon displays
21836  *
21837  * Revision 1.5  1994/09/03  15:23:06  mike
21838  * Auto select next weaker weapon when one runs out, clean up code.
21839  *
21840  * Revision 1.4  1994/09/02  16:38:19  mike
21841  * Eliminate a pile of arrays, associate weapon data with Weapon_info.
21842  *
21843  * Revision 1.3  1994/09/02  11:57:10  mike
21844  * Add a bunch of stuff, I forget what.
21845  *
21846  * Revision 1.2  1994/06/03  16:26:32  john
21847  * Initial version.
21848  *
21849  * Revision 1.1  1994/06/03  14:40:43  john
21850  * Initial revision
21851
21852 ------------------------------------------------------------------------
21853 main/weapon.h:
21854
21855  * Revision 1.2  1995/09/14  14:07:10  allender
21856  * fixed prototypes to have return value
21857  *
21858  * Revision 1.1  1995/05/16  16:05:22  allender
21859  * Initial revision
21860  *
21861  * Revision 2.0  1995/02/27  11:31:10  john
21862  * New version 2.0, which has no anonymous unions, builds with
21863  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
21864  *
21865  * Revision 1.44  1995/01/30  17:14:18  mike
21866  * halve rate of vulcan ammo consumption.
21867  *
21868  * Revision 1.43  1995/01/19  17:45:04  mike
21869  * damage_force removed, that information coming from strength field.
21870  *
21871  * Revision 1.42  1995/01/05  15:46:11  john
21872  * Made weapons not rearm when starting a saved game.
21873  *
21874  * Revision 1.41  1995/01/04  12:20:27  john
21875  * Declearations to work better with game state save.
21876  *
21877  *
21878  * Revision 1.40  1994/12/13  12:54:16  mike
21879  * fix proximity, homing flags, backwards!
21880  *
21881  * Revision 1.39  1994/12/11  16:17:57  mike
21882  * change default weapon life so shots from ctrlcen on level 6 won't evaporate before they hit you.
21883  *
21884  * Revision 1.38  1994/12/09  19:55:26  matt
21885  * Added weapon name in "not available in shareware" message
21886  *
21887  * Revision 1.37  1994/12/07  12:55:27  mike
21888  * tweak vulcan amounts.
21889  *
21890  * Revision 1.36  1994/12/03  19:03:56  matt
21891  * Fixed vulcan ammo HUD message
21892  *
21893  * Revision 1.35  1994/12/02  15:05:02  matt
21894  * Fixed bogus weapon constants and arrays
21895  *
21896  * Revision 1.34  1994/11/29  14:26:05  john
21897  * Again.
21898  *
21899  * Revision 1.33  1994/11/29  14:13:47  adam
21900  * Changed the byte flash sound to short.
21901  *
21902  * Revision 1.32  1994/11/12  16:36:55  mike
21903  * default ammo stuff.
21904  *
21905  * Revision 1.31  1994/10/21  10:55:24  adam
21906  * upped MAX_WEAPON_TYPES to 30
21907  *
21908  * Revision 1.30  1994/10/19  11:16:37  mike
21909  * Limit ammo amounts.
21910  *
21911  * Revision 1.29  1994/10/12  08:05:04  mike
21912  * Clean up homing/proximity mess.
21913  *
21914  * Revision 1.28  1994/10/08  23:37:53  matt
21915  * Don't pick up weapons you already have; also fixed auto_select bug
21916  * for seconary weapons
21917  *
21918  * Revision 1.27  1994/10/07  23:37:56  matt
21919  * Made weapons select when pick up better one
21920  *
21921  * Revision 1.26  1994/10/07  16:02:17  matt
21922  * Fixed problem with weapon auto-select
21923  *
21924  * Revision 1.25  1994/10/05  17:07:44  matt
21925  * Made player_has_weapon() public and moved constants to header file
21926  *
21927  * Revision 1.24  1994/09/30  21:50:49  mike
21928  * Add homing_flag and 3 dummy bytes to weapon_info.
21929  *
21930  * Revision 1.23  1994/09/30  13:47:41  mike
21931  * Make speed and strength be difficulty level based.
21932  *
21933  * Revision 1.22  1994/09/20  16:10:13  mike
21934  * Prototype Primary_weapon_names and Secondary_weapon_names.
21935  *
21936  * Revision 1.21  1994/09/20  12:17:21  adam
21937  * upped weapon types
21938  *
21939  * Revision 1.20  1994/09/13  16:40:29  mike
21940  * Define REARM_TIME -- time it takes until you can fire a newly armed weapon.
21941  *
21942  * Revision 1.19  1994/09/13  14:43:03  matt
21943  * Added cockpit weapon displays
21944  *
21945  * Revision 1.18  1994/09/11  15:50:34  mike
21946  * Add matter and bounce to weapon_info.
21947  *
21948  * Revision 1.17  1994/09/10  17:32:17  mike
21949  * Add thrust to weapon_info.
21950  *
21951  * Revision 1.16  1994/09/09  20:04:54  mike
21952  * Add vclips for weapons.
21953  *
21954  * Revision 1.15  1994/09/07  15:59:14  mike
21955  * Add default lifetimes to weapons, destroyable, lifetime, damage_radius, damage_force fields to weapons.
21956  *
21957  * Revision 1.14  1994/09/03  15:18:06  mike
21958  * Add prototype for auto_select_weapon.
21959  *
21960  * Revision 1.13  1994/09/02  16:38:33  mike
21961  * Move data from global arrays to Weapon_info.
21962  *
21963  * Revision 1.12  1994/09/02  11:54:59  mike
21964  * Add a whole slew of constants for the whole slew of new weapons.
21965  *
21966  * Revision 1.11  1994/08/23  16:39:15  mike
21967  * Add light to weapon struct
21968
21969 ------------------------------------------------------------------------
21970 maths/fixc.c:
21971
21972  * Revision 1.7  1995/09/22  14:08:16  allender
21973  * fixed fix_atan2 to work correctly with doubles
21974  *
21975  * Revision 1.6  1995/08/31  15:43:49  allender
21976  * *** empty log message ***
21977  *
21978  * Revision 1.5  1995/07/05  16:15:15  allender
21979  * make fixmuldiv use doubles for PPC implementation
21980  *
21981  * Revision 1.4  1995/05/15  13:57:36  allender
21982  * make fixmuldiv compile when compiling under 68k
21983  *
21984  * Revision 1.3  1995/05/11  13:02:59  allender
21985  * some routines are now in assembly
21986  *
21987  * Revision 1.2  1995/05/04  20:04:45  allender
21988  * use MPW fixdiv if compiling with MPW (why did I do this?)
21989  *
21990  * Revision 1.1  1995/04/17  11:37:54  allender
21991  * Initial revision
21992  *
21993  *
21994  * --- PC RCS Info ---
21995  * Revision 1.1  1995/03/08  18:55:09  matt
21996  * Initial revision
21997
21998 ------------------------------------------------------------------------
21999 maths/tables.c:
22000
22001  * Revision 1.2  1995/08/31  15:44:36  allender
22002  * ..
22003  *
22004  * Revision 1.1  1995/04/17  11:38:04  allender
22005  * Initial revision
22006
22007 ------------------------------------------------------------------------
22008 maths/vecmat.c:
22009
22010  * Revision 1.5  1995/10/30  11:08:16  allender
22011  * fix check_vec to return if vector is the NULL vector
22012  *
22013  * Revision 1.4  1995/09/23  09:38:14  allender
22014  * removed calls for PPC that are now handled in asm
22015  *
22016  * Revision 1.3  1995/08/31  15:50:24  allender
22017  * fixing up of functions for PPC
22018  *
22019  * Revision 1.2  1995/07/05  16:40:21  allender
22020  * some vecmat stuff might be using isqrt -- commented out
22021  * for now
22022  *
22023  * Revision 1.1  1995/04/17  16:18:02  allender
22024  * Initial revision
22025  *
22026  *
22027  * --- PC RCS Information ---
22028  * Revision 1.1  1995/03/08  15:56:50  matt
22029  * Initial revision
22030
22031 ------------------------------------------------------------------------
22032 maths/vecmata.asm:
22033
22034 ; Revision 1.54  1995/01/31  00:14:50  matt
22035 ; Took out int3 from dotprod overflow, since it saturates now
22036 ;
22037 ; Revision 1.53  1994/12/14  18:29:33  matt
22038 ; Made dotprod overflow check stay in, and return saturated value
22039 ;
22040 ; Revision 1.52  1994/12/14  12:34:13  matt
22041 ; Disabled now-unused vector_2_matrix_norm()
22042 ;
22043 ; Revision 1.51  1994/12/13  16:55:13  matt
22044 ; Ripped out optimization from last version, which was bogus
22045 ;
22046 ; Revision 1.50  1994/12/13  14:55:18  matt
22047 ; Use quick normalize in a couple of places where it was safe to do so
22048 ;
22049 ; Revision 1.49  1994/12/13  14:44:12  matt
22050 ; Added vm_vector_2_matrix_norm()
22051 ;
22052 ; Revision 1.48  1994/12/13  13:26:49  matt
22053 ; Fixed overflow check
22054 ;
22055 ; Revision 1.47  1994/12/03  15:39:54  matt
22056 ; Gracefully handle some vector_2_matrix problems
22057 ;
22058 ; Revision 1.46  1994/11/19  17:15:05  matt
22059 ; Assemble out some code not used in DESCENT
22060 ;
22061 ; Revision 1.45  1994/11/17  11:41:05  matt
22062 ; Put handling in extract_angles_from_matrix to deal with bad matrices
22063 ;
22064 ; Revision 1.44  1994/11/16  11:48:10  matt
22065 ; Added error checking to vm_extract_angles_matrix()
22066 ;
22067 ; Revision 1.43  1994/09/19  22:00:10  matt
22068 ; Fixed register trash
22069 ;
22070 ; Revision 1.42  1994/09/11  19:23:05  matt
22071 ; Added vm_vec_normalized_dir_quick()
22072 ;
22073 ; Revision 1.41  1994/08/14  13:28:38  matt
22074 ; Put in check for zero-length vector in extract angles
22075 ;
22076 ; Revision 1.40  1994/07/19  18:52:53  matt
22077 ; Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
22078 ;
22079 ; Revision 1.39  1994/06/16  18:24:22  matt
22080 ; Added vm_vec_mag_quick()
22081 ;
22082 ; Revision 1.38  1994/06/10  23:18:38  matt
22083 ; Added new code for vm_vec_ang_2_matrix() which may be better, but may
22084 ; not be.
22085 ;
22086 ; Revision 1.37  1994/05/22  18:17:29  mike
22087 ; Optimize vm_vec_dist_quick, using jns in place of abs_eax.
22088 ;
22089 ; Revision 1.36  1994/05/19  12:07:04  matt
22090 ; Fixed globals and macros and added a constant
22091 ;
22092 ; Revision 1.35  1994/05/19  09:19:00  matt
22093 ; Made vm_vec_normalized_dir() return mag of vector
22094 ;
22095 ; Revision 1.34  1994/05/18  22:28:01  matt
22096 ; Added function vm_vec_normalized_dir()
22097 ; Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
22098 ; Added C global static vars vmd_zero_vector & vmd_identity_matrix
22099 ;
22100 ; Revision 1.33  1994/05/18  21:44:16  matt
22101 ; Added functions:
22102 ;   vm_extract_angles_vector()
22103 ;   vm_extract_angles_vector_normalized()
22104 ;   vm_vec_copy_normalize()
22105 ;
22106 ; Revision 1.32  1994/05/13  12:41:51  matt
22107 ; Added new function, vm_vec_dist_quick(), which does an approximation.
22108 ;
22109 ; Revision 1.31  1994/05/04  17:41:31  mike
22110 ; Comment out debug_brk on null vector.
22111 ;
22112 ; Revision 1.30  1994/04/15  21:41:31  matt
22113 ; Check for foward vector straigt up in extract angles routine
22114 ;
22115 ; Revision 1.29  1994/03/30  15:45:05  matt
22116 ; Added two functions, vm_vec_scale_add() & vm_vec_scale_add2()
22117 ;
22118 ; Revision 1.28  1994/02/26  19:23:35  matt
22119 ; Do an int3 when we get a null vector when computing surface normal
22120 ;
22121 ; Revision 1.27  1994/02/10  18:29:45  matt
22122 ; Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
22123 ;
22124 ; Revision 1.26  1994/02/10  18:28:55  matt
22125 ; Fixed bugs in extract angles function
22126 ;
22127 ; Revision 1.25  1994/01/31  22:46:07  matt
22128 ; Added vm_extract_angles_matrix() function
22129 ;
22130 ; Revision 1.24  1994/01/30  19:29:55  matt
22131 ; Put in debug_brk when vm_vec_2_matrix got zero-length vector
22132 ;
22133 ; Revision 1.23  1994/01/25  15:27:59  matt
22134 ; Added debugging check for dotprod overflow
22135 ;
22136 ; Revision 1.22  1994/01/24  11:52:59  matt
22137 ; Added checking for dest==src for several functions where this is not allowed
22138 ;
22139 ; Revision 1.21  1994/01/19  23:13:02  matt
22140 ; Fixed bug in vm_vec_ang_2_matrix()
22141 ;
22142 ; Revision 1.20  1994/01/04  12:33:43  mike
22143 ; Prevent divide overflow in vm_vec_scale2
22144 ;
22145 ; Revision 1.19  1993/12/21  19:46:26  matt
22146 ; Added function vm_dist_to_plane()
22147 ;
22148 ; Revision 1.18  1993/12/13  17:26:23  matt
22149 ; Added vm_vec_dist()
22150 ;
22151 ; Revision 1.17  1993/12/02  12:43:39  matt
22152 ; New functions: vm_vec_copy_scale(), vm_vec_scale2()
22153 ;
22154 ; Revision 1.16  1993/10/29  22:39:29  matt
22155 ; Changed matrix order, making direction vectors the rows
22156 ;
22157 ; Revision 1.15  1993/10/29  18:06:01  matt
22158 ; Fixed vm_vector_2_matrix() bug when forward vector was straight down
22159 ;
22160 ; Revision 1.14  1993/10/26  18:51:26  matt
22161 ; Fixed some register trashes in vm_vec_ang_2_matrix()
22162 ;
22163 ; Revision 1.13  1993/10/25  11:49:37  matt
22164 ; Made vm_vec_delta_ang() take optional forward vector to return signed delta
22165 ;
22166 ; Revision 1.12  1993/10/20  01:09:42  matt
22167 ; Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
22168 ;
22169 ; Revision 1.11  1993/10/17  17:03:08  matt
22170 ; vm_vector_2_matrix() now takes optional right vector
22171 ;
22172 ; Revision 1.10  1993/10/10  18:11:42  matt
22173 ; Changed angles_2_matrix so that heading & bank rotate in the
22174 ; correct directions.
22175 ;
22176 ; Revision 1.9  1993/09/30  16:17:59  matt
22177 ; Fixed bug in vector_2_matrix() by adding another normalize
22178 ;
22179 ; Revision 1.8  1993/09/29  10:51:58  matt
22180 ; Fixed bad register trashes in crossprod, perp, & normal
22181 ;
22182 ; Revision 1.7  1993/09/28  12:16:46  matt
22183 ; Fixed bugs in cross product
22184 ; Added func vm_vector_2_matrix()
22185 ;
22186 ; Revision 1.6  1993/09/24  21:19:37  matt
22187 ; Added vm_vec_avg() and vm_vec_avg4()
22188 ;
22189 ; Revision 1.5  1993/09/20  18:15:07  matt
22190 ; Trap zero-length vectors in vm_vec_normalize(), vm_vec_perp(), and vm_vec_normal()
22191 ;
22192 ; Revision 1.4  1993/09/20  14:56:43  matt
22193 ; Fixed bug in vm_vec_normal(), made that routine normalize the results,
22194 ; and added new function vm_vec_perp().
22195 ;
22196 ; Revision 1.3  1993/09/20  10:12:06  mike
22197 ; no changes
22198 ;
22199 ; Revision 1.2  1993/09/17  11:10:33  matt
22200 ; Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
22201 ;
22202 ; Revision 1.1  1993/09/16  20:10:24  matt
22203 ; Initial revision
22204
22205 ------------------------------------------------------------------------
22206 misc/args.c:
22207
22208  * Revision 2.0  1995/02/27  11:31:22  john
22209  * New version 2.0, which has no anonymous unions, builds with
22210  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
22211  *
22212  * Revision 1.9  1994/11/29  01:07:57  john
22213  * Took out some unused vars.
22214  *
22215  * Revision 1.8  1994/11/29  01:04:30  john
22216  * Took out descent.ini stuff.
22217  *
22218  * Revision 1.7  1994/09/20  19:29:15  matt
22219  * Made args require exact (not substring), though still case insensitive.
22220  *
22221  * Revision 1.6  1994/07/25  12:33:11  john
22222  * Network "pinging" in.
22223  *
22224  * Revision 1.5  1994/06/17  18:07:50  matt
22225  * Took out printf
22226  *
22227  * Revision 1.4  1994/05/11  19:45:33  john
22228  * *** empty log message ***
22229  *
22230  * Revision 1.3  1994/05/11  18:42:11  john
22231  * Added Descent.ini config file.
22232  *
22233  * Revision 1.2  1994/05/09  17:03:30  john
22234  * Split command line parameters into arg.c and arg.h.
22235  * Also added /dma, /port, /irq to digi.c
22236  *
22237  * Revision 1.1  1994/05/09  16:49:11  john
22238  * Initial revision
22239
22240 ------------------------------------------------------------------------
22241 misc/error.c:
22242
22243  * Revision 1.12  1994/12/07  18:49:39  matt
22244  * error_init() can now take NULL as parm
22245  *
22246  * Revision 1.11  1994/11/29  15:42:07  matt
22247  * Added newline before error message
22248  *
22249  * Revision 1.10  1994/11/27  23:20:39  matt
22250  * Made changes for new mprintf calling convention
22251  *
22252  * Revision 1.9  1994/06/20  21:20:56  matt
22253  * Allow NULL for warn func, to kill warnings
22254  *
22255  * Revision 1.8  1994/05/20  15:11:35  mike
22256  * mprintf Warning message so you can actually see it.
22257  *
22258  * Revision 1.7  1994/02/10  18:02:38  matt
22259  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
22260  *
22261  * Revision 1.6  1993/10/17  18:19:10  matt
22262  * If error_init() not called, Error() now prints the error message before
22263  * calling exit()
22264  *
22265  * Revision 1.5  1993/10/14  15:29:11  matt
22266  * Added new function clear_warn_func()
22267  *
22268  * Revision 1.4  1993/10/08  16:17:19  matt
22269  * Made Assert() call function _Assert(), rather to do 'if...' inline.
22270  *
22271  * Revision 1.3  1993/09/28  12:45:25  matt
22272  * Fixed wrong print call, and made Warning() not append a CR to string
22273  *
22274  * Revision 1.2  1993/09/27  11:46:35  matt
22275  * Added function set_warn_func()
22276  *
22277  * Revision 1.1  1993/09/23  20:17:33  matt
22278  * Initial revision
22279
22280 ------------------------------------------------------------------------
22281 texmap/ntmap.c:
22282
22283  * Revision 1.52  1995/03/14  15:13:06  john
22284  * Increased MAX_Y_Pointers to 480.
22285  *
22286  * Revision 1.51  1995/02/23  14:25:09  john
22287  * Added editor tmap.
22288  *
22289  * Revision 1.50  1995/02/20  18:22:58  john
22290  * Put all the externs in the assembly modules into tmap_inc.asm.
22291  * Also, moved all the C versions of the inner loops into a new module,
22292  * scanline.c.
22293  *
22294  * Revision 1.49  1995/02/20  17:09:11  john
22295  * Added code so that you can build the tmapper with no assembly!
22296  *
22297  * Revision 1.48  1995/01/06  11:11:30  mike
22298  * even when not in editor, have 400 lines in texture map scanline table.
22299  *
22300  * Revision 1.47  1994/12/15  16:43:25  matt
22301  * Took out code only needed by editor
22302  *
22303  * Revision 1.46  1994/12/09  22:35:37  mike
22304  * fix bug in before call to asm_tmap_scanline_per causing write of pixel onto past right border onto left.
22305  *
22306  * Revision 1.45  1994/12/06  16:31:06  mike
22307  * fix bug in asm_tmap_scanline_matt interface.
22308  *
22309  * Revision 1.44  1994/12/04  20:37:18  mike
22310  * *** empty log message ***
22311  *
22312  * Revision 1.43  1994/12/02  23:30:04  mike
22313  * optimizations.
22314  *
22315  * Revision 1.42  1994/11/30  00:57:43  mike
22316  * optimizations.
22317  *
22318  * Revision 1.41  1994/11/28  13:34:27  mike
22319  * optimizations.
22320  *
22321  * Revision 1.40  1994/11/28  01:30:01  mike
22322  * kill warning.
22323  *
22324  * Revision 1.39  1994/11/28  01:28:59  mike
22325  * optimizations.
22326  *
22327  * Revision 1.38  1994/11/21  14:08:07  john
22328  * Took out all multiple instead of divide code.
22329  *
22330  * Revision 1.37  1994/11/19  15:21:52  mike
22331  * rip out unused code.
22332  *
22333  * Revision 1.36  1994/11/14  11:42:51  mike
22334  * optimization.
22335  *
22336  * Revision 1.35  1994/11/12  16:41:36  mike
22337  * *** empty log message ***
22338  *
22339  * Revision 1.34  1994/11/10  21:28:41  mike
22340  * remove call to init_interface_vars_to_assembler.
22341  *
22342  * Revision 1.33  1994/11/10  11:08:59  mike
22343  * detail level stuff.
22344  *
22345  * Revision 1.32  1994/11/09  22:55:52  matt
22346  * Added variable Current_seg_depth for detail level optimization
22347  *
22348  * Revision 1.31  1994/11/09  19:57:31  john
22349  * Added texture rle caching.
22350  *
22351  * Revision 1.30  1994/11/09  19:54:48  mike
22352  * Call flat shader if Tmap_flat_flag set.
22353  *
22354  * Revision 1.29  1994/11/02  21:33:31  john
22355  * Added Burger Bill's optimization, ie.. 2 muls per 8 pixels.
22356  *
22357  * Revision 1.28  1994/11/02  11:32:16  john
22358  * Added code for c callable inner loop and code to
22359  * test dividing out z0.
22360  *
22361  * Revision 1.27  1994/10/28  20:54:32  matt
22362  * Added error checking
22363  *
22364  * Revision 1.26  1994/10/25  11:20:20  mike
22365  * fix bug in lighting overflow checking for one scanline tall linear texture maps.
22366  *
22367  * Revision 1.25  1994/08/03  15:40:33  mike
22368  * Prevent divide overflows, decrease occurrence of precision-caused glitches.
22369  *
22370  * Revision 1.24  1994/07/27  09:31:16  mike
22371  * Fix concave texture map problem, decrease occurrence of unimportant int 3.
22372  *
22373  * Revision 1.23  1994/06/17  12:23:31  mike
22374  * Support non-lighted texture maps.
22375  *
22376  * Revision 1.22  1994/06/11  08:10:24  mike
22377  * Fix mysterious hang bug, lighting value was out of range.
22378  *
22379  * Revision 1.21  1994/06/09  16:10:16  mike
22380  * Change SC2000 from constant to variable.
22381
22382 ------------------------------------------------------------------------
22383 texmap/scanline.c:
22384
22385  * Revision 1.2  1995/02/20  18:23:39  john
22386  * Added new module for C versions of inner loops.
22387  *
22388  * Revision 1.1  1995/02/20  17:42:27  john
22389  * Initial revision
22390
22391 ------------------------------------------------------------------------
22392 texmap/scanline.h:
22393
22394  * Revision 1.2  1995/02/20  18:23:40  john
22395  * Added new module for C versions of inner loops.
22396  *
22397  * Revision 1.1  1995/02/20  17:44:16  john
22398  * Initial revision
22399
22400 ------------------------------------------------------------------------
22401 texmap/texmapl.h:
22402
22403  * Revision 1.14  1995/02/20  18:23:02  john
22404  * Put all the externs in the assembly modules into tmap_inc.asm.
22405  * Also, moved all the C versions of the inner loops into a new module,
22406  * scanline.c.
22407  *
22408  * Revision 1.13  1995/02/20  17:09:16  john
22409  * Added code so that you can build the tmapper with no assembly!
22410  *
22411  * Revision 1.12  1994/11/28  13:34:34  mike
22412  * optimizations.
22413  *
22414  * Revision 1.11  1994/11/12  16:41:27  mike
22415  * function prototype.
22416  *
22417  * Revision 1.10  1994/05/24  17:30:00  mike
22418  * Prototype fix_recip, asm_tmap_scanline_lin_v.
22419  *
22420  * Revision 1.9  1994/04/21  15:04:26  mike
22421  * Add prototype for texmapl.h
22422  *
22423  * Revision 1.8  1994/03/31  08:34:53  mike
22424  * *** empty log message ***
22425  *
22426  * Revision 1.7  1994/03/22  20:37:04  mike
22427  * *** empty log message ***
22428  *
22429  * Revision 1.6  1994/03/14  15:43:03  mike
22430  * streamline code.
22431  *
22432  * Revision 1.5  1994/01/31  15:43:18  mike
22433  * window_height, asm_tmap_scanline_lin_sky_v
22434  *
22435  * Revision 1.4  1994/01/21  21:12:27  mike
22436  * Prototype asm_tmap_scanline_lin_sky
22437  *
22438  * Revision 1.3  1994/01/14  14:01:45  mike
22439  * Add a bunch of variables.
22440  *
22441  * Revision 1.2  1993/11/22  10:25:11  mike
22442  * *** empty log message ***
22443  *
22444  * Revision 1.1  1993/09/08  17:29:13  mike
22445  * Initial revision
22446
22447 ------------------------------------------------------------------------
22448 texmap/tmap_flt.asm:
22449
22450 ; Revision 1.10  1995/02/20  18:22:53  john
22451 ; Put all the externs in the assembly modules into tmap_inc.asm.
22452 ; Also, moved all the C versions of the inner loops into a new module,
22453 ; scanline.c.
22454 ;
22455 ; Revision 1.9  1995/02/20  17:08:51  john
22456 ; Added code so that you can build the tmapper with no assembly!
22457 ;
22458 ; Revision 1.8  1994/12/02  23:29:21  mike
22459 ; change jb/ja to jl/jg.
22460 ;
22461 ; Revision 1.7  1994/11/12  16:39:35  mike
22462 ; jae to ja.
22463 ;
22464 ; Revision 1.6  1994/08/09  11:27:53  john
22465 ; Added cthru mode.
22466 ;
22467 ; Revision 1.5  1994/07/08  17:43:11  john
22468 ; Added flat-shaded-zbuffered polygon.
22469 ;
22470 ; Revision 1.4  1994/04/08  16:25:43  mike
22471 ; optimize inner loop of flat shader.
22472 ;
22473 ; Revision 1.3  1994/03/31  08:34:20  mike
22474 ; Optimized (well, speeded-up) inner loop for tmap-based flat shader.
22475 ;
22476 ; Revision 1.2  1993/11/22  10:24:57  mike
22477 ; *** empty log message ***
22478 ;
22479 ; Revision 1.1  1993/09/08  17:29:46  mike
22480 ; Initial revision
22481
22482 ------------------------------------------------------------------------
22483 texmap/tmap_inc.asm:
22484
22485 ; Revision 1.10  1995/02/20  18:22:52  john
22486 ; Put all the externs in the assembly modules into tmap_inc.asm.
22487 ; Also, moved all the C versions of the inner loops into a new module,
22488 ; scanline.c.
22489 ;
22490 ; Revision 1.9  1994/12/02  23:29:45  mike
22491 ; Add y_pointers.
22492 ;
22493 ; Revision 1.8  1994/11/12  16:39:36  mike
22494 ; jae to ja.
22495 ;
22496 ; Revision 1.7  1994/10/26  23:27:39  john
22497 ; Took out references to gr_inverse_table.
22498 ;
22499 ; Revision 1.6  1994/10/26  23:21:55  mike
22500 ; kill unused stuff.
22501 ;
22502 ; Revision 1.5  1994/07/27  18:39:20  john
22503 ; Took out references to blend table
22504 ;
22505 ; Revision 1.4  1994/01/31  15:40:17  mike
22506 ; Add window_height.
22507 ;
22508 ; Revision 1.3  1993/12/07  12:27:48  john
22509 ; Moved bmd_palette to gr_palette
22510 ;
22511 ; Revision 1.2  1993/11/22  10:24:10  mike
22512 ; *** empty log message ***
22513 ;
22514 ; Revision 1.1  1993/09/08  17:29:47  mike
22515 ; Initial revision
22516
22517 ------------------------------------------------------------------------
22518 texmap/tmap_lin.asm:
22519
22520 ; Revision 1.3  1995/02/20  18:22:57  john
22521 ; Put all the externs in the assembly modules into tmap_inc.asm.
22522 ; Also, moved all the C versions of the inner loops into a new module,
22523 ; scanline.c.
22524 ;
22525 ; Revision 1.2  1995/02/20  17:09:10  john
22526 ; Added code so that you can build the tmapper with no assembly!
22527 ;
22528 ; Revision 1.1  1994/11/30  12:24:04  mike
22529 ; Initial revision
22530 ;
22531 ; Revision 1.6  1994/11/12  16:39:40  mike
22532 ; jae to ja.
22533 ;
22534 ; Revision 1.5  1994/02/10  21:24:43  matt
22535 ; Got rid of debug_on set
22536 ;
22537 ; Revision 1.4  1994/01/31  15:39:53  mike
22538 ; Write additional inner loop for transparency.
22539 ;
22540 ; Revision 1.3  1994/01/26  11:50:04  john
22541 ; Added transparency to linear unlighted texture mapper.
22542 ;
22543 ; Revision 1.2  1993/11/22  10:24:36  mike
22544 ; *** empty log message ***
22545 ;
22546 ; Revision 1.1  1993/09/08  17:29:50  mike
22547 ; Initial revision
22548
22549 ------------------------------------------------------------------------
22550 texmap/tmap_ll.asm:
22551
22552 ; Revision 1.10  1995/02/20  18:22:54  john
22553 ; Put all the externs in the assembly modules into tmap_inc.asm.
22554 ; Also, moved all the C versions of the inner loops into a new module,
22555 ; scanline.c.
22556 ;
22557 ; Revision 1.9  1995/02/20  17:09:06  john
22558 ; Added code so that you can build the tmapper with no assembly!
22559 ;
22560 ; Revision 1.8  1994/11/19  23:52:56  mike
22561 ; rip out big unrolled loop to save 25K....remember when we cared more about speed?
22562 ;
22563 ; Revision 1.7  1994/11/12  16:39:41  mike
22564 ; jae to ja.
22565 ;
22566 ; Revision 1.6  1994/03/14  15:45:08  mike
22567 ; streamline code.
22568 ;
22569 ; Revision 1.5  1994/01/24  13:13:12  mike
22570 ; dithering.
22571 ;
22572 ; Revision 1.4  1994/01/14  14:02:47  mike
22573 ; *** empty log message ***
22574 ;
22575 ; Revision 1.3  1993/12/17  20:00:16  mike
22576 ; Change default setting of dither_intensity_lighting from 1 to 0
22577 ;
22578 ; Revision 1.2  1993/11/22  10:24:50  mike
22579 ; *** empty log message ***
22580 ;
22581 ; Revision 1.1  1993/09/08  17:29:52  mike
22582 ; Initial revision
22583
22584 ------------------------------------------------------------------------
22585 texmap/tmap_per.asm:
22586
22587 ; Revision 1.26  1995/02/20  18:22:55  john
22588 ; Put all the externs in the assembly modules into tmap_inc.asm.
22589 ; Also, moved all the C versions of the inner loops into a new module,
22590 ; scanline.c.
22591 ;
22592 ; Revision 1.25  1995/02/20  17:09:08  john
22593 ; Added code so that you can build the tmapper with no assembly!
22594 ;
22595 ; Revision 1.24  1995/01/10  09:32:07  mike
22596 ; mostly fix garbage at end of scanline, but slow down by 1-4%.
22597 ;
22598 ; Revision 1.23  1994/12/02  23:29:57  mike
22599 ; optimizations.
22600 ;
22601 ; Revision 1.22  1994/11/30  00:57:00  mike
22602 ; optimization.
22603 ;
22604 ; Revision 1.21  1994/11/21  13:57:42  mike
22605 ; fix right side shear bug
22606 ;
22607 ; Revision 1.20  1994/11/12  16:41:09  mike
22608 ; jae -> ja.
22609 ;
22610 ; Revision 1.19  1994/10/27  19:40:00  john
22611 ; Made lighting table lookup be _gr_fade_table[eax] instead
22612 ; of fs:[eax], which gets rig of a segment override that
22613 ; supposedly costs 1 clock on a 486.  Mainly, I wanted to verify
22614 ; that the only reason we need selectors is for the source texture
22615 ; data .
22616 ;
22617 ; Revision 1.18  1994/05/03  11:08:32  mike
22618 ; Trap divide overflows.
22619 ;
22620 ; Revision 1.17  1994/04/21  15:03:41  mike
22621 ; make faster.
22622 ;
22623 ; Revision 1.16  1994/04/08  16:46:57  john
22624 ; Made 32 fade levels. Hacked.
22625 ;
22626 ; Revision 1.15  1994/03/31  08:35:18  mike
22627 ; Fix quantized-by-4 bug in inner loop.
22628 ;
22629 ; Revision 1.14  1994/03/14  17:41:14  mike
22630 ; Fix bug in unlighted version.
22631 ;
22632 ; Revision 1.13  1994/03/14  15:45:14  mike
22633 ; streamline code.
22634 ;
22635 ; Revision 1.12  1994/01/14  14:01:58  mike
22636 ; *** empty log message ***
22637 ;
22638 ; Revision 1.11  1993/12/18  14:43:44  john
22639 ; Messed around with doing 1/z, the u*(1/z) and v*(1/z)
22640 ; (Went from 23 fps to 21 fps... not good! )
22641 ;
22642 ; Revision 1.10  1993/12/17  16:14:17  john
22643 ; Split lighted/nonlighted, so there is no cmp lighting
22644 ; in the inner loop.
22645 ;
22646 ; Revision 1.9  1993/12/17  12:34:29  john
22647 ; Made leftover bytes use linear approx instead of correct...
22648 ; should save about 8 divides per scanline on average.
22649 ; Also, took out anti-aliasing code and rearranged to
22650 ; order of some instructions to help on 486 pipelining.
22651 ; (The anti-aliasing code did *not* look good, so I
22652 ; figure there was no reason to keep it in. )
22653 ;
22654 ; Revision 1.8  1993/12/16  18:37:52  mike
22655 ; Align some stuff on 4 byte boundaries.
22656 ;
22657 ; Revision 1.7  1993/11/30  08:44:18  john
22658 ; Made selector set check for < 64*64 bitmaps.
22659 ;
22660 ; Revision 1.6  1993/11/23  17:25:26  john
22661 ; Added safety "and eax, 0fffh" in lighting lookup.
22662 ;
22663 ; Revision 1.5  1993/11/23  15:08:52  mike
22664 ; Fixed lighting bug.
22665 ;
22666 ; Revision 1.4  1993/11/23  14:38:50  john
22667 ; optimized NORMAL code by switching EBX and ESI, so BH can be used in
22668 ; the lighting process.
22669 ;
22670 ; Revision 1.3  1993/11/23  14:30:53  john
22671 ; Made the perspective tmapper do 1/8 divides; added lighting.
22672 ;
22673 ; Revision 1.2  1993/11/22  10:24:59  mike
22674 ; *** empty log message ***
22675 ;
22676 ; Revision 1.1  1993/09/08  17:29:53  mike
22677 ; Initial revision
22678
22679 ------------------------------------------------------------------------
22680 texmap/tmapfade.asm:
22681
22682 ; Revision 1.6  1995/02/20  18:23:01  john
22683 ; Put all the externs in the assembly modules into tmap_inc.asm.
22684 ; Also, moved all the C versions of the inner loops into a new module,
22685 ; scanline.c.
22686 ;
22687 ; Revision 1.5  1995/02/20  17:09:15  john
22688 ; Added code so that you can build the tmapper with no assembly!
22689 ;
22690 ; Revision 1.4  1994/12/02  23:29:36  mike
22691 ; change jb/ja to jl/jg.
22692 ;
22693 ; Revision 1.3  1994/11/30  00:57:36  mike
22694 ; *** empty log message ***
22695 ;
22696 ; Revision 1.2  1994/10/06  18:38:49  john
22697 ; Added the ability to fade a scanline by calling gr_upoly_tmap
22698 ; with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
22699 ;
22700 ; Revision 1.1  1994/10/06  18:04:42  john
22701 ; Initial revision
22702
22703 ------------------------------------------------------------------------
22704 texmap/tmapflat.c:
22705
22706  * Revision 1.13  1995/02/20  18:23:24  john
22707  * Added new module for C versions of inner loops.
22708  *
22709  * Revision 1.12  1995/02/20  17:09:17  john
22710  * Added code so that you can build the tmapper with no assembly!
22711  *
22712  * Revision 1.11  1994/11/30  00:58:01  mike
22713  * optimizations.
22714  *
22715  * Revision 1.10  1994/11/28  13:34:32  mike
22716  * optimizations.
22717  *
22718  * Revision 1.9  1994/11/19  15:21:46  mike
22719  * rip out unused code.
22720  *
22721  * Revision 1.8  1994/11/12  16:41:41  mike
22722  * *** empty log message ***
22723  *
22724  * Revision 1.7  1994/11/09  23:05:12  mike
22725  * do lighting on texture maps which get flat shaded instead.
22726  *
22727  * Revision 1.6  1994/10/06  19:53:07  matt
22728  * Added function that takes same parms as draw_tmap(), but renders flat
22729  *
22730  * Revision 1.5  1994/10/06  18:38:12  john
22731  * Added the ability to fade a scanline by calling gr_upoly_tmap
22732  * with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
22733  *
22734  * Revision 1.4  1994/05/25  18:46:32  matt
22735  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
22736  *
22737  * Revision 1.3  1994/04/08  16:25:58  mike
22738  * Comment out some includes (of header files)
22739  * call init_interface_vars_to_assembler.
22740  *
22741  * Revision 1.2  1994/03/31  08:33:44  mike
22742  * Fixup flat shading version of texture mapper (get it?)
22743  * (Or maybe not, I admit to not testing my code...hahahah!)
22744  *
22745  * Revision 1.1  1993/09/08  17:29:10  mike
22746  * Initial revision
22747 ------------------------------------------------------------------------