]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/gui_funcs.cxx
Don't restore initial screen geometry because there is nothing in fg_os* to resize...
[flightgear.git] / src / GUI / gui_funcs.cxx
index 784e6c5f48aae7a8c80ed4d12b0f78f3fe38172c..8e94939f3941694c3205e3527a54eaf4360069f7 100644 (file)
@@ -20,7 +20,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  * $Id$
  **************************************************************************/
@@ -255,11 +255,11 @@ void helpCb (puObject *)
 # ifdef __CYGWIN__
     cygwin32_conv_to_full_win32_path(path.c_str(),win32_name);
 # else
-    strcpy(win32_name,path.c_str());
+    strncpy(win32_name,path.c_str(), 1024);
 # endif
     Dummy[0] = 0;
     FindExecutable(win32_name, Dummy, ExecName);
-    sprintf(browserParameter, "file:///%s", win32_name);
+    snprintf(browserParameter, 1024, "file:///%s", win32_name);
     ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy,
                    SW_SHOWNORMAL ) ;
 
@@ -274,6 +274,7 @@ void fgHiResDump()
     FILE *f;
     string message;
     bool show_pu_cursor = false;
+    bool menu_status = fgGetBool("/sim/menubar/visibility");
     char *filename = new char [24];
     static int count = 1;
 
@@ -285,6 +286,7 @@ void fgHiResDump()
         fgSetBool("/sim/freeze/master", true);
     }
 
+    fgSetBool("/sim/menubar/visibility", false);
     TurnCursorOff();
     if ( !puCursorIsHidden() ) {
        show_pu_cursor = true;
@@ -299,8 +301,8 @@ void fgHiResDump()
     // we need two render frames here to clear the menu and cursor
     // ... not sure why but doing an extra fgRenderFrame() shouldn't
     // hurt anything
-    renderer->update( true );
-    renderer->update( true );
+    //renderer->update( true );
+    //renderer->update( true );
 
     // This ImageSize stuff is a temporary hack
     // should probably use 128x128 tile size and
@@ -374,6 +376,12 @@ void fgHiResDump()
     bool do_panel = fgPanelVisible();
     GLfloat panel_col_step = globals->get_current_panel()->getWidth() / ncols;
     GLfloat panel_row_step = globals->get_current_panel()->getHeight() / nrows;
+
+    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
+    glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
+    glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
+    glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
+    glHint(GL_FOG_HINT, GL_NICEST);
        
     /* Draw tiles */
     int more = 1;
@@ -381,6 +389,7 @@ void fgHiResDump()
         trBeginTile(tr);
         int curColumn = trGet(tr, TR_CURRENT_COLUMN);
         int curRow =  trGet(tr, TR_CURRENT_ROW);
+
         renderer->update( false );
         if ( do_hud )
             fgUpdateHUD( curColumn*hud_col_step,      curRow*hud_row_step,
@@ -422,6 +431,18 @@ void fgHiResDump()
 
     trDelete(tr);
 
+    glHint(GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
+    glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
+    glHint(GL_POINT_SMOOTH_HINT, GL_DONT_CARE);
+    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE);
+    if ( (!strcmp(fgGetString("/sim/rendering/fog"), "disabled")) ||
+         (!fgGetBool("/sim/rendering/shading"))) {
+        // if fastest fog requested, or if flat shading force fastest
+        glHint ( GL_FOG_HINT, GL_FASTEST );
+    } else if ( !strcmp(fgGetString("/sim/rendering/fog"), "nicest") ) {
+        glHint ( GL_FOG_HINT, GL_DONT_CARE );
+    }
+
     fclose(f);
 
     message = "Snapshot saved to \"";
@@ -439,6 +460,7 @@ void fgHiResDump()
     }
 
     TurnCursorOn();
+    fgSetBool("/sim/menubar/visibility", menu_status);
 
     if ( !freeze ) {
         fgSetBool("/sim/freeze/master", false);