Made frame rate calculation average out over last 10 frames.
Borland C++ floating point exception workaround.
Added a --tile-radius=n option.
case 83: /* S key */
fgAPSetMode(0);
return;
-
+ case 68: /* D key */
+ fgAPSetHeading(AP_CURRENT_HEADING);
+ return;
}
} else {
fgPrintf( FG_INPUT, FG_DEBUG, "\n");
/* $Log$
-/* Revision 1.6 1998/04/28 01:20:20 curt
-/* Type-ified fgTIME and fgVIEW.
-/* Added a command line option to disable textures.
+/* Revision 1.7 1998/05/07 23:14:14 curt
+/* Added "D" key binding to set autopilot heading.
+/* Made frame rate calculation average out over last 10 frames.
+/* Borland C++ floating point exception workaround.
+/* Added a --tile-radius=n option.
/*
+ * Revision 1.6 1998/04/28 01:20:20 curt
+ * Type-ified fgTIME and fgVIEW.
+ * Added a command line option to disable textures.
+ *
* Revision 1.5 1998/04/25 22:06:29 curt
* Edited cvs log messages in source files ... bad bad bad!
*
#ifdef HAVE_WINDOWS_H
# include <windows.h>
+# include <float.h>
#endif
#include <GL/glut.h>
elapsed, remainder);
// Calculate frame rate average
- accum = 0.0;
- for ( i = FG_FRAME_RATE_HISTORY - 2; i >= 0; i-- ) {
- accum += g->frames[i];
- g->frames[i+1] = g->frames[i];
+ if ( elapsed > 0.0 ) {
+ accum = 0.0;
+ for ( i = FG_FRAME_RATE_HISTORY - 2; i >= 0; i-- ) {
+ accum += g->frames[i];
+ // printf("frame[%d] = %.2f\n", i, g->frames[i]);
+ g->frames[i+1] = g->frames[i];
+ }
+ g->frames[0] = 1000.0 / (float)elapsed;
+ // printf("frame[0] = %.2f\n", g->frames[0]);
+ accum += g->frames[0];
+ g->frame_rate = accum / (float)FG_FRAME_RATE_HISTORY;
+ // printf("ave = %.2f\n", g->frame_rate);
}
- g->frames[0] = 1000.0 / (float)elapsed;
- accum += g->frames[0];
- g->frame_rate = accum / (float)FG_FRAME_RATE_HISTORY;
// Calculate model iterations needed for next frame
fgPrintf( FG_ALL, FG_DEBUG,
f = current_aircraft.flight;
+#ifdef HAVE_BC5PLUS
+ _control87(MCW_EM, MCW_EM); /* defined in float.h */
+#endif
+
// Initialize the debugging output system
fgInitDebug();
// $Log$
+// Revision 1.12 1998/05/07 23:14:15 curt
+// Added "D" key binding to set autopilot heading.
+// Made frame rate calculation average out over last 10 frames.
+// Borland C++ floating point exception workaround.
+// Added a --tile-radius=n option.
+//
// Revision 1.11 1998/05/06 03:16:23 curt
// Added an averaged global frame rate counter.
// Added an option to control tile radius.
// General house keeping initializations
int fgInitGeneral( void ) {
fgGENERAL *g;
+ int i;
g = &general;
}
fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", g->root_dir);
+ // prime the frame rate counter pump
+ for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) {
+ g->frames[i] = 0.0;
+ }
+
return ( 1 );
}
// $Log$
+// Revision 1.11 1998/05/07 23:14:15 curt
+// Added "D" key binding to set autopilot heading.
+// Made frame rate calculation average out over last 10 frames.
+// Borland C++ floating point exception workaround.
+// Added a --tile-radius=n option.
+//
// Revision 1.10 1998/05/06 03:16:24 curt
// Added an averaged global frame rate counter.
// Added an option to control tile radius.
while ( (arg[0] != '=') && (arg[0] != '\0') ) {
arg++;
}
-
+
+ if ( arg[0] == '=' ) {
+ arg++;
+ }
+
+ printf("parse_int(): arg = %s\n", arg);
+
result = atoi(arg);
if ( result < min ) { result = min; }
if ( result > max ) { result = max; }
+ printf("parse_int(): result = %d\n", result);
return(result);
}
} else if ( strcmp(argv[i], "--enable-wireframe") == 0 ) {
wireframe = 1;
} else if ( strncmp(argv[i], "--tile-radius=", 14) == 0 ) {
- tile_radius = parse_int(argv[i], 3, 7);
+ tile_radius = parse_int(argv[i], 3, 9);
} else if ( strncmp(argv[i], "--time-offset=", 14) == 0 ) {
time_offset = parse_time_offset(argv[i]);
} else {
// $Log$
+// Revision 1.8 1998/05/07 23:14:16 curt
+// Added "D" key binding to set autopilot heading.
+// Made frame rate calculation average out over last 10 frames.
+// Borland C++ floating point exception workaround.
+// Added a --tile-radius=n option.
+//
// Revision 1.7 1998/05/06 03:16:25 curt
// Added an averaged global frame rate counter.
// Added an option to control tile radius.
REM Skip ahead to CONT1 if FG_ROOT has a value\r
IF NOT %FG_ROOT%.==. GOTO CONT1\r
\r
-SET FG_ROOT=@prefix@\r
+SET FG_ROOT=.\r
\r
:CONT1\r
\r
\r
REM Now that FG_ROOT has been set, run the program\r
ECHO FG_ROOT = %FG_ROOT%\r
-%FG_ROOT%\BIN\FG.EXE\r
+%FG_ROOT%\BIN\FG.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9\r
\r
GOTO END\r
\r