1
0
Fork 0
Commit graph

2589 commits

Author SHA1 Message Date
Szymon Acedański
4403f22a8b Support multiple nav.dat and fix.dat files 2017-03-09 00:10:26 +01:00
Torsten Dreyer
6257c29fd8 Merge /u/martymac/flightgear/ branch freebsd-fix into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/79/
2017-03-07 07:51:59 +00:00
James Turner
39b239957e Startup-tip system.
Replace the license / website text with a startup tip. Tips are shown
based on the day of the year, can be changed easily.
2017-03-03 23:21:18 +02:00
Ganael Laplanche
c91284b3e1 Link to execinfo to fix build on FreeBSD 2017-03-01 20:53:56 +00:00
James Turner
868ec1f500 Log a message when launcher is requested without Qt. 2017-03-01 15:27:33 +00:00
James Turner
3653508412 Build- and run-time concept of developer mode.
Make a single Cmake value to expose the build type to code, and use
this to default a run-time ‘developer-mode’ property, which can be
over-ridden from the command line.

Use this to drive the different warning levels. Policies subject to
review, especially whether nightly builds should default to 
developer mode or not.
2017-02-27 23:37:59 +00:00
James Turner
cad283b2ce Change Windows multi-app launch detection.
Instead of using a .pid file, use a named mutex. This avoids any chance of stale datacausing mis-detection.
2017-02-27 15:45:28 +00:00
Erik Hofman
706ce325d3 Do not forget to signal the proper signal number first 2017-02-27 11:50:51 +01:00
Erik Hofman
6179a8d8d7 Still generate a core file 2017-02-27 11:46:25 +01:00
Peter Sadrozinski
ec4b9f8542 Alternative terrain engine based on pagedLOD
- remove TileMgr from sub systems - add to btg terrain engine
2017-02-26 10:17:15 -05:00
James Turner
918db84ac4 New splash screen system.
Uses TTF fonts, and displays more information textually including
the application version and current aircraft.

Also rename FGRenderer::splashinit to preinit, as was suggested
a long time ago.
2017-02-25 21:47:58 +00:00
Florent Rougon
8f24de831d Adapt includes according to relocation of SimGear's iostreams-related files
This change is the logical counterpart of SimGear's change from commit
79f869a7f32910197be72b21f6489fbbba02c836 that moved the following files
from simgear/misc to simgear/io/iostreams:

  gzcontainerfile.cxx
  gzcontainerfile.hxx
  gzfstream.cxx (formerly zfstream.cxx)
  gzfstream.hxx (formerly zfstream.hxx)
  sgstream.cxx
  sgstream.hxx
  sgstream_test.cxx
2017-02-12 21:30:51 +01:00
Erik Hofman
e39eac8a6d Nicer, human readanle, stack trace output 2017-01-30 15:58:09 +01:00
Erik Hofman
57dc778565 Fix a last minute typo 2017-01-30 12:31:05 +01:00
Erik Hofman
182f758eb7 Add a segmentation-fault report for Linux and Apple 2017-01-30 12:29:51 +01:00
James Turner
5d27d2509f Add “—-log-file” option, to log to other locations.
Each argument creates another log file, in the directory named. Symbolic
value ‘desktop’ creates logs on the user’s desktop.

