]> git.mxchange.org Git - flightgear.git/commitdiff
Activated gyro drift ... look out!
authorcurt <curt>
Sat, 22 Jul 2000 23:25:49 +0000 (23:25 +0000)
committercurt <curt>
Sat, 22 Jul 2000 23:25:49 +0000 (23:25 +0000)
Cleaned a bit of cruft out of gui.[ch]xx
Cleaned up win_ratio() and fov code to make more sense and be a bit more
consistant and robust and less buggy and less susceptible to screw ups.
Panel is activated now by default, HUD is off by default.

src/Cockpit/steam.cxx
src/GUI/gui.cxx
src/GUI/gui.h
src/Main/main.cxx
src/Main/options.cxx
src/Main/views.cxx
src/Main/views.hxx

index 5955cda94e0595d8999b083d209186f732d5b6f4..fb7acb68656b5b6ba91dd9aabdf9a08bd8791870 100644 (file)
@@ -323,7 +323,7 @@ void FGSteam::_CatchUp()
 */
        if ( _UpdatesPending > 999999 )
            the_DG_err = FGBFI::getMagVar();
-       the_DG_degps = 0.0; /* HACK! */
+       the_DG_degps = 0.01; /* HACK! */
        if (dt<1.0) the_DG_err += dt * the_DG_degps;
        the_DG_deg = FGBFI::getHeading () - the_DG_err;
 
index 1695acb8bfabadd73481b82003180fbc17000578..23464e22a60d38bc3b066e2c97eed01cbd58bfd2 100644 (file)
@@ -667,26 +667,6 @@ void mkDialog (const char *txt)
     FG_PUSH_PUI_DIALOG( dialogBox );
 }
 
