#include <Math/fg_geodesy.h>
#include <Math/mat3.h>
#include <Math/polar.h>
-#include <Scenery/scenery.h>
+#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Time/event.hxx>
#include <Time/fg_time.hxx>
// fgInitVisuals() -- Initialize various GL/view parameters
static void fgInitVisuals( void ) {
fgLIGHT *l;
+ fgOPTIONS *o;
struct fgWEATHER *w;
l = &cur_light_params;
+ o = ¤t_options;
w = ¤t_weather;
// xglDisable( GL_DITHER );
// xglFogf (GL_FOG_DENSITY, w->visibility);
xglHint (GL_FOG_HINT, GL_NICEST /* GL_FASTEST */ );
- // draw wire frame
- // xglPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
+ if ( o->wireframe ) {
+ // draw wire frame
+ xglPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+ }
}
fgTIME *t;
fgVIEW *v;
double angle;
+ GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat color[4] = { 0.54, 0.44, 0.29, 1.0 };
// update view volume parameters
fgUpdateViewParams();
+ if ( o->skyblend ) {
+ glClearColor(black[0], black[1], black[2], black[3]);
+ } else {
+ glClearColor(l->sky_color[0], l->sky_color[1],
+ l->sky_color[2], l->sky_color[3]);
+ }
xglClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
// Tell GL we are switching to model view parameters
xglDisable( GL_CULL_FACE );
xglDisable( GL_FOG );
xglShadeModel( GL_SMOOTH );
- fgSkyRender();
+ if ( o->skyblend ) {
+ fgSkyRender();
+ }
// setup transformation for drawing astronomical objects
xglPushMatrix();
xglPopMatrix();
// draw scenery
- xglShadeModel( /* GL_FLAT */ GL_SMOOTH );
+ if ( o->shading ) {
+ xglShadeModel( GL_SMOOTH );
+ } else {
+ xglShadeModel( GL_FLAT );
+ }
xglEnable( GL_DEPTH_TEST );
- xglEnable( GL_FOG );
- xglFogfv (GL_FOG_COLOR, l->fog_color);
+ if ( o->fog ) {
+ xglEnable( GL_FOG );
+ xglFogfv (GL_FOG_COLOR, l->fog_color);
+ }
// set lighting parameters
xglLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_ambient );
xglLightfv(GL_LIGHT0, GL_DIFFUSE, l->scene_diffuse );
- if ( o->use_textures ) {
+ if ( o->textures ) {
// texture parameters
xglEnable( GL_TEXTURE_2D );
xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ) ;
// $Log$
+// Revision 1.9 1998/04/30 12:34:17 curt
+// Added command line rendering options:
+// enable/disable fog/haze
+// specify smooth/flat shading
+// disable sky blending and just use a solid color
+// enable wireframe drawing mode
+//
// Revision 1.8 1998/04/28 01:20:21 curt
// Type-ified fgTIME and fgVIEW.
// Added a command line option to disable textures.
#include <Debug/fg_debug.h>
#include <Joystick/joystick.h>
#include <Math/fg_random.h>
-#include <Scenery/scenery.h>
+#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Time/event.hxx>
#include <Time/fg_time.hxx>
// FG_Runway_altitude = 950.0;
// FG_Altitude = FG_Runway_altitude + 3.758099;
+ // Initial Position near KHSP (Hot Springs, VA)
+ // FG_Longitude = (-79.8338964 + 0.01) * DEG_TO_RAD;
+ // FG_Latitude = ( 37.9514564 + 0.008) * DEG_TO_RAD;
+ // FG_Runway_altitude = (3792 + 2800);
+ // FG_Altitude = FG_Runway_altitude + 3.758099;
+
+ // Initial Position at (SEZ) SEDONA airport
+ FG_Longitude = (-111.7884614 + 0.01) * DEG_TO_RAD;
+ FG_Latitude = ( 34.8486289 - 0.015) * DEG_TO_RAD;
+ FG_Runway_altitude = (4827 + 450);
+ FG_Altitude = FG_Runway_altitude + 3.758099;
+
// Initial Position: Somewhere near the Grand Canyon
// FG_Longitude = ( -112.5 ) * DEG_TO_RAD;
// FG_Latitude = ( 36.5 ) * DEG_TO_RAD;
// $Log$
+// Revision 1.8 1998/04/30 12:34:18 curt
+// Added command line rendering options:
+// enable/disable fog/haze
+// specify smooth/flat shading
+// disable sky blending and just use a solid color
+// enable wireframe drawing mode
+//
// Revision 1.7 1998/04/28 01:20:22 curt
// Type-ified fgTIME and fgVIEW.
// Added a command line option to disable textures.
// set initial values/defaults
strcpy(airport_id, "");
+
+ // Features
hud_status = 0;
+
+ // Rendering options
+ fog = 1;
+ shading = 1;
+ skyblend = 1;
+ textures = 1;
+ wireframe = 0;
+
+ // Time options
time_offset = 0;
- use_textures = 1;
}
} else if ( strncmp(argv[i], "--airport-id=", 13) == 0 ) {
argv[i] += 13;
strncpy(airport_id, argv[i], 4);
+ } else if ( strcmp(argv[i], "--disable-fog") == 0 ) {
+ fog = 0;
+ } else if ( strcmp(argv[i], "--enable-fog") == 0 ) {
+ fog = 1;
+ } else if ( strcmp(argv[i], "--shading-flat") == 0 ) {
+ shading = 0;
+ } else if ( strcmp(argv[i], "--shading-smooth") == 0 ) {
+ shading = 1;
+ } else if ( strcmp(argv[i], "--disable-skyblend") == 0 ) {
+ skyblend = 0;
+ } else if ( strcmp(argv[i], "--enable-skyblend") == 0 ) {
+ skyblend = 1;
} else if ( strcmp(argv[i], "--disable-textures") == 0 ) {
- use_textures = 0;
+ textures = 0;
} else if ( strcmp(argv[i], "--enable-textures") == 0 ) {
- use_textures = 1;
+ textures = 1;
+ } else if ( strcmp(argv[i], "--disable-wireframe") == 0 ) {
+ wireframe = 0;
+ } else if ( strcmp(argv[i], "--enable-wireframe") == 0 ) {
+ wireframe = 1;
} else if ( strncmp(argv[i], "--time-offset=", 14) == 0 ) {
time_offset = parse_time_offset(argv[i]);
} else {
printf("\n");
printf("Rendering Options:\n");
+ printf("\t--disable-fog: disable fog/haze\n");
+ printf("\t--enable-fog: enable fog/haze\n");
+ printf("\t--shading-flat: enable flat shading\n");
+ printf("\t--shading-smooth: enable smooth shading\n");
+ printf("\t--disable-skyblend: disable sky blending\n");
+ printf("\t--enable-skyblend: enable sky blending\n");
printf("\t--disable-textures: disable textures\n");
printf("\t--enable-textures: enable textures\n");
+ printf("\t--disable-wireframe: disable wireframe drawing mode\n");
+ printf("\t--enable-wireframe: enable wireframe drawing mode\n");
printf("\n");
printf("Time Options:\n");
// $Log$
+// Revision 1.5 1998/04/30 12:34:19 curt
+// Added command line rendering options:
+// enable/disable fog/haze
+// specify smooth/flat shading
+// disable sky blending and just use a solid color
+// enable wireframe drawing mode
+//
// Revision 1.4 1998/04/28 01:20:22 curt
// Type-ified fgTIME and fgVIEW.
// Added a command line option to disable textures.
// ID of initial starting airport
char airport_id[5];
- // HUD on/off
- int hud_status;
+ // Features
+ int hud_status; // HUD on/off
- // Offset true time by this many seconds
- int time_offset;
+ // Rendering options
+ int fog; // Fog enabled/disabled
+ int shading; // shading method, 0 = Flat, 1 = Smooth
+ int skyblend; // Blend sky to haze (using polygons) or just clear
+ int textures; // Textures enabled/disabled
+ int wireframe; // Wireframe mode enabled/disabled
- // Textures enabled/disabled
- int use_textures;
+ // Time options
+ int time_offset; // Offset true time by this many seconds
// Constructor
fgOPTIONS( void );
// $Log$
+// Revision 1.4 1998/04/30 12:34:19 curt
+// Added command line rendering options:
+// enable/disable fog/haze
+// specify smooth/flat shading
+// disable sky blending and just use a solid color
+// enable wireframe drawing mode
+//
// Revision 1.3 1998/04/28 01:20:23 curt
// Type-ified fgTIME and fgVIEW.
// Added a command line option to disable textures.
#include <Math/mat3.h>
#include <Math/polar.h>
#include <Math/vector.h>
-#include <Scenery/scenery.h>
+#include <Scenery/scenery.hxx>
#include <Time/fg_time.hxx>
#include "views.hxx"
// $Log$
+// Revision 1.7 1998/04/30 12:34:20 curt
+// Added command line rendering options:
+// enable/disable fog/haze
+// specify smooth/flat shading
+// disable sky blending and just use a solid color
+// enable wireframe drawing mode
+//
// Revision 1.6 1998/04/28 01:20:23 curt
// Type-ified fgTIME and fgVIEW.
// Added a command line option to disable textures.