Needs corresponding SimGear commit to build
2017-01-30 08:01:20 +01:00
Rebecca N. Palmer
2b1336cd39 clear GroundLightManager also on non-standard exits to avoid crash
(e.g. --show-aircraft,
https://sourceforge.net/p/flightgear/codetickets/1935/ )
2017-01-28 23:07:23 +00:00
James Turner
70e79a849e Tweak launcher to be a MainWindow
For unknown reasons this seems to alleviate the word-wrap / min-height
bug on Windows. Committing so we can test and verify this is really
the case before the next release.
2017-01-26 00:38:19 +00:00
Torsten Dreyer
1f9ece8303 Location preset for ENBR (2017.1) 2017-01-25 14:00:06 +01:00
James Turner
78498c560d Rename preferences.xml -> defaults.xml
Requires FGData commit: 0565eaab10a5d466cd485766b17d1870936a0a57
(which actually renames the file).

Also disables the preferences-load command since I don’t believe it
would actually be safe to reload the defaults without doing a simulator
reset (aircraft -set.xml values would be overwritten, for example)
2017-01-12 09:45:19 +00:00
Erik Hofman
596ba557f1 Detect the absence of SSE2 hardware as soon as possible and bail out if it is not found but FligthGear is compiled with SSE2 support 2017-01-06 16:30:51 +01:00
Florent Rougon
d762db2db8 Fix null pointer dereference introduced by 8aec4a0cef 2017-01-06 13:07:00 +01:00
James Turner
4a3ee6a74a Relax base-package and SimGear version checks.
As discussed on the devel list, only require the major+minor versions
of FG+SG+data to match by default. If we encounter a situation on
a release branch where stronger checks are needed, it’s easy to
restore.
2017-01-05 11:09:41 +00:00
Florent Rougon
ea827f5677 Revert commits e1b65590, 0b1c3568 and 72886289
Commit e1b65590cb was:

  Add the top-level options.xml and Translations directory moved out of
  FGData

Commit 0b1c356837 was:

  Make the FG installation prefix available to C++ code via config.h

Commit 7288628919 was:

  Load --help output and translated strings from
  $FG_INSTALL_PREFIX/share/flightgear

For the reasons of these revertings, see the thread at
<https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/CAHtsj_eFdxLoXXoNq%3D3OKNRmyR6-FowFL97TASdQJx8N05Lmig%40mail.gmail.com/#msg35580548>,
including <https://sourceforge.net/p/flightgear/mailman/message/35584363/>,
<https://sourceforge.net/p/flightgear/mailman/message/35584803/> and
<https://sourceforge.net/p/flightgear/mailman/message/35585421/> (appearing
out-of-thread according to the SF mailing list archive...).
2017-01-05 06:53:53 +01:00
Florent Rougon
9fdcca5e94 Revert relevant parts of f4d8d8c6a1
For the reasons of this reverting, see the thread at
<https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/CAHtsj_eFdxLoXXoNq%3D3OKNRmyR6-FowFL97TASdQJx8N05Lmig%40mail.gmail.com/#msg35580548>,
including <https://sourceforge.net/p/flightgear/mailman/message/35584363/>,
<https://sourceforge.net/p/flightgear/mailman/message/35584803/> and
<https://sourceforge.net/p/flightgear/mailman/message/35585421/> (appearing
out-of-thread according to the SF mailing list archive).
2017-01-05 06:31:52 +01:00
James Turner
8aec4a0cef Silence a clang warning. 2017-01-03 15:11:12 +00:00
Florent Rougon
f4d8d8c6a1 Minor changes
Essentially, adapt two places where options.xml was supposed to be found
in $FG_ROOT (in one of these, the comment was already incorrect way
before the recent change moving options.xml out of FGData).
2016-12-29 14:01:56 +01:00
Florent Rougon
7288628919 Load --help output and translated strings from $FG_INSTALL_PREFIX/share/flightgear
$FG_INSTALL_PREFIX represents the FlightGear installation prefix, such
as /usr, /usr/local or /opt/FlightGear on Unix systems. Copying the
--help output and translated strings there avoids having to write to
$FG_ROOT when 'make install' (or some OS-dependent equivalent) is run
from the FlightGear build directory---that would be ugly when $FG_ROOT
points to the FGData Git repository.

In FGLocale::FGLocale(), Translations/locale.xml is loaded using
readProperties() and fatalMessageBox() (in case an error is
encountered). Note that it couldn't be loaded via fgLoadProps() in the
current state, because this function relies on guiErrorMessage() when an
error is encountered, which calls mkDialog(), which itself does
globals->get_subsystem("gui"). This last call can't be done from
FGGlobals' constructor---where the 'globals' pointer is still
NULL---hence the need for a different mechanism not relying on
FGGlobals.

For consistency, and also because it provides a better user experience[1],
load options.xml using the same method instead of with fgLoadProps().

[1] I.e., in case of an error, the user gets to see a graphical popup
    window with an explanatory message before FG exits, assuming he is
    either on Windows, or on Mac, or has Qt support built in FG, as
    opposed to only an SG_LOG() call [because when options.xml is
    loaded, guiErrorMessage() used by fgLoadProps() can't use the 'gui'
    subsystem].
2016-12-29 13:40:16 +01:00
Florent Rougon
a6afda53bb Split flightgear::initApp() to make it usable even without FGGlobals initialized
- Add an optional argument to flightgear::initApp(): doInitQSettings.
  This argument defaults to true, preserving initApp()'s behavior in
  this respect. If this argument is set to false, FGGlobals doesn't have
  to be initialized.

- New function flightgear::initQSettings(), called by
  flightgear::initApp() when its 'doInitQSettings' argument is true.
  This allows initializing the QSettings exactly when it is needed.

