X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fmain.cxx;h=05414d4cd278dfd4b3cbc2e0556dee7229c19fba;hb=a6e0a696376ba2d426eb534bb83ec42038a501e7;hp=685f5db0b90e4143546ee03454a96f66cc07201a;hpb=a01a26a009b519126037f58ae0cabd903d25c665;p=flightgear.git diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 685f5db0b..05414d4cd 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -35,7 +35,7 @@ #endif #include -#include +#include #include #include @@ -53,6 +53,10 @@ # include // for stat() #endif +// #ifdef HAVE_LIBX11 +// # include +// #endif + #include #include @@ -366,7 +370,7 @@ void fgRenderFrame( void ) { sgVec3 po; // chase view pilot_offset sgVec3 wup; // chase view world up - sgSetVec3( po, 0.0, 0.0, 50.0 ); + sgSetVec3( po, 0.0, 0.0, 100.0 ); sgCopyVec3( wup, pilot_view->get_world_up() ); sgMat4 CXFM; // chase view + pilot offset xform sgMakeRotMat4( CXFM, @@ -1385,9 +1389,7 @@ int main( int argc, char **argv ) { // Allocate global data structures. This needs to happen before // we parse command line options - SGPropertyNode *props = new SGPropertyNode; globals = new FGGlobals; - globals->set_props( props ); // seed the random number generater sg_srandom_time(); @@ -1450,6 +1452,20 @@ int main( int argc, char **argv ) { // fonts !!! guiInit(); +#ifdef GL_EXT_texture_lod_bias + glTexEnvf( GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, -0.5 ) ; +#endif + +#if 0 +#ifdef GL_EXT_texture_filter_anisotropic + float max_anisotropy; + glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, + max_anisotropy ); + cout << "Max anisotropy = " << max_anisotropy << endl; +#endif +#endif + // set current_options lon/lat if an airport id is specified // cout << "3. airport_id = " << fgGetString("/sim/startup/airport-id") << endl; if ( fgGetString("/sim/startup/airport-id").length() ) { @@ -1543,12 +1559,12 @@ int main( int argc, char **argv ) { globals->get_ephem()->getStars(), 60000.0 ); if ( fgGetBool("/environment/clouds/status") ) { - thesky->add_cloud_layer( 2000.0, 200.0, 50.0, 40000.0, - SG_CLOUD_OVERCAST ); + // thesky->add_cloud_layer( 2000.0, 200.0, 50.0, 40000.0, + // SG_CLOUD_OVERCAST ); thesky->add_cloud_layer( 2600.0, 200.0, 50.0, 40000.0, SG_CLOUD_MOSTLY_CLOUDY ); - thesky->add_cloud_layer( 3000.0, 200.0, 50.0, 40000.0, - SG_CLOUD_MOSTLY_SUNNY ); + // thesky->add_cloud_layer( 3000.0, 200.0, 50.0, 40000.0, + // SG_CLOUD_MOSTLY_SUNNY ); thesky->add_cloud_layer( 6000.0, 20.0, 10.0, 40000.0, SG_CLOUD_CIRRUS ); } @@ -1585,12 +1601,19 @@ int main( int argc, char **argv ) { #if !defined( PLIB_1_2_X ) // this should be redundant ... but it breaks for relative paths - // w/ plib-1.2.0 - ssgModelPath( (char *)full_model.dir().c_str() ); + // ssgModelPath( (char *)full_model.dir().c_str() ); #endif ssgTexturePath( (char *)full_model.dir().c_str() ); ssgEntity *acmodel_obj = ssgLoad( (char *)full_model.c_str() ); + if( !acmodel_obj ) { + // fall back to default + acmodel_obj = ssgLoad( (char *)"Models/Geometry/glider.ac" ); + if( !acmodel_obj ) { + SG_LOG( SG_GENERAL, SG_ALERT, "FAILED to LOAD an AC model! ..." ); + exit(-1); + } + } // find moving parts (if this is an MDL model) flaps_selector = (ssgSelector*)fgFindNode( acmodel_obj, "FLAPS" ); @@ -1737,7 +1760,7 @@ void fgLoadDCS(void) { SG_LOG ( SG_TERRAIN, SG_ALERT, "Finished object processing." ); ship_sel->clrTraversalMaskBits( SSGTRAV_HOT ); - scene->addKid( ship_sel ); //add selector node to root node + scene->addKid( ship_sel ); //add selector node to root node } return;