]> git.mxchange.org Git - flightgear.git/commitdiff
Fixes to iochannel parsing which had gotten broke at some point.
authorcurt <curt>
Fri, 26 Jan 2001 00:21:36 +0000 (00:21 +0000)
committercurt <curt>
Fri, 26 Jan 2001 00:21:36 +0000 (00:21 +0000)
Fixed --disable-skyblend

src/Main/fg_io.cxx
src/Main/globals.hxx
src/Main/main.cxx
src/Main/options.cxx

index 109aaccfbaa5295ab5d49a29dd488ea4d806fcad..9c3afb745c84826ce4fbf37ac0b33d82d4657d68 100644 (file)
@@ -193,9 +193,11 @@ static FGProtocol *parse_port_config( const string& config )
 // step through the port config streams (from fgOPTIONS) and setup
 // serial port channels for each
 void fgIOInit() {
+    // FG_LOG( FG_IO, FG_INFO, "I/O Channel initialization, " << 
+    //         globals->get_channel_options_list()->size() << " requests." );
+
     FGProtocol *p;
-    string_list channel_options_list = 
-       globals->get_channel_options_list();
+    string_list *channel_options_list = globals->get_channel_options_list();
 
     // we could almost do this in a single step except pushing a valid
     // port onto the port list copies the structure and destroys the
@@ -203,8 +205,8 @@ void fgIOInit() {
 
     // parse the configuration strings and store the results in the
     // appropriate FGIOChannel structures
-    for ( int i = 0; i < (int)channel_options_list.size(); ++i ) {
-       p = parse_port_config( channel_options_list[i] );
+    for ( int i = 0; i < (int)channel_options_list->size(); ++i ) {
+       p = parse_port_config( (*channel_options_list)[i] );
        if ( p != NULL ) {
            p->open();
            global_io_list.push_back( p );
index 72d3433eff7f0988427fb2a74a56be1b8bfd0a6d..fc1c52184b33894c1142725e8c1c811f5d66368b 100644 (file)
@@ -86,7 +86,7 @@ private:
     SGPropertyNode *initial_state;
 
     // list of serial port-like configurations
-    string_list channel_options_list;
+    string_list *channel_options_list;
 
 public:
 
@@ -132,8 +132,11 @@ public:
     inline SGPropertyNode *get_props () { return props; }
     inline void set_props( SGPropertyNode *n ) { props = n; }
 
-    inline string_list get_channel_options_list () {
-      return channel_options_list;
+    inline string_list *get_channel_options_list () {
+       return channel_options_list;
+    }
+    inline void set_channel_options_list( string_list *l ) {
+       channel_options_list = l;
     }
 
 
index 0cddd59dc531156b758b561d04e21761d734cf34..34edfd7fba47480f7b89c1f4b46dac797e2b8af9 100644 (file)
@@ -480,7 +480,6 @@ void fgRenderFrame( void ) {
 #endif
 
        thesky->modify_vis( cur_fdm_state->get_Altitude() * FEET_TO_METER,
-                               
                            ( global_multi_loop * 
                              fgGetInt("/sim/speed-up") ) /
                            (double)fgGetInt("/sim/model-hz") );
@@ -682,8 +681,10 @@ void fgRenderFrame( void ) {
        // position tile nodes and update range selectors
        global_tile_mgr.prep_ssg_nodes();
 
-       // draw the sky backdrop
-       thesky->preDraw();
+       if ( fgGetBool("/sim/rendering/skyblend") ) {
+           // draw the sky backdrop
+           thesky->preDraw();
+       }
 
        // draw the ssg scene
        glEnable( GL_DEPTH_TEST );
@@ -697,8 +698,10 @@ void fgRenderFrame( void ) {
 
        ssgCullAndDraw( lighting );
 
-       // draw the sky cloud layers
-       thesky->postDraw( cur_fdm_state->get_Altitude() * FEET_TO_METER );
+       if ( fgGetBool("/sim/rendering/skyblend") ) {
+           // draw the sky cloud layers
+           thesky->postDraw( cur_fdm_state->get_Altitude() * FEET_TO_METER );
+       }
 
        // display HUD && Panel
        glDisable( GL_FOG );
@@ -769,12 +772,12 @@ void fgUpdateTimeDepCalcs() {
        }
 
        // cout << "multi_loop = " << multi_loop << endl;
-       for ( i = 0; i < multi_loop; ++i ) {
+       for ( i = 0; i < multi_loop * fgGetInt("/sim/speed-up"); ++i ) {
            // run Autopilot system
            current_autopilot->run();
 
-           // update autopiot
-           cur_fdm_state->update( 1 * fgGetInt("/sim/speed-up") );
+           // update autopilot
+           cur_fdm_state->update( 1 );
        }
        FGSteam::update( multi_loop * fgGetInt("/sim/speed-up") );
     } else {
@@ -1408,6 +1411,9 @@ int main( int argc, char **argv ) {
     FGViewerLookAt *chase = new FGViewerLookAt;
     globals->get_viewmgr()->add_view( chase );
 
+    string_list *col = new string_list;
+    globals->set_channel_options_list( col );
+
     // set current view to 0 (first) which is our main pilot view
     globals->set_current_view( globals->get_viewmgr()->get_view( 0 ) );
 
index 737cbf77651d398f9d12f5360d7de22f5c28de21..3b442d959df8f3012fd2e807caddb35b620b7aaa 100644 (file)
@@ -441,7 +441,7 @@ static bool
 parse_channel( const string& type, const string& channel_str ) {
     // cout << "Channel string = " << channel_str << endl;
 
-    globals->get_channel_options_list().push_back( type + "," + channel_str );
+    globals->get_channel_options_list()->push_back( type + "," + channel_str );
 
     return true;
 }