- New function flightgear::checkKeyboardModifiersForSettingFGRoot().
  The code it contains used to be run from initApp(), which is
  undesirable because:

    1) initApp() is not only called at FG initialization (fgMainInit()),
       but also from QtMessageBox(), from QtFileDialog::exec() and twice
       from Options::setupRoot(). However, checking the Alt and Shift
       modifiers to set 'fg-root' in QSettings to the special value
       "!ask" only makes sense in fgMainInit(), not in these other
       places.

    2) This code relies on the QSettings to be set up, and therefore on
       FGGlobals. Thus, freeing initApp() of its dependency on FGGlobals
       requires splitting this keyboard modifiers checking code out of
       initApp().
2016-12-29 11:33:19 +01:00
Florent Rougon
d6313e52b5 Correctly initialize an SGPath from the APPDATA environment variable on Windows
This is likely to fix the problem preventing startup on Windows when the
username contains non-ASCII characters (cf.
<https://forum.flightgear.org/viewtopic.php?f=22&t=31320>). Thanks to
Headhunter76 for the useful report and to wkitty42 for doing the liaison
officer. ;-)

I can't actually test this, because I don't have Windows. Windows users
should report whether this works for them.
2016-12-28 16:57:26 +01:00
James Turner
85f75dee4f Fix a couple of potential crashes on exit.
- Font cache shutdown explicitly
- Pending GUI snapshot cleared explicitly

Both of these are dependencies on the osgViewer / GLContext.
2016-12-10 23:24:09 +00:00
Torsten Dreyer
7f3fa4a3b7 Set fallback (hardcoded) startup airport to LSZH 2016-11-22 09:27:30 +01:00
James Turner
e64a2db5a0 Remove the scenery path mangling.
Requires a matching SG commit for correct operation.
2016-11-20 22:42:48 +00:00
Torsten Dreyer
b652758330 Merge branch 'topics/mpdiscovery-via-dns' into next 2016-11-17 14:45:40 +01:00
Torsten Dreyer
994ea1674b replace many auto_ptr by unique_ptr 2016-11-14 22:20:46 +01:00
James Turner
eaf779deb2 Use ground-network to improve MP start location.
Search for the closest ground-net node near but /not/ on, the requested
runway. This works fairly well, although for some airports the selected
node is surprisingly far from the runway.
2016-11-13 22:20:40 +01:00
Florent Rougon
a6f1c93a2b Use semantic versioning for the --json-report format version
The report now looks like:

{
        "meta": {
                "type": "FlightGear JSON report",
                "format major version": 1,
                "format minor version": 0
        },

        ...

}

When making compatible changes to the format (e.g., adding members to
JSON objects), only the minor version number should be increased.
Increase the major version number when a change is backward-incompatible
(such as the removal, renaming or semantic change of a member). Of
course, incompatible changes (like this one) should only be considered
as a last recourse.
2016-11-12 11:11:03 +01:00
Torsten Dreyer
979010de4d Initial commit of mpserver discovery via DNS 2016-11-10 11:14:49 +01:00
Florent Rougon
fb10f76e59 Add command-line option --json-report
- New methods Options::printJSONReport() and utility method
  Options::OptionsPrivate::createJSONArrayFromPathList().

- Small addition to Options::processOptions(), since the --json-report
  option must be processed *after* the TerraSync and download dirs, as
  well as aircraft and scenery paths, have been finally set.
2016-11-09 12:05:03 +01:00
Florent Rougon
b1b7f07edb Add FGGlobals::autosaveFilePath(); improve code related to {load,save}UserSettings()
Apart from providing a public method giving a path to the autosave file,
the main idea of this commit is to reduce redundancy where
globals->get_fg_home() was so far used in every place where the autosave
file is needed or saved. Use an optional argument for
FGGlobals::loadUserSettings() and FGGlobals::saveUserSettings()[1],
since it should be exceptional to access an autosave file in another
location than $FG_HOME.

