-
Notifications
You must be signed in to change notification settings - Fork 252
/
Copy pathinit.cpp
2158 lines (1941 loc) · 59 KB
/
init.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Descent 3
* Copyright (C) 2024 Parallax Software
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
--- HISTORICAL COMMENTS FOLLOW ---
* $Logfile: /DescentIII/Main/init.cpp $
* $Revision: 323 $
* $Date: 10/22/01 12:42p $
* $Author: Matt $
*
* Initialization of D3 systems
*
* $Log: /DescentIII/Main/init.cpp $
*
* 323 10/22/01 12:42p Matt
* Added MercInstalled() function.
*
* 322 10/03/01 12:45a Kevin
* Smaller version of pxo packets
*
* 321 9/15/01 1:46p Kevin
* Added -nocrashbox to suppress crash dialog box
*
* 320 9/14/01 4:47p Matt
* Cleaned up problems when screen bit depth set to 32.
*
* 319 9/14/01 12:50p Matt
* Took out code that bashed the missile view ot left if it was set to
* center. It's now not possible to set the view to center in the config
* menu.
*
* 318 4/19/00 5:36p Matt
* Added command-line option to adjust mouse sensitivity
*
* 317 3/20/00 12:11p Matt
* Merge of Duane's post-1.3 changes.
* Misc Mac stuff: movie, int'l keyboards, loading screens (Mac only)
*
* 316 1/26/00 9:20p Jeff
* added support for IntelliVIBE DLL
*
* 315 12/01/99 3:58p Jeff
* one last time...linux pregamecdcheck bug fix
*
* 314 12/01/99 3:30p Jeff
* set CD_inserted to 1 for Linux
*
* 313 11/30/99 5:07p Jeff
* no pregame cd check for Linux (for now)
*
* 312 10/26/99 3:30p Jeff
* handle extra.gam addon tablefile
*
* 311 10/25/99 3:09p Kevin
* added -mlooksens
*
* 310 10/25/99 9:48a Matt
* Mac code that should enable the dynamic allocation of lightmap_info
* structures. This should be disabled for editor builds.
*
* 309 10/25/99 12:47a Chris
* Fixed a long overdue bug with zero rad wall collison objects and
* colliding
*
* 308 10/22/99 10:52p Matt
* Mac merge
*
* 307 10/22/99 10:43p Jeff
* put in a variable to detect whether we are running the editor (needed
* in manage system, which can't use EDITOR define)
*
* 306 10/19/99 4:55p Jeff
* removed compiler warning
*
* 305 10/19/99 12:44p Chris
* Fixed a small bug with the registery check
*
* 304 10/18/99 1:59p Chris
* Added the ability to load the merc. hog
*
* 303 10/17/99 3:55p Jeff
* Linux movie stuff
*
* 302 10/12/99 11:03a Jeff
* if there is a -mission command line option, open that mn3 right after
* d3.hog for any overridables
*
* 301 10/06/99 2:04p Kevin
* copy protection fix to match the 1.2 full cd
*
* 300 10/05/99 10:11a Kevin
* Don't show tantrum logo on macintosh demo (per GraphSim's Request)
*
* 299 10/05/99 9:46a Kevin
* copy protection can now handle US/AUS & ROW no LL versions in one exe
*
* 298 9/29/99 8:05a Kevin
* Changes to copy protection to allow for us and ROW-NONLL versions to
* use the same exe
*
* 297 9/24/99 12:01p Samir
* use directinput when -alternatejoy is selected (like 1.0)
*
* 296 9/23/99 2:59p Kevin
* mac dll hog file
*
* 295 9/20/99 5:35p Jeff
* added -nosparkles command line option to turn off powerup sparkles
*
* 294 9/18/99 9:21p Jeff
* Init motion blur if we are a Katmai
*
* 293 8/20/99 9:45a Kevin
* Rankings changes!
*
* 292 7/30/99 5:24p Samir
* use no joystick emulation by default.
*
* 291 7/29/99 12:27p Chris
* FIxed a mismatched paren
*
* 290 7/28/99 5:11p Kevin
* Mac merges
*
* 289 7/26/99 5:19p Kevin
* fixed copy protection for DVD drives
*
* 288 7/12/99 6:44p Jeff
* create a lock file in the temp directory, if one already exists (for a
* program in use), then don't allow the use of the temp directory
*
* 287 7/08/99 5:44p Jason
* added default framecap of 60 to deal with stuttering issues
*
* 286 7/06/99 5:54p Kevin
* more foriegn versions....
*
* 285 6/24/99 8:10p Jeff
* added support for OpenGL renderer
*
* 284 6/24/99 3:15p Jeff
* don't check renderer in Linux if dedicated
*
* 283 6/22/99 7:03p Jeff
* added command line arguments to set renderer for Linux (Glide only
* right now)
*
* 282 6/21/99 2:12p Kevin
* South american version changes
*
* 281 6/17/99 11:34a Kevin
*
* 280 6/16/99 12:04p Kevin
* Warning!!! This is a laserlocked version!
*
* 279 6/11/99 1:15a Samir
* localization issues.
*
* 278 6/08/99 1:00p Jason
* changes for bumpmapping
*
* 277 6/03/99 8:48a Kevin
* fixes for new OEM version....
*
* 276 5/24/99 6:20a Kevin
* fixed dedicated server & copy protection
*
* 275 5/24/99 2:13a Matt
* Fixed -superlowmem switch.
*
* 274 5/23/99 3:03p Kevin
* real dist. checksums
*
* 273 5/23/99 2:38a Kevin
* Lame ass(tm) copy protection
*
* 272 5/21/99 10:05a Kevin
* Added stuff for a future DVD version
*
* 271 5/19/99 11:47a Kevin
* made the parent window of the message box actually be Descent 3.
*
* 270 5/18/99 10:31a Kevin
* made the us version only work with US english and US canadian languages
*
* 269 5/12/99 2:24p Jeff
* Descent3 now has a setable temp directory for all temp files
*
* 268 5/12/99 1:18p Samir
* play music during game too when in menus.
*
* 267 5/11/99 1:19a Samir
* upped music volume, set default to 0.5
*
* 266 5/10/99 9:25p Jeff
* first phase of Rock 'n' Ride support added
*
* 265 5/10/99 8:49p Jason
* added vsync command line switch
*
* 264 5/10/99 5:35p Kevin
* New command line options for heat and scoring API enhancements
*
* 263 5/07/99 6:54p Jason
* fixed some gamegauge issues
*
* 262 5/07/99 12:04p Samir
* added support for foreign keyboards and error text.
*
* 261 5/06/99 6:11p Kevin
* fixes for save/load game syste. Also require CD again and added some
* heat.net stuff
*
* 260 5/05/99 11:16p Kevin
* heat.net stuff among other things
*
* 259 5/05/99 5:46p Samir
* took out call to ResumeSounds when restoring from an Alt-tab.
*
* 258 5/02/99 9:13a Jeff
* added system specific hog files (d3-linux.hog for Linux)
*
* 257 5/01/99 4:24p Jeff
* fixed some windows specific code for Linux (*grrrr*)
*
* 256 4/30/99 10:53p Samir
* store pilot settings in a temporary buffer when multitasking.
*
* 255 4/30/99 5:06p Kevin
* misc dedicated server, networking and low memory enhancements
*
* 254 4/29/99 10:01p Samir
* use emulation mode of joystick first.
*
* 253 4/29/99 5:53p Kevin
* Made it so Japanese people can't play D3... well that is only if their
* computers have the Japanese language installed. I'm not prejudice or
* anything....It's just that Interplay doesn't want the english version
* selling in Japan or something like that. :)
*
* 252 4/29/99 2:28p Kevin
* Laserlock implementation
*
* 251 4/27/99 9:59p Kevin
* CD not requred for dedicated server. Also improved demo playback
*
* 250 4/27/99 2:10p Samir
* added code to set the desired sound card given the descriptive name of
* a sound card.
*
* 249 4/26/99 9:11p Matt
* Use small font instead of old UI font.
*
* 248 4/26/99 11:34a Samir
* don't resume sounds if game was paused when alt-tabbing back
* (ResumeGame will do the trick.)
*
* 247 4/25/99 6:14p Kevin
* added "-timetest file.dem" to behave like gamegauge does
*
* 246 4/25/99 4:15p Matt
* Added code to manually allow the user to specifiy the screen aspect
* ratio, to make the game work with wide-screen TVs.
*
* 245 4/25/99 1:27p Matt
* Fixed small bug
*
* 244 4/22/99 9:53a Kevin
* Fixed some dedicated server crashes
*
* 243 4/20/99 11:44a Jeff
* get the language type from the registry
*
* 242 4/17/99 7:42p Samir
* Don't save out renderer and sound mixer in release version since the
* launcher should only do this.
*
* 241 4/17/99 6:15p Samir
* replaced gr.h with grdefs.h and fixed resulting compile bugs.
*
* 240 4/16/99 12:03a Jeff
* removed cd check for Linux
*
* 239 4/15/99 3:48p Samir
* set mouse mode when ddio is initialized.
*
* 238 4/15/99 2:32p Kevin
* Added some code for the Demo
*
* 237 4/15/99 10:57a Kevin
* cd check only in release builds
*
* 236 4/15/99 9:25a Kevin
* CD check fixes and updates
*
* 235 4/14/99 3:07p Kevin
* Fixed some multiple CD bugs
*
* 234 4/14/99 12:35p Samir
* localization issues.
*
* 233 4/14/99 11:48a Matt
* Don't set messagebox title for release builds
*
* 232 4/14/99 2:50a Jeff
* fixed some case mismatched #includes
*
* 231 4/12/99 7:15p Samir
* added ability to configure number of sounds played at one time.
*
* 230 4/09/99 12:02p Samir
* joystick changes (Win32 DirectInput support)
*
* 229 4/06/99 4:15p Nate
* Fixed UpdateInitMessage in editor (samir)
*
* 228 4/06/99 1:53p Samir
* added improved progress bar.
*
* 227 4/05/99 9:53a Kevin
* Took out the splash screens Craig made me add while he was smoking
* crack.
*
* 226 4/04/99 8:15p Jeff
* added debug graph stuff
*
* 225 4/03/99 1:24p Jason
* changed some wording for loading screen
*
* 224 4/02/99 7:04p Kevin
* Added splash screens do release builds
*
* 223 4/02/99 5:08p Matt
* Added intro movie.
*
* 222 4/02/99 3:49p Kevin
* Added profanity filter code
*
* 221 4/02/99 1:26p Matt
* Changes I made for the OEM version but forgot to check in. Oops.
*
* 220 3/19/99 4:08p Kevin
* Multiple CD installation support
*
* 219 3/09/99 12:34p Jeff
* extract scripts to custom\cache
*
* 218 3/08/99 3:29p Samir
* RestartD3 ddio_Init key emulation = true.
*
* 217 3/05/99 5:23p Jeff
* extract scripts from extra.hog before d3.hog
*
* 216 3/04/99 1:15p Jeff
* erase temporary files that may have been left over from last run
*
* 215 3/02/99 5:21p Jason
* fixed some flip bugs
*
* 214 3/02/99 2:21p Samir
* windows 95 and NT both use same keyboard handler due to flaky
* directinput.
*
* 213 3/02/99 1:49a Mark
* put ifdefs around showstaticscreen
*
* 212 3/02/99 12:16a Jeff
*
* 211 3/02/99 12:06a Kevin
*
* 210 3/01/99 11:48p Jeff
* fixed prototype placement
*
* 209 3/01/99 11:47p Kevin
*
* 208 3/01/99 11:38p Kevin
*
* 207 3/01/99 9:03p Kevin
* OEM Beta 4
*
* 206 2/19/99 10:31p Samir
* added music volume.
*
* 205 2/17/99 12:38p Kevin
* Added -framecap <fps> to limit frame and fixed timer bug and old
* framerate limiter code.
*
* 204 2/16/99 12:00p Samir
* added new video resolution swtich test.
*
* 203 2/16/99 12:36a Kevin
* Fixes for release builds of OEM V3 and KAtmai
*
* 202 2/15/99 3:24p Kevin
*
* 201 2/15/99 3:23p Kevin
* Disabled procedurals for gamegauge
*
* 200 2/15/99 3:20p Kevin
* Fixed bug with dlls in a hog
*
* 199 2/15/99 1:22p Kevin
* Changes for GameGauge
*
* 198 2/11/99 10:35p Jeff
* added support for multiple languages in string table files
*
* 197 2/10/99 3:29p Jeff
* extracted dll manager knows difference between game hogs and miission
* hogs
*
* 196 2/09/99 1:29a Jeff
* added code to let D3 process multiplayer games in the background if
* game is not in focus.
*
* 195 2/08/99 2:24p Kevin
* Display bundler.mve and bundler.tga if they are included in the OEM
* package.
*
* 194 2/05/99 7:23p Kevin
* OEM Changes
*
* 193 2/04/99 9:46a Kevin
* OEM version changes
*
* 192 1/31/99 8:51p Jeff
* new in game cinematics system finished
*
* 191 1/29/99 5:22p Jeff
* localization
*
* 190 1/27/99 6:08p Jason
* first pass at markers
*
* 189 1/27/99 2:58p Jason
* fixed center small view
*
* 188 1/25/99 6:47p Samir
* allow slow keyboard
*
* 187 1/25/99 11:02a Samir
* revamped mouse and key controls.
*
* 186 1/25/99 12:33a Jeff
* save out scorch marks and weapon corona detail settings
*
* 185 1/21/99 11:15p Jeff
* pulled out some structs and defines from header files and moved them
* into separate header files so that multiplayer dlls don't require major
* game headers, just those new headers. Side effect is a shorter build
* time. Also cleaned up some header file #includes that weren't needed.
* This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
* manage.h and multi.h
*
* 184 1/17/99 10:41p Kevin
* Added command line options for setting the renderer in GAMEGAUGE mode.
*
* 183 1/13/99 3:25p Jason
* fixed vsync problem
*
* 182 1/08/99 2:58p Kevin
* Added TCP mprintf support so you can log to a remote machine.
*
* 181 1/08/99 2:55p Samir
* Ripped out OSIRIS1.
*
* 180 1/07/99 12:28p Samir
* Call to InitD3Music added parameter.
*
* 179 1/05/99 3:59p Kevin
*
* 178 1/05/99 3:55p Kevin
* Added structured exception handling
*
* 177 1/04/99 5:43p Kevin
* new command line args
*
* 176 12/23/98 6:38p Kevin
* All UDP data (except gamespy) now uses one (registered) port number
*
* 175 12/16/98 12:04p Kevin
* GameSpy!
*
* 174 12/14/98 4:48p Jeff
* call to intialize Osiris module manager
*
* 173 12/10/98 3:41p Jeff
* implemented settings for 16 or 32 bit depth (in config)
*
* 172 12/07/98 11:30a Kevin
* Added some features from the 1.1 demo patch
*
* 171 12/02/98 1:07p Jason
* made vsync work correctly, finally
*
* 170 11/24/98 5:17p Jeff
* initialize Pilot Pics
*
* 169 11/23/98 12:31p Jeff
* save out force feedback stuff (bad merge, we lost it earlier)
*
* 168 11/13/98 2:29p Samir
* new music code.
*
* 166 11/09/98 2:59p Kevin
* Added command line option for disabling multiplayer bitmap exchange
*
* 165 11/03/98 6:43p Jeff
* new low-level & high level Force Feedback system implemented, handles
* window losing focus, etc.
*
* 164 10/24/98 2:18p Samir
* don't do mouse stuff for dedicated server.
*
* 163 10/22/98 2:42p Samir
* fixed ALT-TAB pause issue.
*
* 162 10/22/98 1:58p Kevin
* Fixed the working directory (-setdir) command
*
* 161 10/22/98 1:39p Jeff
* autolevel is default full
*
* 160 10/20/98 6:24p Jason
* added super low memory mode
*
* 159 10/20/98 10:56a Sean
* fixed #ifdef editor thingy
*
* 158 10/20/98 12:58a Jeff
* added a way to force a lo-resolution timer
*
* 157 10/20/98 12:10a Samir
* this should fix the problem of the mouse not working properly in game.
*
* 156 10/19/98 6:30p Jeff
* changes made for detail variables. Put in preset values. Preset
* options. Removed terrain_cast from detail. Put new callbacks in
* UIListBox and UISlider
*
* 153 10/18/98 9:12p Matt
* Use new symbolic constant for the program name.
*
* 152 10/18/98 8:51p Matt
* Revamped debug/error system.
*
* 151 10/18/98 3:36p Jeff
* if _DEBUG isn't defined than the rtp_enable/disableflags call gets
* compiled out
*
* 150 10/18/98 2:50p Kevin
* Use low memory mode in dedicated server mode.
*
* 149 10/17/98 5:50p Jeff
* hooked in rtperformance (run time performance) library
*
* 148 10/17/98 12:46p Kevin
* Beta 4 fixes
*
* 147 10/16/98 2:44p Kevin
* working on getting demo compiling
*
* 146 10/16/98 1:54p Kevin
* Changes for Demo Beta 4
*
* 145 10/15/98 1:33p Jeff
* removed amount of debris detail level. Added powerup halo detail
* level. Added predef detail level settings
*
* 144 10/15/98 11:58a Kevin
* checked for low mem
*
* 143 10/14/98 4:37p Matt
* Made InitD3System() exit with error if there's a problem instead of
* returning a status value. Also moved some editor-specific code from
* init.cpp to mainfrm.cpp, and cleaned up some other initialization and
* error-handling code.
*
* 142 10/13/98 3:47p Samir
* added function to check if a cursor is visible
*
* 141 10/13/98 3:41p Kevin
* bug fixes
*
* 140 10/13/98 2:49p Matt
* Open "extra.hog" (if it exists" at startup so we can put any extra data
* in there.
*
* 139 10/12/98 3:01p Jeff
* added vsync and more detail level settings
*
* 138 10/12/98 2:51p Samir
* use main menu background for loading data screen.
*
* 137 10/09/98 8:47p Samir
* don't kill sound library when shutting down game.
*
* 136 10/08/98 7:27p Samir
* don't change defer handlers when shuting down or restarting.
*
* 135 10/08/98 5:55p Matt
* Set main hogfile.
*
* 134 10/08/98 3:36p Jason
* fixes for the demo
*
* 133 10/08/98 1:23p Samir
* shutdown and reinit now do so with ddio systems.
*
* 132 10/07/98 2:54p Jeff
* General UI fixes and additions
*
* 131 10/07/98 12:55p Jason
* fixed some defaults
*
* 130 10/03/98 11:21p Matt
* Added system to separately control outline mode for mine, terrain, sky,
* & objects
*
* 129 10/01/98 11:57a Matt
* Added some mprintf()s
*
* 128 9/30/98 10:36a Kevin
* Added command line launching of URLs and command line directory
* specification
*
* 127 9/25/98 2:53p Jason
* added progress bar
*
* 126 9/25/98 12:31p Samir
* in main game, hide cursor when starting.
*
* 125 9/23/98 3:08p Jeff
*
* 124 9/22/98 6:58p Samir
* Render_floating_triggers is _DEBUG code, so make it so.
*
* 123 9/22/98 3:55p Samir
* ifdef out stuff for non-debug version.
*
* 122 9/22/98 10:32a Jason
* made preferred renderer default to OpenGL
*
* 121 9/21/98 11:10a Jeff
* Calls to init/close forcefeedback
*
* 120 9/18/98 7:38p Jeff
* creation of low-level forcefeedback and beginning of high-level
* forcefeedback
*
* 119 9/18/98 1:27p Jason
* cleaned up renderer initting
*
* 118 9/16/98 6:07p Jason
* made dedicated server use standard mouse mode
*
* 117 9/15/98 4:31p Jason
* added more functionality for the dedicated server
*
* 116 9/14/98 6:28p Jason
* first pass at getting dedicated server working
*
* 115 9/03/98 12:11p Chris
* Adding matcen support
*
* 114 8/31/98 12:39p Samir
* added code to resume controllers when restoring game mode.
*
* 113 8/27/98 6:23p Jeff
* changed autoleveling in config so it is a slider...had to convert
* global from bool->uint8_t. Added fast headlight and mirrored surfaces to
* config menu
*
* 112 8/19/98 2:19p Jeff
* moved detail globals to a struct
*
* 111 8/17/98 6:40p Matt
* Added ambient sound system
*
* 110 8/15/98 5:16p Matt
* Added new Base_directory variable. Got rid of D3_LOCAL check and
* 'local directory' registry variable.
*
* 109 8/10/98 5:52p Samir
* took out briefings search path.
*
* 108 7/31/98 11:51a Jason
* added player ship choosing to multiplayer games
*
* 107 7/24/98 5:32p Samir
* added initializer for D3 Music.
*
* 106 7/13/98 12:42p Samir
* don't do initmessage if graphics system not initialized.
*
* 105 7/08/98 6:27p Samir
* stream library integrated with highlevel sound system.
*
* 104 7/01/98 4:56p Samir
* redid init code.
*
* 103 6/24/98 11:14a Chris
* Added more support and bug fixes
*
* 102 6/23/98 6:00p Chris
* DirectSound 16 mixer is active with 8 bit samples
*
* 101 6/22/98 12:00p Chris
* Working on sound system to make it in a nice shape.
*
* 100 6/19/98 6:42p Jason
* made specular mapping a config detail item
*
* 99 6/19/98 6:04p Jeff
* variables to turn on/off voices
*
* 98 6/18/98 5:22p Jeff
* initialize streaming audio system
*
* 97 6/17/98 3:58p Jeff
* put in PilotInit(). String table loaded near begining for Main exe,
* after tables are loaded for editor
*
* 96 6/16/98 3:48p Chris
* Updated the sound system and added the start of sound streaming
*
* 95 6/16/98 11:49a Jeff
* string table loaded after manage system
*
* 94 6/16/98 10:54a Jeff
*
* 93 6/12/98 5:56p Jeff
* Load string tables during init
*
* 92 6/08/98 3:56p Jeff
* added initializing functions for compressed audio and voice systems
*
* 91 6/02/98 6:03p Jason
* added specular lightmaps
*
* 90 6/02/98 4:37p Samir
* multiple joysticks supported.
*
* 89 6/01/98 11:37a Chris
*
* 88 5/19/98 3:43p Samir
* must move mem_Init after error_Init.
*
* 87 5/19/98 3:37p Samir
* added mem_Init
*
* 86 5/14/98 11:49a Chris
* Bettered the sound paging system
*
* 85 5/12/98 2:05p Craig
* errror
*
* 84 5/12/98 11:45a Samir
* added logfile init.
*
* 83 5/06/98 6:34p Jeff
* Added Terrain casting to config
*
* 82 5/06/98 4:32p Samir
* moved ui init back to its proper place.
*
* 81 5/06/98 12:44p Jeff
* added saving/restoring video resolution
*
* 80 5/05/98 5:16p Samir
* took out calls to init UI system (that's done now in SetScreenMode)
*
* 79 5/05/98 3:02p Jason
* attempting to add different screen resolutions
*
* 78 5/04/98 3:42p Matt
* Page in all sounds at init time, so you don't have to wait when you're
* starting a game
*
* 77 5/01/98 4:48p Jeff
* Added autoleveling into the configuration
*
* 76 4/28/98 6:42p Matt
* If registry says renderer is software, force it to be glide.
*
* 75 4/28/98 11:56a Jeff
* moved things from config (d3.cfg) into the registry
*
* 74 4/24/98 1:53a Samir
* added trigger init and free.
*
* 73 4/16/98 6:53a Samir
* added default script warning system.
*
* 72 4/16/98 12:23a Samir
* fixed bug when checking if script compiled in editor.
*
* 71 4/14/98 7:31p Matt
* Changed code to use ddio_MakePath() instead of sprintf() to create file
* spec
*
* 70 4/10/98 7:48p Samir
* make sure to set default values for outlining, etc.
*
* 69 4/09/98 5:30p Samir
* new main menu art.
*
* 68 4/08/98 7:19p Samir
* Added runtime debugging option.
*
* 67 4/07/98 9:20p Samir
* Changes to debug stuff.
*
* 66 4/06/98 5:13p Chris
* Sounds page in at the beginning of a level
*
* 65 4/02/98 7:58p Samir
* make sure to pause game and close/init control system when application
* looses focus.
*
* 64 3/27/98 5:18p Samir
* initialize debug break handlers differently for editor.
*
* 63 3/27/98 3:29p Brent
* if joy init fails, don't try initializing joystick. (samir)
*
* 62 3/27/98 2:44p Samir
* Restore joystick initialization.
*
* 61 3/23/98 8:03p Samir
* A bunch of changes to allow for ALT-TAB to work.
*
* 60 3/20/98 5:51p Jason
* more changes for multiplayer
*
* 59 3/20/98 1:19p Jeff
* Changes made to use Default_pilot string for pilot filename to use.
*
* 58 3/19/98 11:27a Samir
* Better error checking.
*
* 57 3/13/98 1:22p Jason
* Moved UseHardware flag to the renderer lib where it belongs
*
* 56 3/10/98 5:16p Samir
* Got debug callbacks working when you hit an Int3.
*
* 55 3/05/98 6:39p Samir
* Initialize ui system with UI_FONT
*
* 54 3/04/98 12:00p Jason
* added default gamma settings
*
* 53 2/27/98 5:35p Jeff
* Added in loading and saving of a game configuration file
*
* 52 2/18/98 1:33a Jason
* don't do mip mapping by default
*
* 51 2/18/98 1:11a Samir
* Some game window mess.
*
* 50 2/17/98 2:21p Samir
* Added d3xdebug.h
*
* 49 2/14/98 10:48p Jason
* got preferred rendering working
*
* 46 2/11/98 5:55p Samir
* Now InitD3XDebug and CloseD3XDebug are called when you enter and leave
* the game. This as well as ui_Init and ui_Close
*
* 45 2/02/98 7:34p Samir
* Moved D3X Initialization to PlayGame.
*
* 44 1/29/98 12:24p Samir
* Added logfile support.
*
* 43 1/27/98 1:20p Samir
* Fixed initialization for main game.
*
* 42 1/13/98 12:31p Samir
* only register small font for editor.
*
* 41 1/02/98 5:32p Chris
* More radical changes to the sound system
*
* 40 12/31/97 1:01a Chris
* Removed old dead code
*
*
*
* $NoKeywords: $
*/
// Initialization routines for Descent3/Editor
#include <cstring>
#include <ctime>
#include <filesystem>
#include <regex>
#include "mono.h"
#include "gametexture.h"
#include "object.h"
#include "vecmat.h"
#include "init.h"
#include "config.h"
#include "3d.h"
#include "hlsoundlib.h"
#include "manage.h"
#include "bitmap.h"
#include "ddio.h"
#include "render.h"
#include "descent.h"
#include "renderer.h"
#include "vclip.h"
#include "grdefs.h"
#include "pserror.h"
#include "lighting.h"
#include "polymodel.h"
#include "door.h"
#include "terrain.h"
#include "soundload.h"
#include "ship.h"
#include "controls.h"
#include "Mission.h"
#include "findintersection.h"
#include "appdatabase.h"
#include "room.h"
#include "game.h"
#include "gamefile.h"
#include "gamespy.h"
#include "TelCom.h"
#include "objinfo.h"
#include "cinematics.h"
#include "lightmap_info.h"
#include "fireball.h"
#include "networking.h"
#include "args.h"
#include "pilot.h"
#include "gameloop.h"
#include "trigger.h"
#include "physics.h"
#include "special_face.h"
#include "voice.h"
#include "localization.h"
#include "log.h"
#include "stringtable.h"
#include "player.h"
#include "psrand.h"
#include "ambient.h"
#include "matcen.h"
#include "dedicated_server.h"
#include "D3ForceFeedback.h"
#include "newui.h"
#include "SmallViews.h"
#include "uisys.h"
#include "rtperformance.h"
#include "d3music.h"
#include "PilotPicsAPI.h"
#include "osiris_dll.h"
#include "mem.h"
#include "multi.h"
#include "marker.h"
#include "gamecinematics.h"
#include "debuggraph.h"
// Uncomment this to allow all languages
#define ALLOW_ALL_LANG 1
#ifdef EDITOR
#include "editor\HFile.h"
#include "editor\d3edit.h"
#include "slew.h"
#include "gr.h"
#define INIT_MESSAGE(c) SplashMessage c
#else
void IntroScreen();
#define INIT_MESSAGE(c) InitMessage(c)
#endif
#if defined(EDITOR) || defined(NEWEDITOR)
bool Running_editor = true; // didn't we have a variable like this somewhere
#else
bool Running_editor = false; // didn't we have a variable like this somewhere