]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Various MSVC patches.
[flightgear.git] / src / Main / main.cxx
index 892aeb4d03f9ba2158c26332ca0e8efcbbc357f4..0a841f6da82c6096b630f7c5f6529865885b4ade 100644 (file)
@@ -684,7 +684,7 @@ void fgRenderFrame( void ) {
        // glMatrixMode( GL_PROJECTION );
        // glLoadIdentity();
        float fov = globals->get_current_view()->get_fov();
-       ssgSetFOV(fov, fov * globals->get_current_view()->get_win_ratio());
+       ssgSetFOV(fov, fov * globals->get_current_view()->get_fov_ratio());
 
        double agl = current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER
            - scenery.cur_elev;
@@ -1391,36 +1391,28 @@ 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 ) {
+    int view_h;
+
+    if ( fgPanelVisible() && idle_state == 1000 ) {
+       view_h = (int)(height * (current_panel->getViewHeight() -
+                                current_panel->getYOffset()) / 768.0);
+    } else {
+       view_h = height;
+    }
+
     // for all views
     for ( int i = 0; i < globals->get_viewmgr()->size(); ++i ) {
-       if ( ! fgPanelVisible() || idle_state != 1000 ) {
-           globals->get_viewmgr()->get_view(i)->
-               set_win_ratio( (float)height / (float)width );
-       } else {
-           int view_h =
-               int((current_panel->getViewHeight() -
-                    current_panel->getYOffset())
-                   * (height / 768.0)) + 1;
-           globals->get_viewmgr()->get_view(i)->
-               set_win_ratio( (float)view_h / (float)width );
-       }
+       globals->get_viewmgr()->get_view(i)->
+            set_aspect_ratio((float)view_h / (float)width);
     }
 
-    if ( ! fgPanelVisible() || idle_state != 1000 ) {
-       glViewport(0, 0 , (GLint)(width), (GLint)(height) );
-    } else {
-        int view_h =
-           int((current_panel->getViewHeight() - current_panel->getYOffset())
-               * (height / 768.0)) + 1;
-       glViewport(0, (GLint)(height - view_h),
-                  (GLint)(width), (GLint)(view_h) );
-    }
+    glViewport( 0, (GLint)(height - view_h), (GLint)(width), (GLint)(view_h) );
 
     fgSetInt("/sim/startup/xsize", width);
     fgSetInt("/sim/startup/ysize", height);
 
     float fov = globals->get_current_view()->get_fov();
-    ssgSetFOV(fov, fov * globals->get_current_view()->get_win_ratio());
+    ssgSetFOV(fov, fov * globals->get_current_view()->get_fov_ratio());
 
     fgHUDReshape();
 }
@@ -1523,10 +1515,6 @@ int mainLoop( int argc, char **argv ) {
     argc = ccommand( &argv );
 #endif
 
-#ifdef HAVE_BC5PLUS
-    _control87(MCW_EM, MCW_EM);  /* defined in float.h */
-#endif
-
     // set default log levels
     sglog().setLogLevels( SG_ALL, SG_INFO );
 
@@ -1867,11 +1855,15 @@ int mainLoop( int argc, char **argv ) {
 // Main entry point; catch any exceptions that have made it this far.
 int main ( int argc, char **argv ) {
 
-#ifdef _MSC_VER
+#if defined( _MSC_VER ) && defined( DEBUG )
     // Christian, we should document what this does
     _control87( _EM_INEXACT, _MCW_EM );
 #endif
 
+#if defined( HAVE_BC5PLUS )
+    _control87(MCW_EM, MCW_EM);  /* defined in float.h */
+#endif
+
     // FIXME: add other, more specific
     // exceptions.
     try {