Also add comments explaining how to avoid security pitfalls with
saveUserSettings() (cf. discussion around
<https://sourceforge.net/p/flightgear/mailman/message/35461636/>).

[1] Argument *added* to this method, for consistency with
    FGGlobals::loadUserSettings().
2016-11-09 11:46:39 +01:00
Florent Rougon
fc81258d13 Add FGGlobals::get/set_download_dir(), unify TerraSync and download dirs setup
Similar to the existing FGGlobals::get/set_terrasync_dir(), add
FGGlobals::get_download_dir() and FGGlobals::set_download_dir() methods,
and of course the corresponding FGGlobals::download_dir public member
variable. FGGlobals::set_download_dir() stores the realpath() of the
given directory, including into the /sim/paths/download-dir property,
which is marked as read-only just as /sim/terrasync/scenery-dir already
is.

Handle the setup of the TerraSync and download dirs all in the same
place (Options::processOptions()), since most of the work is already
done there. This allows one to get rid of fgOptTerrasyncDir() and
fgOptDownloadDir(), and to make it easier to see that
globals->set_terrasync_dir() (resp. globals->set_download_dir()) is
called on the correct SGPath, regardless of whether --terrasync-dir
(resp. --download-dir) was passed.

Always create the TerraSync and download dirs when they don't already
exist, regardless of whether --terrasync-dir or --download-dir has been
given on the command line.

Add comments explaining how to avoid security pitfalls with download and
TerraSync dirs (cf. discussion around
<https://sourceforge.net/p/flightgear/mailman/message/35461636/>).

Adjust indentation where it was too broken, hampering readbility.
2016-11-08 22:23:51 +01:00
Florent Rougon
bbf5ac6406 Fix the --version option
1) Paths and the FG_SCENERY paths list are now printed like:

     FG_ROOT=/home/flo/flightgear/src/fgdata

   instead of:

     FG_ROOT=Path "/home/flo/flightgear/src/fgdata"

   Moreover, FG_SCENERY is now correctly printed (without 'Path ""'
   wrapping, without Terrain, Objects and markers instead of the actual
   scenery paths) regardless of the position of --version relatively to
   --fg-scenery, --terrasync-dir, etc. Of course, the values given to
   these options do influence the output of --version.

   Simplify printing of FG_SCENERY via SGPath::join() and use the
   correct, OS-dependent separator between paths, SGPath::pathListSep.

   Write the --version output to stdout, as already done for --help;
   then it can be easily piped to $PAGER and doesn't get mixed with the
   output of SG_LOG (which is on stderr). This is of course backward
   incompatible for programs reading the stderr output of
   'fgfs --version', but has been agreed upon on FlightGear-devel (cf.
   <https://sourceforge.net/p/flightgear/mailman/message/35461619/>).

2) Don't write explicit values in the OptionResult enum: they don't
   matter, but giving them is error-prone in case one does a copy-paste
   to add a new member to the enum and forgets to change the value.
2016-11-08 22:23:51 +01:00
Florent Rougon
c7c66d7a3b Fix handling of -- (end-of-options delimiter on the command line) 2016-11-08 22:23:51 +01:00
James Turner
e2f7585d9c Use a Cmake imported target for SimGear 2016-10-30 22:15:54 +00:00
Rebecca N. Palmer
06b6c4f513 Nasal security: allow reading more directories
--aircraft-dir, and --download-dir / Aircraft,AI,Liveries (see
https://sourceforge.net/p/flightgear/mailman/message/35417419/
for why not all --download-dir)
2016-10-30 21:06:08 +00:00
Rebecca N. Palmer
194a6f8974 options: use fromLocal8Bit for --download-dir and --aircraft-dir 2016-10-29 16:31:08 +01:00
Florent Rougon
101bdce343 APTLoader: improve progress status info
It is not needed anymore to hardcode the number of lines of
$FG_ROOT/Airports/apt.dat.gz. The new method, which relies on
SGPath::sizeInBytes() and sg_gzifstream::approxOffset(), works as well
for the other dat files.

Add a new NavCache rebuild phase, REBUILD_READING_APT_DAT_FILES, since
the process is now made of two parts.

Rename NavDataCachePrivate::getDatFilesPaths() to
NavDataCachePrivate::findDatFiles(), because it now returns a
DatFilesGroupInfo (new struct) instead of a PathList. For the same
reason, rename NavDataCachePrivate::aptDatPaths to
NavDataCachePrivate::aptDatFilesInfo. Adapt signatures, etc.

This requires up-to-date SimGear and FGData.
2016-10-19 13:01:35 +02:00
Rebecca N. Palmer
0ec47c9802 Simplify Nasal security code 2016-10-18 23:01:24 +01:00
Rebecca N. Palmer
0a256038d3 Remove set-scenery-paths, make all scenery paths Nasal-readable
(It was probably broken anyway, due to path caching in tilemgr.cxx)
2016-10-18 22:29:44 +01:00
Rebecca N. Palmer
9f6ce5625c remove now-redundant warning 2016-10-18 22:17:34 +01:00