-// Repair any damage done to the Panel by other Gui Items
-void guiFixPanel( void )
-{
-#if 0 // this function does nothing anyway
-    bool freeze = globals->get_freeze();
-
-    if ( current_options.get_panel_status() ) {
-        // FGView *v = &current_view;
-        if( !freeze )
-            globals->set_freeze( true );
-
-       // we must have some something here at some point but this
-       // function does nothing now.
-
-        if( !freeze )
-            globals->set_freeze( false );
-    }
-#endif
-}
-
 // Toggle the Menu and Mouse display state
 void guiToggleMenu(void)
 {
index dc0e171e86fe5084dd12a8560ad5e5a7c53276f2..e33d617176d0cec4a4ffbc02476845ed0bf41486 100644 (file)
@@ -37,7 +37,6 @@ extern void BusyCursor( int restore );
 extern void guiToggleMenu(void);
 extern void mkDialog(const char *txt);
 extern void ConfirmExitDialog(void);
-extern void guiFixPanel( void );
 
 extern void fgDumpSnapShot();
 
@@ -66,7 +65,6 @@ extern char *gui_msg_RESET;  // "RESET"
 #define FG_POP_PUI_DIALOG( X ) \
     (X)->hide(); \
     puPopLiveInterface(); \
-    guiFixPanel(); \
     maybeToggleMouse();
 
 // Finalize Dialog Box Construction 
index 6837c403b12fff28b3189699355bb082a38c7559..ca412ad3c744ed7ec0a6ef84a29a403a63bb7aa7 100644 (file)
@@ -480,7 +480,8 @@ void fgRenderFrame( void ) {
        // glMatrixMode( GL_PROJECTION );
        // glLoadIdentity();
        float fov = current_options.get_fov();
-       ssgSetFOV(fov * current_view.get_win_ratio(), fov);
+       // ssgSetFOV(fov * current_view.get_win_ratio(), fov);
+       ssgSetFOV(fov, fov * current_view.get_win_ratio());
 
        double agl = current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER
            - scenery.cur_elev;
@@ -1111,12 +1112,11 @@ static void fgIdleFunction ( void ) {
 // options.cxx needs to see this for toggle_panel()
 // Handle new window size or exposure
 void fgReshape( int width, int height ) {
-    if ( ! current_options.get_panel_status() ) {
-       current_view.set_win_ratio( (GLfloat) width / (GLfloat) height );
+    if ( ! current_options.get_panel_status() || idle_state != 1000 ) {
+       current_view.set_win_ratio( height / width );
        glViewport(0, 0 , (GLint)(width), (GLint)(height) );
     } else {
-       current_view.set_win_ratio( (GLfloat) width / 
-                                   ((GLfloat) (height)*0.4232) );
+       current_view.set_win_ratio( (height*0.4232) / width );
        glViewport(0, (GLint)((height)*0.5768),
                   (GLint)(width), (GLint)((height)*0.4232) );
     }
@@ -1132,7 +1132,8 @@ void fgReshape( int width, int height ) {
 
     // glViewport ( 0, 0, width, height );
     float fov = current_options.get_fov();
-    ssgSetFOV(fov * current_view.get_win_ratio(), fov);
+    // ssgSetFOV(fov * current_view.get_win_ratio(), fov);
+    ssgSetFOV(fov, fov * current_view.get_win_ratio());
 
     fgHUDReshape();
 
index 5f59043847118e4d95351a27f583e1359a63fa04..bea86b188619f3c76dfb0fc05d6255474e372df6 100644 (file)
@@ -160,8 +160,8 @@ fgOPTIONS::fgOPTIONS() :
     auto_coordination(FG_AUTO_COORD_NOT_SPECIFIED),
 
     // Features
-    hud_status(1),
-    panel_status(0),
+    hud_status(0),
+    panel_status(1),
     sound(1),
     anti_alias_hud(0),
 
@@ -182,8 +182,8 @@ fgOPTIONS::fgOPTIONS() :
     skyblend(1),
     textures(1),
     wireframe(0),
-    xsize(640),
-    ysize(480),
+    xsize(800),
+    ysize(600),
     bpp(16),
     view_mode(FG_VIEW_PILOT),
 
@@ -257,11 +257,14 @@ fgOPTIONS::toggle_panel() {
        if ( current_panel != NULL )
          current_panel->setVisibility(true);
     }
-    if ( panel_status ) {
+
+    // new rule .. "fov" shouldn't get messed with like this.
+    /* if ( panel_status ) {
        fov *= 0.4232;
     } else {
        fov *= (1.0 / 0.4232);
-    }
+    } */
+
     // fgReshape( xsize, ysize);
     fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
 
@@ -633,8 +636,8 @@ int fgOPTIONS::parse_option( const string& arg ) {
     } else if ( arg == "--enable-panel" ) {
        panel_status = true;
        if ( current_panel != NULL )
-         current_panel->setVisibility(true);
-       fov *= 0.4232;
+           current_panel->setVisibility(true);
+       // fov *= 0.4232; /* NO!!! */
     } else if ( arg == "--disable-sound" ) {
        sound = false;
     } else if ( arg == "--enable-sound" ) {
index f9d6f682a079ea34331338092e8ca78d483aa62a..af24b3a6bdd9135023cbe0e1a3206ef1c138576d 100644 (file)
 #include "views.hxx"
 
 
-// temporary (hopefully) hack
-static int panel_hist = 0;
-
-
 // This is a record containing current view parameters for the current
 // aircraft position
 FGView pilot_view;
@@ -72,10 +68,9 @@ void FGView::Init( void ) {
     winHeight = current_options.get_ysize();
 
     if ( ! current_options.get_panel_status() ) {
-       set_win_ratio( (GLfloat) winWidth / (GLfloat) winHeight );
+       set_win_ratio( winHeight / winWidth );
     } else {
-       set_win_ratio( (GLfloat) winWidth / 
-                      ((GLfloat) (winHeight)*0.4232) );
+       set_win_ratio( (winHeight*0.4232) / winWidth );
     }
 
     // This never changes -- NHV
@@ -137,6 +132,7 @@ inline static void fgMakeLOCAL( sgMat4 dst, const double Theta,
 }
 #endif
 
+
 // Update the view volume, position, and orientation
 void FGView::UpdateViewParams( const FGInterface& f ) {
     UpdateViewMath(f);
@@ -147,8 +143,6 @@ void FGView::UpdateViewParams( const FGInterface& f ) {
        xglViewport(0, (GLint)((winHeight)*0.5768), (GLint)(winWidth), 
                    (GLint)((winHeight)*0.4232) );
     }
-
-    panel_hist = current_options.get_panel_status();
 }
 
 
index ec5bc00d00a989d925ddb5b544c0f98089854a28..4ff5bda493e3a6d1f492b3b3880c5d2ad22d0be5 100644 (file)
@@ -64,7 +64,7 @@ public:
     bool update_fov;
        
     // fov of view is specified in the y direction, win_ratio is used to
-    // calculate the fov in the X direction = width/height
+    // calculate the fov in the X direction = width / height
     double win_ratio;
 
     // width & height of window