FS2_Open
Open source remastering of the Freespace 2 engine
systemvars.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 #include "debugconsole/console.h"
12 #include "globalincs/pstypes.h"
13 #include "globalincs/systemvars.h"
14 #include "graphics/2d.h"
15 #include "io/timer.h"
16 #include "nebula/neb.h"
17 
18 
22 int Framecount=0;
23 
25 
26 int Game_restoring = 0; // If set, this means we are restoring data from disk
27 
28 int Viewer_mode; // Viewer's mode, see VM_xxxx flags.
29 
30 //CUTSCENE STUFF
31 //Cutscene flags
33 //Time for gradual change in seconds
34 float Cutscene_delta_time = 1.0f;
35 //How far along a change is (0 to 1)
37 
38 //FADEIN STUFF
43 
44 // The detail level. Anything below zero draws simple models earlier than it
45 // should. Anything above zero draws higher detail models longer than it should.
46 // -2=lowest
47 // -1=low
48 // 0=normal (medium)
49 // 1=high
50 // 2=extra high
52 uint Game_detail_flags = DETAIL_DEFAULT; // see systemvars.h for explanation
53 
54 angles Viewer_slew_angles; // Angles of viewer relative to forward.
55 vei Viewer_external_info; // Viewer angles to ship in external view.
56 vci Viewer_chase_info; // View chase camera information
58 
61 
62 int Interface_last_tick = -1; // last timer tick on flip
63 
64 #ifndef NDEBUG
65 // for debugging, used to print the currently processing filename on the loading screen
67 #endif
68 
69 // override states to skip rendering of certain elements, but without disabling them completely
70 bool Basemap_override = false;
71 bool Envmap_override = false;
72 bool Specmap_override = false;
73 bool Normalmap_override = false;
74 bool Heightmap_override = false;
75 bool Glowpoint_override = false;
77 bool GLSL_override = false;
79 bool Teamcolor_override = false;
80 bool Shadow_override = false;
81 
82 // Values used for noise for thruster animations
84  0.468225f,
85  0.168765f,
86  0.318945f,
87  0.292866f,
88  0.553357f,
89  0.468225f,
90  0.180456f,
91  0.418465f,
92  0.489958f,
93  1.000000f,
94  0.468225f,
95  0.599820f,
96  0.664718f,
97  0.294215f,
98  0.000000f
99 };
100 
101 
102 int myrand()
103 {
104  int rval;
105  rval = rand();
106  Rand_count++;
107 // nprintf(("Alan","RAND: %d\n", rval));
108  return rval;
109 }
110 
111 // returns a random number between 0 and 0x7fffffff, or something close to it.
112 int rand32()
113 {
114  if (RAND_MAX == 0x7fff) {
115  int random32;
116  // this gets two random 16 bit numbers and stuffs them into a 32 bit number
117  random32 = (rand() << 16) | rand();
118  //since rand() returns between 0 and 0x7fff, there needs to be a thing to randomly generate the 16th bit
119  random32 |= ((rand() & 1) << 15);
120 
121  return random32;
122  }
123  else {
124  return rand();
125  }
126 }
127 
128 // Variables for the loading callback hooks
129 static int cf_timestamp = -1;
130 static void (*cf_callback)(int count) = NULL;
131 static int cf_in_callback = 0;
132 static int cb_counter = 0;
133 static int cb_last_counter = 0;
134 static int cb_delta_step = -1;
135 
136 // Call this with the name of a function. That function will
137 // then get called around 10x per second. The callback function
138 // gets passed a 'count' which is how many times game_busy has
139 // been called since the callback was set. It gets called
140 // one last time with count=-1 when you turn off the callback
141 // by calling game_busy_callback(NULL). Game_busy_callback
142 // returns the current count, so you can tell how many times
143 // game_busy got called.
144 int game_busy_callback( void (*callback)(int count), int delta_step )
145 {
146  if ( !callback ) {
147 
148  // Call it once more to finalize things
149  cf_in_callback++;
150  (*cf_callback)(-1);
151  cf_in_callback--;
152 
153  cf_timestamp = -1;
154  cf_callback = NULL;
155  } else {
156  cb_counter = 0;
157  cb_last_counter = 0;
158  cb_delta_step = delta_step;
159  cf_timestamp = timer_get_milliseconds()+(1000/10);
160  cf_callback = callback;
161 
162  // Call it once
163  cf_in_callback++;
164  (*cf_callback)(0); // pass 0 first time!
165  cf_in_callback--;
166 
167  }
168 
169  return cb_counter;
170 }
171 
172 // Call whenever loading to display cursor
173 void game_busy(const char *filename)
174 {
175  if ( cf_in_callback != 0 ) return; // don't call callback if we're already in it.
176  if ( cf_timestamp < 0 ) return;
177  if ( !cf_callback ) return;
178 
179  cb_counter++;
180 
181 // mprintf(( "CB_COUNTER=%d\n", cb_counter ));
182 
183 #ifndef NDEBUG
184  if (filename != NULL)
185  strcpy_s(Processing_filename, filename);
186 #endif
187 
188  int t1 = timer_get_milliseconds();
189 
190  if ( (t1 > cf_timestamp) || ((cb_counter > cb_last_counter+155) && (cb_delta_step > 0)) ) {
191  cb_last_counter = cb_counter;
192  cf_in_callback++;
193  (*cf_callback)(cb_counter);
194  cf_in_callback--;
195  cf_timestamp = t1 + (1000/10);
196  }
197 }
198 
199 //======================== CODE TO MONITOR EVENTS ======================
200 
201 #ifndef NDEBUG
202 
203 #define MAX_VARIABLE_MONITORS 64
204 
205 static int Num_monitors = 0;
206 static monitor *Monitor[MAX_VARIABLE_MONITORS];
207 
208 monitor::monitor( char *_name )
209 {
210  int i;
211 
212  if ( Num_monitors >= MAX_VARIABLE_MONITORS ) {
213  Int3(); // Too many monitor variables!! Increase MAX_VARIABLE_MONITORS!!
214  return;
215  }
216 
217  for (i=0; i<Num_monitors; i++ ) {
218  int ret = stricmp( Monitor[i]->name, _name );
219 
220  if ( ret == 0) {
221  Int3(); // This monitor variable already exists!!!!
222  return;
223  } else if ( ret > 0 ) {
224  break; // Insert it here
225 
226  } else if ( ret < 0 ) {
227  // do nothing
228  }
229  }
230 
231  if ( i < Num_monitors ) {
232  // Insert it at element i
233  int j;
234  for (j=Num_monitors; j>i; j-- ) {
235  Monitor[j] = Monitor[j-1];
236  }
237  Monitor[i] = this;
238  Num_monitors++;
239  } else {
240  Monitor[Num_monitors] = this;
241  Num_monitors++;
242  }
243 
244  name = _name;
245  value = 0;
246 }
247 
248 
252 
253 DCF(monitor,"Monitors game performace by saving to file")
254 {
256 
257  if (dc_optional_string_either("help", "--help")) {
258  dc_printf("Usage: monitor [filename]\n");
259  dc_printf("Outputs monitoring info to [filename]. No filename turns it off\n" );
260  return;
261  }
262 
263  if (dc_maybe_stuff_string_white(filename)) {
264  if ( Monitor_inited ) {
265  dc_printf( "Monitor already on\n" );
266  } else {
267  Monitor_inited = 1;
268 
269  strcpy_s(Monitor_filename, filename.c_str());
270 
271  // Reset them all
272  int i;
273  for (i=0; i<Num_monitors; i++ ) {
274  Monitor[i]->value = 0;
275  Monitor[i]->sum = 0;
276  Monitor[i]->cnt = 0;
277  Monitor[i]->min = 0;
278  Monitor[i]->max = 0;
279  }
280 
281  FILE *fp = fopen( Monitor_filename, "wt" );
282  if ( fp ) {
283  for (i=0; i<Num_monitors; i++ ) {
284  if ( i > 0 ) {
285  fprintf( fp, "\t" );
286  }
287  fprintf( fp, "%s", Monitor[i]->name );
288 
289  }
290  fprintf( fp, "\n" );
291  fclose(fp);
292  }
293  dc_printf( "Monitor outputting to file '%s'\n", Monitor_filename );
294  monitor_last_time = -1;
295  }
296 
297  } else {
298  // Turn off monitoring
299  if ( Monitor_inited ) {
300  Monitor_inited = 0;
301 
302 /*
303  FILE *fp = fopen( Monitor_filename, "at" );
304  if ( fp ) {
305  fprintf( fp, "\n\n" );
306  fprintf( fp, "Name\tMin\tMax\tAvg\n" );
307  for (int i=0; i<Num_monitors; i++ ) {
308  if ( Monitor[i]->cnt > 0 ) {
309  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 );
310  } else {
311  fprintf( fp, "%s\t%d\t%d\t?\n", Monitor[i]->name, Monitor[i]->min, Monitor[i]->max );
312  }
313  }
314  fclose(fp);
315  }
316 */
317 
318  dc_printf( "Monitor to file '%s' turned off\n", Monitor_filename );
319  } else {
320  dc_printf( "Monitor isn't on\n" );
321  }
322  }
323 }
324 
325 
326 MONITOR(FrameRateX100)
327 
329 {
330  int i;
331  FILE * fp;
332 
333  fix this_time = timer_get_fixed_seconds();
334  fix frametime;
335 
336  if ( monitor_last_time != -1 ) {
337  frametime = this_time - monitor_last_time;
338  } else {
339  frametime = 0;
340  }
341 
342  if ( frametime > 0 ) {
343  MONITOR_INC(FrameRateX100, (F1_0*100) / frametime );
344  } else {
345  MONITOR_INC(FrameRateX100, 0 );
346  }
347 
348 
349  if ( !Monitor_inited ) {
350  return;
351  }
352 
353  if ( frametime != 0 ) {
354  fp = fopen( Monitor_filename, "at" );
355  if ( fp ) {
356 
357  for (i=0; i<Num_monitors; i++ ) {
358  if (i>0) fprintf( fp, "\t" );
359  fprintf( fp, "%d", Monitor[i]->value );
360  }
361  fprintf( fp, "\n" );
362  fclose(fp);
363  }
364 
365  for (i=0; i<Num_monitors; i++ ) {
366 
367  // Record stats
368  Monitor[i]->sum += Monitor[i]->value;
369 
370  if ( (Monitor[i]->cnt < 1) || (Monitor[i]->value < Monitor[i]->min )) {
371  Monitor[i]->min = Monitor[i]->value;
372  }
373 
374  if ( (Monitor[i]->cnt < 1) || (Monitor[i]->value > Monitor[i]->max )) {
375  Monitor[i]->max = Monitor[i]->value;
376  }
377 
378  Monitor[i]->cnt++;
379 
380  // Reset the value
381  Monitor[i]->value = 0;
382  }
383  } else {
384  for (i=0; i<Num_monitors; i++ ) {
385  // Reset the value
386  Monitor[i]->value = 0;
387  }
388  }
389 
390  monitor_last_time = timer_get_fixed_seconds();
391 
392 }
393 #endif //NDEBUG
394 
395 
396 #if MAX_DETAIL_LEVEL != 4
397 #error MAX_DETAIL_LEVEL is assumed to be 4 in SystemVars.cpp
398 #endif
399 
400 #if NUM_DEFAULT_DETAIL_LEVELS != 4
401 #error NUM_DEFAULT_DETAIL_LEVELS is assumed to be 4 in SystemVars.cpp
402 #endif
403 
404 // Detail level stuff
406  { // Low
407  0, // setting
408  // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
409  0, // nebula_detail; // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
410  0, // detail_distance; // 0=lowest MAX_DETAIL_LEVEL=highest
411  0, // hardware_textures; // 0=max culling, MAX_DETAIL_LEVEL=no culling
412  0, // num_small_debris; // 0=min number, MAX_DETAIL_LEVEL=max number
413  0, // num_particles; // 0=min number, MAX_DETAIL_LEVEL=max number
414  0, // num_stars; // 0=min number, MAX_DETAIL_LEVEL=max number
415  0, // shield_effects; // 0=min, MAX_DETAIL_LEVEL=max
416  2, // lighting; // 0=min, MAX_DETAIL_LEVEL=max
417 
418  // ==== Booleans ====
419  0, // targetview_model; // 0=off, 1=on
420  0, // planets_suns; // 0=off, 1=on
421  0, // weapon_extras
422  },
423  { // Medium
424  1, // setting
425  // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
426  2, // nebula_detail; // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
427  2, // detail_distance; // 0=lowest MAX_DETAIL_LEVEL=highest
428  2, // hardware_textures; // 0=max culling, MAX_DETAIL_LEVEL=no culling
429  2, // num_small_debris; // 0=min number, MAX_DETAIL_LEVEL=max number
430  2, // num_particles; // 0=min number, MAX_DETAIL_LEVEL=max number
431  2, // num_stars; // 0=min number, MAX_DETAIL_LEVEL=max number
432  2, // shield_effects; // 0=min, MAX_DETAIL_LEVEL=max
433  3, // lighting; // 0=min, MAX_DETAIL_LEVEL=max
434 
435  // ==== Booleans ====
436  1, // targetview_model; // 0=off, 1=on
437  1, // planets_suns; // 0=off, 1=on
438  1, // weapon extras
439  },
440  { // High level
441  2, // setting
442  // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
443  2, // nebula_detail; // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
444  2, // detail_distance; // 0=lowest MAX_DETAIL_LEVEL=highest
445  3, // hardware_textures; // 0=max culling, MAX_DETAIL_LEVEL=no culling
446  3, // num_small_debris; // 0=min number, MAX_DETAIL_LEVEL=max number
447  3, // num_particles; // 0=min number, MAX_DETAIL_LEVEL=max number
448  4, // num_stars; // 0=min number, MAX_DETAIL_LEVEL=max number
449  3, // shield_effects; // 0=min, MAX_DETAIL_LEVEL=max
450  4, // lighting; // 0=min, MAX_DETAIL_LEVEL=max
451 
452  // ==== Booleans ====
453  1, // targetview_model; // 0=off, 1=on
454  1, // planets_suns; // 0=off, 1=on
455  1, // weapon_extras
456  },
457  { // Highest level
458  3, // setting
459  // ===== Analogs (0-MAX_DETAIL_LEVEL) ====
460  3, // nebula_detail; // 0=lowest detail, MAX_DETAIL_LEVEL=highest detail
461  3, // detail_distance; // 0=lowest MAX_DETAIL_LEVEL=highest
462  4, // hardware_textures; // 0=max culling, MAX_DETAIL_LEVEL=no culling
463  4, // num_small_debris; // 0=min number, MAX_DETAIL_LEVEL=max number
464  4, // num_particles; // 0=min number, MAX_DETAIL_LEVEL=max number
465  4, // num_stars; // 0=min number, MAX_DETAIL_LEVEL=max number
466  4, // shield_effects; // 0=min, MAX_DETAIL_LEVEL=max
467  4, // lighting; // 0=min, MAX_DETAIL_LEVEL=max
468 
469  // ==== Booleans ====
470  1, // targetview_model; // 0=off, 1=on
471  1, // planets_suns; // 0=off, 1=on
472  1, // weapon_extras
473  },
474 };
475 
476 
477 // Global used to access detail levels in game and libs
479 
480 // Call this with:
481 // 0 - lowest
482 // NUM_DETAIL_LEVELS - highest
483 // To set the parameters in Detail to some set of defaults
485 {
486  if ( level < 0 ) {
487  Detail.setting = -1;
488  return;
489  }
490  Assert( level >= 0 );
492 
493  Detail = Detail_defaults[level];
494 
495  // reset nebula stuff
496  neb2_set_detail_level(level);
497 }
498 
499 // Returns the current detail level or -1 if custom.
501 {
502 // return Detail.setting;
503  int i;
504 
505  for (i=0; i<NUM_DEFAULT_DETAIL_LEVELS; i++ ) {
506  if ( memcmp( &Detail, &Detail_defaults[i], sizeof(detail_levels) )==0 ) {
507  return i;
508  }
509  }
510  return -1;
511 }
512 
513 #ifndef NDEBUG
514 DCF(detail_level,"Change the detail level")
515 {
516  int value;
517 
518  if (dc_optional_string_either("help", "--help")) {
519  dc_printf( "Usage: detail_level [n]\n");
520  dc_printf("[n] -- is detail level.\n");
521  dc_printf("\t0 is 'normal' detail,\n");
522  dc_printf("\tnegative values are lower, and\n");
523  dc_printf("\tpositive values are higher.\n\n");
524 
525  dc_printf("No parameter resets it to default.\n");
526  return;
527  }
528 
529  if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) {
530  dc_printf("Detail level set to %d\n", Game_detail_level);
531  return;
532  }
533 
534  if (dc_maybe_stuff_int(&value)) {
536  dc_printf("Detail level set to %i\n", Game_detail_level);
537 
538  } else {
539  Game_detail_level = 0;
540  dc_printf("Detail level reset\n");
541  }
542 }
543 
544 DCF(detail, "Turns on/off parts of the game for speed testing" )
545 {
546  int value;
547 
548  if (dc_optional_string_either("help", "--help")) {
549  dc_printf( "Usage: detail [n]\n");
550  dc_printf("[n] is detail bit to toggle:\n" );
551  dc_printf( " 1: draw the stars\n" );
552  dc_printf( " 2: draw the nebulas\n" );
553  dc_printf( " 4: draw the motion debris\n" );
554  dc_printf( " 8: draw planets\n" );
555  dc_printf( " 16: draw models not as blobs\n" );
556  dc_printf( " 32: draw lasers not as pixels\n" );
557  dc_printf( " 64: clear screen background after each frame\n" );
558  dc_printf( " 128: draw hud stuff\n" );
559  dc_printf( " 256: draw fireballs\n" );
560  dc_printf( " 512: do collision detection\n\n" );
561 
562  dc_printf("No argument will toggle between highest/lowest detail settings\n");
563  return;
564  }
565 
566  if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) {
567  dc_printf("Detail flags set to 0x%08x\n", Game_detail_flags);
568  dc_printf( " 1: draw the stars: %s\n", ((Game_detail_flags & 1) ? "on" : "off"));
569  dc_printf( " 2: draw the nebulas: %s\n", ((Game_detail_flags & 2)?"on" : "off"));
570  dc_printf( " 4: draw the motion debris: %s\n", ((Game_detail_flags & 4) ? "on" : "off"));
571  dc_printf( " 8: draw planets: %s\n", ((Game_detail_flags & 8) ? "on" : "off"));
572  dc_printf( " 16: draw models not as blobs: %s\n", ((Game_detail_flags & 16) ? "on" : "off"));
573  dc_printf( " 32: draw lasers not as pixels: %s\n", ((Game_detail_flags & 32) ? "on" : "off"));
574  dc_printf( " 64: clear screen background after each frame: %s\n", ((Game_detail_flags & 64) ? "on" : "off"));
575  dc_printf( " 128: draw hud stuff: %s\n", ((Game_detail_flags & 128) ? "on" : "off"));
576  dc_printf( " 256: draw fireballs: %s\n", ((Game_detail_flags & 256) ? "on" : "off"));
577  dc_printf( " 512: do collision detection: %s\n", ((Game_detail_flags & 512) ? "on" : "off"));
578  return;
579  }
580 
581  if (dc_maybe_stuff_int(&value)) {
583 
584  } else {
587  dc_printf( "Detail flags set lowest (except has screen clear)\n" );
588  } else {
590  dc_printf( "Detail flags set highest\n" );
591  }
592  }
593 }
594 #endif
595 
596 // Goober5000
597 // (Taylor says that for optimization purposes malloc/free should be used rather than vm_malloc/vm_free here)
598 // NOTE: Because this uses memcpy, it should only be used to sort POD elements!
599 void insertion_sort(void *array_base, size_t array_size, size_t element_size, int (*fncompare)(const void *, const void *))
600 {
601  int i, j;
602  void *current;
603  char *array_byte_base;
604 
605  // this is used to avoid having to cast array_base to (char *) all the time
606  array_byte_base = (char *) array_base;
607 
608  // allocate space for the element being moved
609  current = malloc(element_size);
610  if (current == NULL)
611  {
612  Int3();
613  return;
614  }
615 
616  // loop
617  for (i = 1; (unsigned) i < array_size; i++)
618  {
619  // grab the current element
620  memcpy(current, array_byte_base + (i * element_size), element_size);
621 
622  // bump other elements toward the end of the array
623  for (j = i - 1; (j >= 0) && (fncompare(array_byte_base + (j * element_size), current) > 0); j--)
624  {
625  memcpy(array_byte_base + ((j + 1) * element_size), array_byte_base + (j * element_size), element_size);
626  }
627 
628  // insert the current element at the correct place
629  memcpy(array_byte_base + ((j + 1) * element_size), current, element_size);
630  }
631 
632  // free the allocated space
633  free(current);
634 }
vci Viewer_chase_info
Definition: systemvars.cpp:56
int i
Definition: multi_pxo.cpp:466
int Framecount
Definition: systemvars.cpp:22
fix Missiontime
Definition: systemvars.cpp:19
char Monitor_filename[MAX_PATH_LEN]
Definition: systemvars.cpp:250
FadeType
Definition: systemvars.h:62
float Cutscene_bars_progress
Definition: systemvars.cpp:36
#define F1_0
Definition: fix.h:15
bool Basemap_override
Definition: systemvars.cpp:70
int max
Definition: pstypes.h:449
bool Glowpoint_override
Definition: systemvars.cpp:75
GLsizei const GLfloat * value
Definition: Glext.h:5646
int Monitor_inited
Definition: systemvars.cpp:249
int sum
Definition: pstypes.h:449
Assert(pm!=NULL)
bool dc_maybe_stuff_int(int *i)
Tries to stuff an int from the Command_string.
Definition: pstypes.h:88
#define DETAIL_DEFAULT
Definition: systemvars.h:105
vec3d leaning_position
Definition: systemvars.cpp:57
detail_levels Detail_defaults[NUM_DEFAULT_DETAIL_LEVELS]
Definition: systemvars.cpp:405
Definition: systemvars.h:72
#define MAX_VARIABLE_MONITORS
Definition: systemvars.cpp:203
Definition: 2d.h:82
char Processing_filename[MAX_PATH_LEN]
Definition: systemvars.cpp:66
angles Viewer_slew_angles
Definition: systemvars.cpp:54
bool Shadow_override
Definition: systemvars.cpp:80
int value
Definition: pstypes.h:448
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
bool PostProcessing_override
Definition: systemvars.cpp:78
#define Int3()
Definition: pstypes.h:292
float Noise[NOISE_NUM_FRAMES]
Definition: systemvars.cpp:83
Definition: systemvars.h:77
int Game_restoring
Definition: systemvars.cpp:26
bool Teamcolor_override
Definition: systemvars.cpp:79
int current_detail_level()
Definition: systemvars.cpp:500
void detail_level_set(int level)
Definition: systemvars.cpp:484
shader Viewer_shader
Definition: systemvars.cpp:39
unsigned int uint
Definition: pstypes.h:64
int game_busy_callback(void(*callback)(int count), int delta_step)
Definition: systemvars.cpp:144
void game_busy(const char *filename)
Definition: systemvars.cpp:173
bool GLSL_override
Definition: systemvars.cpp:77
detail_levels Detail
Definition: systemvars.cpp:478
int myrand()
Definition: systemvars.cpp:102
char * filename
int cnt
Definition: pstypes.h:449
bool Specmap_override
Definition: systemvars.cpp:72
bool Heightmap_override
Definition: systemvars.cpp:74
DCF(monitor,"Monitors game performace by saving to file")
Definition: systemvars.cpp:253
#define CUB_NONE
Definition: systemvars.h:50
#define NUM_DEFAULT_DETAIL_LEVELS
Definition: systemvars.h:185
bool dc_optional_string_either(const char *str1, const char *str2)
Searches for an optional string and it's alias.
#define MONITOR(function_name)
Definition: pstypes.h:454
void insertion_sort(void *array_base, size_t array_size, size_t element_size, int(*fncompare)(const void *, const void *))
Definition: systemvars.cpp:599
#define DETAIL_FLAG_CLEAR
Definition: systemvars.h:113
int Game_mode
Definition: systemvars.cpp:24
cfbp fp
Definition: cfile.cpp:1065
bool Glowpoint_use_depth_buffer
Definition: systemvars.cpp:76
long fix
Definition: pstypes.h:54
vei Viewer_external_info
Definition: systemvars.cpp:55
#define MONITOR_INC(function_name, inc)
Definition: pstypes.h:457
int Interface_last_tick
Definition: systemvars.cpp:62
int rand32()
Definition: systemvars.cpp:112
float Cutscene_delta_time
Definition: systemvars.cpp:34
typedef void(APIENTRY *PFNGLARRAYELEMENTEXTPROC)(GLint i)
GLuint const GLchar * name
Definition: Glext.h:5608
int Game_detail_level
Definition: systemvars.cpp:51
#define MAX_PATH_LEN
Definition: pstypes.h:325
fix t1
Definition: animplay.cpp:37
int Cutscene_bar_flags
Definition: systemvars.cpp:32
uint Game_detail_flags
Definition: systemvars.cpp:52
int Fade_end_timestamp
Definition: systemvars.cpp:42
int min
Definition: pstypes.h:449
fix timer_get_fixed_seconds()
Definition: timer.cpp:116
bool Envmap_override
Definition: systemvars.cpp:71
bool Normalmap_override
Definition: systemvars.cpp:73
An overhauled/updated debug console to allow monitoring, testing, and general debugging of new featur...
int Rand_count
Definition: systemvars.cpp:60
int Viewer_mode
Definition: systemvars.cpp:28
fix Skybox_timestamp
Definition: systemvars.cpp:20
FadeType Fade_type
Definition: systemvars.cpp:40
GLint GLsizei count
Definition: Gl.h:1491
fix Frametime
Definition: systemvars.cpp:21
void dc_printf(const char *format,...)
Prints the given char string to the debug console.
Definition: console.cpp:358
void neb2_set_detail_level(int level)
Definition: neb.cpp:301
fix monitor_last_time
Definition: systemvars.cpp:251
GLint level
Definition: Glext.h:5180
#define NOISE_NUM_FRAMES
Definition: systemvars.h:130
monitor(char *name)
Definition: systemvars.cpp:208
int timer_get_milliseconds()
Definition: timer.cpp:150
#define stricmp(s1, s2)
Definition: config.h:271
void monitor_update()
Definition: systemvars.cpp:328
bool dc_maybe_stuff_string_white(char *str, size_t len)
Tries to stuff a whitespace delimited string to out_str from the command line, stopping at the end of...
#define strcpy_s(...)
Definition: safe_strings.h:67
int Is_standalone
Definition: systemvars.cpp:59
int Fade_start_timestamp
Definition: systemvars.cpp:41