]> icculus.org git repositories - taylor/freespace2.git/blob - src/globalincs/systemvars.cpp
The Great Newline Fix
[taylor/freespace2.git] / src / globalincs / systemvars.cpp
1 /*
2  * $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Variables and constants common to FreeSpace and Fred.
8  *
9  * $Log$
10  * Revision 1.2  2002/05/07 03:16:45  theoddone33
11  * The Great Newline Fix
12  *
13  * Revision 1.1.1.1  2002/05/03 03:28:09  root
14  * Initial import.
15  *
16  * 
17  * 12    9/09/99 8:53p Dave
18  * Fixed multiplayer degenerate orientation case problem. Make sure warp
19  * effect never goes lower than LOD 1. 
20  * 
21  * 11    9/06/99 11:25a Mikek
22  * Decrease some settings for High detail level.
23  * 
24  * 10    8/05/99 2:05a Dave
25  * Whee.
26  * 
27  * 9     7/29/99 10:47p Dave
28  * Standardized D3D fogging using vertex fog. Shook out Savage 4 bugs.
29  * 
30  * 8     7/29/99 12:05a Dave
31  * Nebula speed optimizations.
32  * 
33  * 7     6/22/99 7:03p Dave
34  * New detail options screen.
35  * 
36  * 6     6/16/99 4:06p Dave
37  * New pilot info popup. Added new draw-bitmap-as-poly function.
38  * 
39  * 5     5/24/99 5:45p Dave
40  * Added detail levels to the nebula, with a decent speedup. Split nebula
41  * lightning into its own section.
42  * 
43  * 4     11/30/98 1:07p Dave
44  * 16 bit conversion, first run.
45  * 
46  * 3     10/07/98 6:27p Dave
47  * Globalized mission and campaign file extensions. Removed Silent Threat
48  * special code. Moved \cache \players and \multidata into the \data
49  * directory.
50  * 
51  * 2     10/07/98 10:52a Dave
52  * Initial checkin.
53  * 
54  * 1     10/07/98 10:48a Dave
55  * 
56  * 38    9/21/98 8:46p Dave
57  * Put in special check in fred for identifying unknown ships.
58  * 
59  * 37    8/17/98 5:07p Dave
60  * First rev of corkscrewing missiles.
61  * 
62  * 36    5/13/98 11:34p Mike
63  * Model caching system.
64  * 
65  * 35    4/25/98 4:06p John
66  * Made defaults make a little more sense
67  * 
68  * 34    4/20/98 8:41p John
69  * Made debris culling actually reduce Glide texture resolution.
70  * 
71  * 33    4/12/98 9:56a John
72  * Made lighting detail flags work.   Made explosions cast light on
73  * highest.
74  * 
75  * 32    4/08/98 8:34p Lawrance
76  * Fix up how custom button works on the detail tab.
77  * 
78  * 31    4/01/98 5:34p John
79  * Made only the used POFs page in for a level.   Reduced some interp
80  * arrays.    Made custom detail level work differently.
81  * 
82  * 30    3/31/98 5:18p John
83  * Removed demo/save/restore.  Made NDEBUG defined compile.  Removed a
84  * bunch of debug stuff out of player file.  Made model code be able to
85  * unload models and malloc out only however many models are needed.
86  *  
87  * 
88  * 29    3/30/98 2:38p Mike
89  * Add asteroid_density to detail level support.
90  * No force explosion damage in training missions.
91  * Make cargo deathrolls shorter.
92  * 
93  * 28    3/24/98 8:16a John
94  * made highest detail different than next one down
95  * 
96  * 27    3/23/98 5:19p John
97  * Upped number of default detail levels to 4
98  * 
99  * 26    3/22/98 4:11p Andsager
100  * Remove global Freespace_running
101  * 
102  * 25    3/22/98 3:28p John
103  * Added in stippled alpha for lower details.  Made medium detail use
104  * engine glow.
105  * 
106  * 24    3/22/98 2:41p John
107  * Added lighting into the detail structure.
108  * 
109  * 23    3/22/98 11:06a John
110  * Changed default detail levels
111  * 
112  * 22    3/22/98 11:02a John
113  * Made a bunch of the detail levels actually do something
114  * 
115  * 21    3/22/98 9:53a John
116  * Added in first stage of new detail level stuff
117  * 
118  * 20    3/09/98 12:13a Andsager
119  * Add code to help find jumps in position.
120  * 
121  * 19    2/28/98 7:03p Lawrance
122  * get slew working in any view
123  * 
124  * 18    2/16/98 4:16p John
125  * Added loading animation
126  * 
127  * 17    2/10/98 9:06a John
128  * Added variables for restoring
129  * 
130  * 16    2/05/98 9:27p John
131  * took out ending min/max etc on monitor
132  * 
133  * 15    2/05/98 9:21p John
134  * Some new Direct3D code.   Added code to monitor a ton of stuff in the
135  * game.
136  * 
137  * 14    2/03/98 9:25p John
138  * Upgraded Direct3D code to new version 5.0 code.  Separated the D3D code
139  * more.  Added a global variable D3D_enabled flag.
140  * 
141  * 13    1/17/98 12:17p John
142  * fixed erroneous print
143  * 
144  * 12    1/17/98 12:14p John
145  * Added loading... bar to freespace.
146  * 
147  * 11    1/11/98 2:15p John
148  * Changed a lot of stuff that had to do with bitmap loading.   Made cfile
149  * not do callbacks, I put that in global code.   Made only bitmaps that
150  * need to load for a level load.
151  * 
152  * 10    12/16/97 6:20p Hoffoss
153  * Added more debugging code for demos, and fixed a bug in demo
154  * recording/playback.
155  * 
156  * 9     12/05/97 3:46p John
157  * made ship thruster glow scale instead of being an animation.
158  * 
159  * 8     8/05/97 10:18a Lawrance
160  * my_rand() being used temporarily instead of rand()
161  * 
162  * 7     8/04/97 10:21a Dave
163  * Added Is_standalone global var
164  * 
165  * 6     6/24/97 6:21p John
166  * added detail flags.
167  * sped up motion debris system a bit.
168  * 
169  * 5     4/15/97 11:28p Mike
170  * External view system
171  * 
172  * 4     4/15/97 4:00p Mike
173  * Intermediate checkin caused by getting other files.  Working on camera
174  * slewing system.
175  * 
176  * 3     4/08/97 8:47a John
177  * Added a global varible for detail level
178  * 
179  * 2     4/01/97 11:07p Mike
180  * Clean up game sequencing functions.  Get rid of Multiplayer and add
181  * Game_mode.  Add SystemVars.cpp
182  * 
183  * 1     4/01/97 10:59p Mike
184  *
185  * $NoKeywords: $
186  */
187
188 #include "pstypes.h"
189 #include "systemvars.h"
190 #include "timer.h"
191 #include "neb.h"
192
193 fix Missiontime;
194 fix Frametime;
195 int     Framecount=0;
196
197 int Game_mode;
198
199 int Game_restoring = 0;         // If set, this means we are restoring data from disk
200
201 int     Viewer_mode;            //      Viewer's mode, see VM_xxxx flags.
202
203 // The detail level.  Anything below zero draws simple models earlier than it
204 // should.   Anything above zero draws higher detail models longer than it should.
205 // -2=lowest
206 // -1=low
207 // 0=normal (medium)    
208 // 1=high
209 // 2=extra high
210 int Game_detail_level = 0;
211 uint Game_detail_flags = DETAIL_DEFAULT;        // see systemvars.h for explanation
212
213 angles  Viewer_slew_angles;                     //      Angles of viewer relative to forward.
214 vei             Viewer_external_info;           //      Viewer angles to ship in external view.
215 vci             Viewer_chase_info;                      // View chase camera information
216
217 int Is_standalone;
218 int Rand_count;
219
220 int Interface_last_tick = -1;                   // last timer tick on flip
221
222 // for notifying players of unknown ship types
223 int Fred_found_unknown_ship_during_parsing = 0;
224
225 // If true, then we are using Direct3D hardware.  This is used for game type stuff
226 // that changes when you're using hardware.
227 int D3D_enabled = 0;                    
228
229 // Values used for noise for thruster animations
230 float Noise[NOISE_NUM_FRAMES] = { 
231         0.468225f,
232         0.168765f,
233         0.318945f,
234         0.292866f,
235         0.553357f,
236         0.468225f,
237         0.180456f,
238         0.418465f,
239         0.489958f,
240         1.000000f,
241         0.468225f,
242         0.599820f,
243         0.664718f,
244         0.294215f,
245         0.000000f
246 };
247
248
249 int myrand()
250 {
251         int rval;
252         rval = rand();
253         Rand_count++;
254 //      nprintf(("Alan","RAND: %d\n", rval));
255         return rval;
256 }
257
258
259 // Variables for the loading callback hooks
260 static int cf_timestamp = -1;
261 static void (*cf_callback)(int count) = NULL;
262 static int cf_in_callback = 0;  
263 static int cb_counter = 0;
264 static int cb_last_counter = 0;
265 static int cb_delta_step = -1;
266
267 // Call this with the name of a function.  That function will
268 // then get called around 10x per second.  The callback function
269 // gets passed a 'count' which is how many times game_busy has
270 // been called since the callback was set.   It gets called
271 // one last time with count=-1 when you turn off the callback
272 // by calling game_busy_callback(NULL).   Game_busy_callback
273 // returns the current count, so you can tell how many times
274 // game_busy got called.
275 int game_busy_callback( void (*callback)(int count), int delta_step )
276 {
277         if ( !callback ) {
278
279                 // Call it once more to finalize things
280                 cf_in_callback++;
281                 (*cf_callback)(-1);
282                 cf_in_callback--;
283
284                 cf_timestamp = -1;
285                 cf_callback = NULL;
286         } else {
287                 cb_counter = 0;
288                 cb_last_counter = 0;
289                 cb_delta_step = delta_step;
290                 cf_timestamp = timer_get_milliseconds()+(1000/10);
291                 cf_callback = callback;
292
293                 // Call it once
294                 cf_in_callback++;
295                 (*cf_callback)(0);              // pass 0 first time!
296                 cf_in_callback--;
297         
298         }
299
300         return cb_counter;
301 }
302
303 // Call whenever loading to display cursor
304 void game_busy()
305 {
306         if ( cf_in_callback != 0 ) return;      // don't call callback if we're already in it.
307         if ( cf_timestamp < 0 ) return;
308         if ( !cf_callback ) return;
309
310         cb_counter++;
311
312 //      mprintf(( "CB_COUNTER=%d\n", cb_counter ));
313
314         int t1 = timer_get_milliseconds();
315
316         if ( (t1 > cf_timestamp) || ((cb_counter>cb_last_counter+155)&&(cb_delta_step>0)) )     {
317                 cb_last_counter = cb_counter;
318                 cf_in_callback++;
319                 (*cf_callback)(cb_counter);
320                 cf_in_callback--;
321                 cf_timestamp = t1 + +(1000/10);
322         }
323 }
324
325 //======================== CODE TO MONITOR EVENTS ======================
326
327 #ifndef NDEBUG
328
329 #define MAX_MONITORS 64
330
331 static int Num_monitors = 0;
332 static monitor *Monitor[MAX_MONITORS];
333
334 monitor::monitor( char *_name )
335 {
336         int i;
337
338         if ( Num_monitors >= MAX_MONITORS )     {
339                 Int3();                 // Too many monitor variables!! Increase MAX_MONITORS!!
340                 return;
341         }
342
343         for (i=0; i<Num_monitors; i++ ) {
344                 int ret  = stricmp( Monitor[i]->name, _name );
345
346                 if ( ret == 0)  {
347                         Int3();         // This monitor variable already exists!!!! 
348                         return;
349                 } else if ( ret > 0 )   {
350                         break;          // Insert it here
351
352                 } else if ( ret < 0 )   {
353                         // do nothing
354                 }
355         }
356
357         if ( i < Num_monitors ) {
358                 // Insert it at element i
359                 int j;
360                 for (j=Num_monitors; j>i; j-- ) {
361                         Monitor[j] = Monitor[j-1];
362                 }
363                 Monitor[i] = this;              
364                 Num_monitors++;
365         } else {
366                 Monitor[Num_monitors] = this;           
367                 Num_monitors++;
368         }
369
370         name = _name;
371         value = 0;
372 }
373
374
375 int Monitor_inited = 0;
376 char Monitor_filename[128];
377 fix monitor_last_time = -1;
378
379 DCF(monitor,"Monitors game performace")
380 {
381         if ( Dc_command )       {
382                 dc_get_arg(ARG_STRING|ARG_NONE);
383                 if ( Dc_arg_type == ARG_NONE )  {
384                         if ( Monitor_inited )   {
385                                 Monitor_inited = 0;
386
387 /*
388                                 FILE *fp = fopen( Monitor_filename, "at" );
389                                 if ( fp )       {
390                                         fprintf( fp, "\n\n" );
391                                         fprintf( fp, "Name\tMin\tMax\tAvg\n" );
392                                         for (int i=0; i<Num_monitors; i++ )     {
393                                                 if ( Monitor[i]->cnt > 0 )      {
394                                                         fprintf( fp, "%s\t%d\t%d\t%d\n", Monitor[i]->name, Monitor[i]->min, Monitor[i]->max, Monitor[i]->sum / Monitor[i]->cnt  );
395                                                 } else {
396                                                         fprintf( fp, "%s\t%d\t%d\t?\n", Monitor[i]->name, Monitor[i]->min, Monitor[i]->max );
397                                                 }
398                                         }
399                                         fclose(fp);
400                                 }
401 */
402
403                                 dc_printf( "Monitor to file '%s' turned off\n", Monitor_filename );
404                         } else {
405                                 dc_printf( "Monitor isn't on\n" );
406                         }
407                 } else {
408                         if ( Monitor_inited )   {
409                                 dc_printf( "Monitor already on\n" );
410                         } else {
411                                 Monitor_inited = 1;
412
413                                 strcpy( Monitor_filename, Dc_arg );
414
415                                 // Reset them all
416                                 int i;
417                                 for (i=0; i<Num_monitors; i++ ) {
418                                         Monitor[i]->value = 0;
419                                         Monitor[i]->sum = 0;
420                                         Monitor[i]->cnt = 0;
421                                         Monitor[i]->min = 0;
422                                         Monitor[i]->max = 0;
423                                 }
424
425                                 FILE *fp = fopen( Monitor_filename, "wt" );
426                                 if ( fp )       {
427                                         for (i=0; i<Num_monitors; i++ ) {
428                                                 if ( i > 0 )    {
429                                                         fprintf( fp, "\t" );
430                                                 }
431                                                 fprintf( fp, "%s", Monitor[i]->name );
432                                         
433                                         }
434                                         fprintf( fp, "\n" );
435                                         fclose(fp);
436                                 }
437                                 dc_printf( "Monitor outputting to file '%s'\n", Monitor_filename );
438                                 monitor_last_time = -1;
439                         }
440                 }
441         }
442         if ( Dc_help )  {
443                 dc_printf( "Usage: monitor filename\nOutputs monitoring info to filename. No filename turns it off\n" );
444         }
445         
446 }
447
448
449 MONITOR(FrameRateX100);
450
451 void monitor_update()
452 {
453         int i;
454         FILE * fp;
455
456         fix this_time = timer_get_fixed_seconds();
457         fix frametime;
458
459         if ( monitor_last_time != -1 )  {
460                 frametime = this_time - monitor_last_time;
461         } else {
462                 frametime = 0;
463         }
464
465         if ( frametime > 0 )    {
466                 MONITOR_INC(FrameRateX100, (F1_0*100) / frametime );
467         } else {
468                 MONITOR_INC(FrameRateX100, 0 );
469         }
470
471                 
472         if ( !Monitor_inited )  {
473                 return;
474         }
475
476         if ( frametime != 0 )   {
477                 fp = fopen( Monitor_filename, "at" );
478                 if ( fp )       {
479
480                         for (i=0; i<Num_monitors; i++ ) {
481                                 if (i>0) fprintf( fp, "\t" );
482                                 fprintf( fp, "%d", Monitor[i]->value );
483                         }
484                         fprintf( fp, "\n" );
485                         fclose(fp);
486                 }
487
488                 for (i=0; i<Num_monitors; i++ ) {
489
490                         // Record stats
491                         Monitor[i]->sum += Monitor[i]->value;
492
493                         if ( (Monitor[i]->cnt < 1)  || (Monitor[i]->value < Monitor[i]->min ))  {
494                                 Monitor[i]->min = Monitor[i]->value;
495                         }
496
497                         if ( (Monitor[i]->cnt < 1)  || (Monitor[i]->value > Monitor[i]->max ))  {
498                                 Monitor[i]->max = Monitor[i]->value;
499                         }
500
501                         Monitor[i]->cnt++;
502
503                         //      Reset the value
504                         Monitor[i]->value = 0;
505                 }
506         } else {
507                 for (i=0; i<Num_monitors; i++ ) {
508                         //      Reset the value
509                         Monitor[i]->value = 0;
510                 }
511         }
512
513         monitor_last_time = timer_get_fixed_seconds();
514
515 }
516 #endif  //NDEBUG
517
518
519 #if MAX_DETAIL_LEVEL != 4
520 #error MAX_DETAIL_LEVEL is assumed to be 4 in SystemVars.cpp
521 #endif
522
523 #if NUM_DEFAULT_DETAIL_LEVELS != 4
524 #error NUM_DEFAULT_DETAIL_LEVELS is assumed to be 4 in SystemVars.cpp
525 #endif
526
527 // Detail level stuff
528 detail_levels Detail_defaults[NUM_DEFAULT_DETAIL_LEVELS] = {
529         {                               // Low
530                 0,                      // setting
531                                         // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
532                 0,                      // nebula_detail;                               // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
533                 0,                      // detail_distance;                     // 0=lowest MAX_DETAIL_LEVEL=highest            
534                 0,                      //      hardware_textures;                      // 0=max culling, MAX_DETAIL_LEVEL=no culling
535                 0,                      //      num_small_debris;                       // 0=min number, MAX_DETAIL_LEVEL=max number
536                 0,                      //      num_particles;                          // 0=min number, MAX_DETAIL_LEVEL=max number
537                 0,                      //      num_stars;                                      // 0=min number, MAX_DETAIL_LEVEL=max number
538                 0,                      //      shield_effects;                 // 0=min, MAX_DETAIL_LEVEL=max
539                 2,                      // lighting;                                    // 0=min, MAX_DETAIL_LEVEL=max          
540
541                                         // ====  Booleans ====
542                 0,                      //      targetview_model;                       // 0=off, 1=on          
543                 0,                      //      planets_suns;                           // 0=off, 1=on          
544                 0,                      // weapon_extras
545         },
546         {                               // Medium
547                 1,                      // setting
548                                         // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
549                 1,                      // nebula_detail;                               // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
550                 1,                      // detail_distance;                     // 0=lowest MAX_DETAIL_LEVEL=highest            
551                 1,                      //      hardware_textures;                      // 0=max culling, MAX_DETAIL_LEVEL=no culling
552                 2,                      //      num_small_debris;                       // 0=min number, MAX_DETAIL_LEVEL=max number
553                 2,                      //      num_particles;                          // 0=min number, MAX_DETAIL_LEVEL=max number
554                 2,                      //      num_stars;                                      // 0=min number, MAX_DETAIL_LEVEL=max number
555                 1,                      //      shield_effects;                 // 0=min, MAX_DETAIL_LEVEL=max
556                 3,                      // lighting;                                    // 0=min, MAX_DETAIL_LEVEL=max          
557
558                 // ====  Booleans ====
559                 1,                      //      targetview_model;                       // 0=off, 1=on          
560                 1,                      //      planets_suns;                           // 0=off, 1=on
561                 1,                      // weapon extras                                
562         },
563         {                               // High level
564                 2,                      // setting
565                                         // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
566                 2,                      // nebula_detail;                               // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
567                 3,                      // detail_distance;                     // 0=lowest MAX_DETAIL_LEVEL=highest            
568                 3,                      //      hardware_textures;                      // 0=max culling, MAX_DETAIL_LEVEL=no culling
569                 3,                      //      num_small_debris;                       // 0=min number, MAX_DETAIL_LEVEL=max number
570                 3,                      //      num_particles;                          // 0=min number, MAX_DETAIL_LEVEL=max number
571                 4,                      //      num_stars;                                      // 0=min number, MAX_DETAIL_LEVEL=max number
572                 3,                      //      shield_effects;                 // 0=min, MAX_DETAIL_LEVEL=max
573                 4,                      // lighting;                                    // 0=min, MAX_DETAIL_LEVEL=max          
574
575                                                                                 // ====  Booleans ====
576                 1,                      //      targetview_model;                       // 0=off, 1=on          
577                 1,                      //      planets_suns;                           // 0=off, 1=on
578                 1,                      // weapon_extras
579         },
580         {                               // Highest level
581                 3,                      // setting
582                                         // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
583                 3,                      // nebula_detail;                               // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
584                 3,                      // detail_distance;                     // 0=lowest MAX_DETAIL_LEVEL=highest            
585                 4,                      //      hardware_textures;                      // 0=max culling, MAX_DETAIL_LEVEL=no culling
586                 4,                      //      num_small_debris;                       // 0=min number, MAX_DETAIL_LEVEL=max number
587                 3,                      //      num_particles;                          // 0=min number, MAX_DETAIL_LEVEL=max number
588                 4,                      //      num_stars;                                      // 0=min number, MAX_DETAIL_LEVEL=max number
589                 4,                      //      shield_effects;                 // 0=min, MAX_DETAIL_LEVEL=max
590                 4,                      // lighting;                                    // 0=min, MAX_DETAIL_LEVEL=max          
591
592                                                                                 // ====  Booleans ====
593                 1,                      //      targetview_model;                       // 0=off, 1=on          
594                 1,                      //      planets_suns;                           // 0=off, 1=on
595                 1,                      // weapon_extras
596         },
597 };
598
599
600 // Global used to access detail levels in game and libs
601 detail_levels Detail = Detail_defaults[NUM_DEFAULT_DETAIL_LEVELS-1];
602
603 // Call this with:
604 // 0 - lowest
605 // NUM_DETAIL_LEVELS - highest
606 // To set the parameters in Detail to some set of defaults
607 void detail_level_set(int level)
608 {
609         if ( level < 0 )        {
610                 Detail.setting = -1;
611                 return;
612         }
613         Assert( level >= 0 );
614         Assert( level < NUM_DEFAULT_DETAIL_LEVELS );
615
616         Detail = Detail_defaults[level];
617
618         // reset nebula stuff
619         neb2_set_detail_level(level);
620 }
621
622 // Returns the current detail level or -1 if custom.
623 int current_detail_level()
624 {
625 //      return Detail.setting;
626         int i;
627
628         for (i=0; i<NUM_DEFAULT_DETAIL_LEVELS; i++ )    {
629                 if ( memcmp( &Detail, &Detail_defaults[i], sizeof(detail_levels) )==0 ) {
630                         return i;
631                 }
632         }
633         return -1;
634 }
635
636 #ifndef NDEBUG
637 DCF(detail_level,"Change the detail level")
638 {
639         if ( Dc_command )       {
640                 dc_get_arg(ARG_INT|ARG_NONE);
641                 if ( Dc_arg_type & ARG_NONE )   {
642                         Game_detail_level = 0;
643                         dc_printf( "Detail level reset\n" );
644                 }
645                 if ( Dc_arg_type & ARG_INT )    {
646                         Game_detail_level = Dc_arg_int;
647                 }
648         }
649
650         if ( Dc_help )  
651                 dc_printf( "Usage: detail_level [n]\nn is detail level. 0 normal, - lower, + higher, -2 to 2 usually\nNo parameter resets it to default.\n" );
652
653         if ( Dc_status )                                
654                 dc_printf("Detail level set to %d\n", Game_detail_level);
655 }
656
657 DCF(detail, "Turns on/off parts of the game for speed testing" )
658 {
659         if ( Dc_command )       {
660                 dc_get_arg(ARG_INT|ARG_NONE);
661                 if ( Dc_arg_type & ARG_NONE )   {
662                         if ( Game_detail_flags == DETAIL_DEFAULT )      {
663                                 Game_detail_flags = DETAIL_FLAG_CLEAR;
664                                 dc_printf( "Detail flags set lowest (except has screen clear)\n" );
665                         } else {
666                                 Game_detail_flags = DETAIL_DEFAULT;
667                                 dc_printf( "Detail flags set highest\n" );
668                         }
669                 }
670                 if ( Dc_arg_type & ARG_INT )    {
671                         Game_detail_flags ^= Dc_arg_int;
672                 }
673         }
674
675         if ( Dc_help )  {
676                 dc_printf( "Usage: detail [n]\nn is detail bit to toggle.\n" );
677                 dc_printf( "   1: draw the stars\n" );
678                 dc_printf( "   2: draw the nebulas\n" );
679                 dc_printf( "   4: draw the motion debris\n" );
680                 dc_printf( "   8: draw planets\n" );
681                 dc_printf( "  16: draw models not as blobs\n" );
682                 dc_printf( "  32: draw lasers not as pixels\n" );
683                 dc_printf( "  64: clear screen background after each frame\n" );
684                 dc_printf( " 128: draw hud stuff\n" );
685                 dc_printf( " 256: draw fireballs\n" );
686                 dc_printf( " 512: do collision detection\n" );
687         }
688
689         if ( Dc_status )        {
690                 dc_printf("Detail flags set to 0x%08x\n", Game_detail_flags);
691                 dc_printf( "   1: draw the stars: %s\n", (Game_detail_flags&1?"on":"off") );
692                 dc_printf( "   2: draw the nebulas: %s\n", (Game_detail_flags&2?"on":"off") );
693                 dc_printf( "   4: draw the motion debris: %s\n", (Game_detail_flags&4?"on":"off")  );
694                 dc_printf( "   8: draw planets: %s\n", (Game_detail_flags&8?"on":"off")  );
695                 dc_printf( "  16: draw models not as blobs: %s\n", (Game_detail_flags&16?"on":"off")  );
696                 dc_printf( "  32: draw lasers not as pixels: %s\n", (Game_detail_flags&32?"on":"off")  );
697                 dc_printf( "  64: clear screen background after each frame: %s\n", (Game_detail_flags&64?"on":"off")  );
698                 dc_printf( " 128: draw hud stuff: %s\n", (Game_detail_flags&128?"on":"off")  );
699                 dc_printf( " 256: draw fireballs: %s\n", (Game_detail_flags&256?"on":"off")  );
700                 dc_printf( " 512: do collision detection: %s\n", (Game_detail_flags&512?"on":"off")  );
701         }
702 }
703 #endif