Added a command line option to disable textures.
void GLUTkey(unsigned char k, int x, int y) {
fgCONTROLS *c;
fgOPTIONS *o;
- struct fgTIME *t;
- struct fgVIEW *v;
+ fgTIME *t;
+ fgVIEW *v;
struct fgWEATHER *w;
c = current_aircraft.controls;
/* Handle "special" keyboard events */
void GLUTspecialkey(int k, int x, int y) {
fgCONTROLS *c;
- struct fgVIEW *v;
+ fgVIEW *v;
c = current_aircraft.controls;
v = ¤t_view;
/* $Log$
-/* Revision 1.5 1998/04/25 22:06:29 curt
-/* Edited cvs log messages in source files ... bad bad bad!
+/* 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!
+ *
* Revision 1.4 1998/04/25 20:24:00 curt
* Cleaned up initialization sequence to eliminate interdependencies
* between sun position, lighting, and view position. This creates a
static void fgUpdateViewParams( void ) {
fgFLIGHT *f;
fgLIGHT *l;
- // struct fgTIME *t;
- struct fgVIEW *v;
+ fgVIEW *v;
f = current_aircraft.flight;
l = &cur_light_params;
- // t = &cur_time_params;
v = ¤t_view;
fgViewUpdate(f, v, l);
static void fgRenderFrame( void ) {
fgLIGHT *l;
fgOPTIONS *o;
- struct fgTIME *t;
- struct fgVIEW *v;
+ fgTIME *t;
+ fgVIEW *v;
double angle;
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
+ GLfloat color[4] = { 0.54, 0.44, 0.29, 1.0 };
l = &cur_light_params;
o = ¤t_options;
// set lighting parameters
xglLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_ambient );
xglLightfv(GL_LIGHT0, GL_DIFFUSE, l->scene_diffuse );
- // texture parameters
- xglEnable( GL_TEXTURE_2D ); /* xglDisable( GL_TEXTURE_2D ); */
- xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ) ;
- xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ) ;
- xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ;
- xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR /* GL_LINEAR_MIPMAP_LINEAR */ ) ;
- xglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
- xglHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ) ;
- // set base color (I don't think this is doing anything here)
- xglMaterialfv (GL_FRONT, GL_AMBIENT, white);
- xglMaterialfv (GL_FRONT, GL_DIFFUSE, white);
+
+ if ( o->use_textures ) {
+ // texture parameters
+ xglEnable( GL_TEXTURE_2D );
+ xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ) ;
+ xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ) ;
+ xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ;
+ xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+ GL_LINEAR /* GL_LINEAR_MIPMAP_LINEAR */ ) ;
+ xglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
+ xglHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ) ;
+ // set base color (I don't think this is doing anything here)
+ xglMaterialfv (GL_FRONT, GL_AMBIENT, white);
+ xglMaterialfv (GL_FRONT, GL_DIFFUSE, white);
+ } else {
+ xglDisable( GL_TEXTURE_2D );
+ xglMaterialfv (GL_FRONT, GL_AMBIENT, color);
+ xglMaterialfv (GL_FRONT, GL_DIFFUSE, color);
+ }
fgTileMgrRender();
// Update internal time dependent calculations (i.e. flight model)
void fgUpdateTimeDepCalcs(int multi_loop) {
fgFLIGHT *f;
- struct fgTIME *t;
- struct fgVIEW *v;
+ fgTIME *t;
+ fgVIEW *v;
int i;
f = current_aircraft.flight;
// int joy_b1, joy_b2;
fgAIRCRAFT *a;
fgFLIGHT *f;
- struct fgTIME *t;
+ fgTIME *t;
fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
// $Log$
+// Revision 1.8 1998/04/28 01:20:21 curt
+// Type-ified fgTIME and fgVIEW.
+// Added a command line option to disable textures.
+//
// Revision 1.7 1998/04/26 05:10:02 curt
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
//
// FG_Altitude = FG_Runway_altitude + 3.758099;
// Test Position
- // FG_Longitude = ( -109.5 ) * DEG_TO_RAD;
- // FG_Latitude = ( 32.5 ) * DEG_TO_RAD;
- // FG_Runway_altitude = (2646 + 2000);
+ // FG_Longitude = ( -110.5 ) * DEG_TO_RAD;
+ // FG_Latitude = ( 34.5 ) * DEG_TO_RAD;
+ // FG_Runway_altitude = (2646 + 6000);
// FG_Altitude = FG_Runway_altitude + 3.758099;
if ( strlen(o->airport_id) ) {
fgFLIGHT *f;
fgLIGHT *l;
- struct fgTIME *t;
- struct fgVIEW *v;
+ fgTIME *t;
+ fgVIEW *v;
l = &cur_light_params;
t = &cur_time_params;
// $Log$
+// Revision 1.7 1998/04/28 01:20:22 curt
+// Type-ified fgTIME and fgVIEW.
+// Added a command line option to disable textures.
+//
// Revision 1.6 1998/04/26 05:10:03 curt
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
//
strcpy(airport_id, "");
hud_status = 0;
time_offset = 0;
+ use_textures = 1;
}
while ( i < argc ) {
fgPrintf(FG_GENERAL, FG_INFO, "argv[%d] = %s\n", i, argv[i]);
- if ( strncmp(argv[i], "--airport-id=", 13) == 0 ) {
- argv[i] += 13;
- strncpy(airport_id, argv[i], 4);
+ // General Options
+ if ( (strcmp(argv[i], "--help") == 0) ||
+ (strcmp(argv[i], "-h") == 0) ) {
+ // help/usage request
+ return(FG_OPTIONS_HELP);
} else if ( strcmp(argv[i], "--disable-hud") == 0 ) {
hud_status = 0;
} else if ( strcmp(argv[i], "--enable-hud") == 0 ) {
hud_status = 1;
- } else if ( (strcmp(argv[i], "--help") == 0) ||
- (strcmp(argv[i], "-h") == 0) ) {
- // help/usage request
- return(FG_OPTIONS_HELP);
+ } else if ( strncmp(argv[i], "--airport-id=", 13) == 0 ) {
+ argv[i] += 13;
+ strncpy(airport_id, argv[i], 4);
+ } else if ( strcmp(argv[i], "--disable-textures") == 0 ) {
+ use_textures = 0;
+ } else if ( strcmp(argv[i], "--enable-textures") == 0 ) {
+ use_textures = 1;
} else if ( strncmp(argv[i], "--time-offset=", 14) == 0 ) {
time_offset = parse_time_offset(argv[i]);
} else {
// Print usage message
void fgOPTIONS::usage ( void ) {
printf("Usage: fg [ options ... ]\n");
- printf("\t--airport-id=ABCD: specify starting postion by airport id\n");
+ printf("\n");
+
+ printf("General Options:\n");
+ printf("\t--help -h: print usage\n");
+ printf("\n");
+
+ printf("Features:\n");
printf("\t--disable-hud: disable heads up display\n");
printf("\t--enable-hud: enable heads up display\n");
- printf("\t--help -h: print usage\n");
+ printf("\n");
+
+ printf("Initial Position:\n");
+ printf("\t--airport-id=ABCD: specify starting postion by airport id\n");
+ printf("\n");
+
+ printf("Rendering Options:\n");
+ printf("\t--disable-textures: disable textures\n");
+ printf("\t--enable-textures: enable textures\n");
+ printf("\n");
+
+ printf("Time Options:\n");
printf("\t--time-offset=[+-]hh:mm:ss: offset local time by this amount\n");
}
// $Log$
+// Revision 1.4 1998/04/28 01:20:22 curt
+// Type-ified fgTIME and fgVIEW.
+// Added a command line option to disable textures.
+//
// Revision 1.3 1998/04/26 05:01:19 curt
// Added an rint() / HAVE_RINT check.
//
// Offset true time by this many seconds
int time_offset;
+ // Textures enabled/disabled
+ int use_textures;
+
// Constructor
fgOPTIONS( void );
// $Log$
+// Revision 1.3 1998/04/28 01:20:23 curt
+// Type-ified fgTIME and fgVIEW.
+// Added a command line option to disable textures.
+//
// Revision 1.2 1998/04/25 15:11:13 curt
// Added an command line option to set starting position based on airport ID.
//
// This is a record containing current view parameters
-struct fgVIEW current_view;
+fgVIEW current_view;
// Initialize a view structure
-void fgViewInit(struct fgVIEW *v) {
+void fgViewInit(fgVIEW *v) {
fgPrintf( FG_VIEW, FG_INFO, "Initializing View parameters\n");
v->view_offset = 0.0;
// Update the view parameters
-void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, fgLIGHT *l) {
+void fgViewUpdate(fgFLIGHT *f, fgVIEW *v, fgLIGHT *l) {
MAT3vec vec, forward, v0, minus_z;
MAT3mat R, TMP, UP, LOCAL, VIEW;
double ntmp;
// $Log$
+// Revision 1.6 1998/04/28 01:20:23 curt
+// Type-ified fgTIME and fgVIEW.
+// Added a command line option to disable textures.
+//
// Revision 1.5 1998/04/26 05:10:04 curt
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
//
/* Define a structure containing view information */
-struct fgVIEW {
+typedef struct {
/* absolute view position */
struct fgCartesianPoint abs_view_pos;
/* the goal view offset for viewing (used for smooth view changes) */
double goal_view_offset;
-};
+} fgVIEW;
-extern struct fgVIEW current_view;
+extern fgVIEW current_view;
/* Initialize a view structure */
-void fgViewInit(struct fgVIEW *v);
+void fgViewInit(fgVIEW *v);
/* Update the view parameters */
-void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, fgLIGHT *l);
+void fgViewUpdate(fgFLIGHT *f, fgVIEW *v, fgLIGHT *l);
#endif /* _VIEWS_HXX */
/* $Log$
-/* Revision 1.3 1998/04/25 22:06:31 curt
-/* Edited cvs log messages in source files ... bad bad bad!
+/* Revision 1.4 1998/04/28 01:20:24 curt
+/* Type-ified fgTIME and fgVIEW.
+/* Added a command line option to disable textures.
/*
+ * Revision 1.3 1998/04/25 22:06:31 curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
* Revision 1.2 1998/04/24 00:49:22 curt
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
* Trying out some different option parsing code.