1
0
Fork 0
Commit graph

2615 commits

Author SHA1 Message Date
Florent Rougon
034fb89db3 Abort with a clear error message for invalid uses of --config inside a config file
The options.cxx code is not ready to handle recursive use of --config
(for config files). Instead of failing in an ugly way, abort with a
clear error message in such situations. See discussion at
<https://sourceforge.net/p/flightgear/mailman/message/35838852/>.

Note: it *is* possible to load XML PropertyList files from config files,
      so --config is not entirely "banned" from config files.

+ add missing include
2017-05-15 11:06:47 +02:00
Florent Rougon
fd78d32e56 End segfault_handler() with std::abort() rather than kill() on ourselves
This has the advantage, according to my testing on Linux, that core
files obtained after a crash now point to the crashing thread again,
when one starts 'gdb' on the core file and runs the 'bt' command.

Apparently, when using kill(), the signal is seen as coming from the
outside and gdb's 'bt' command points to the wrong thread in general
when debugging using a core file (when debugging "live", gdb intercepts
the signal even before FG's signal handler is started).

See discussion starting at
<https://sourceforge.net/p/flightgear/mailman/message/35833221/>.
2017-05-11 12:19:31 +02:00
James Turner
2dbe88936e Don't warn about missing CrashRpt when developing 2017-04-29 20:58:05 +01:00
Florent Rougon
4259b548b0 Fix bugs due to incorrect use of SGPath::pathListSep
Before SimGear commit a962c90b30f36575d01162b64471fa77473237a0,
SGPath::pathListSep was a char in static memory that was not necessarily
followed by '\0'. As a consequence, using &SGPath::pathListSep as a
C-style string could result in a string containing the correct separator
*plus* whatever followed in memory until the first null byte...

SimGear commit a962c90b30 changes this situation by making
SGPath::pathListSep an array of two const chars: the path list separator
followed by a '\0'.

This commit simply adapts FlightGear to this change, which fixes a
couple of bugs where the separator was used, mainly unneeded NavCache
rebuilds due to the "apt.dat", "fix.dat" and "nav.dat" properties in the
SQLite database containing the correct paths separated by a possibly
incorrect separator string (there was no alteration of the cache
contents as far as I can tell, since the db property is only used to
check if the lists of apt.dat, fix.dat and nav.dat files have changed).
2017-04-15 09:53:16 +02:00
Florent Rougon
2373ee4f05 Fix build error due to sgstream.hxx now being in simgear/io/iostreams/ 2017-04-14 00:19:59 +02:00
James Turner
cf56ef1913 Migration test runs successfully now. 2017-04-13 13:14:53 +01:00
James Turner
3e1a701712 Migrate old autosave XML files. (Disabled for now)
Code and tests to demonstrate migrating of older auto-save files, with
blacklisting support to exclude properties. Disabled pending agreement
on the required blacklisting values.
2017-04-13 08:01:45 +01:00
James Turner
9f47607c95 Revert "Remove the Ati viewport hack."
This reverts commit 5bf9b3cd02.
2017-04-12 11:13:14 +01:00
James Turner
3732930269 QML-driven settings UI. 2017-04-10 14:38:57 +01:00
James Turner
5c713a6b55 Split the launcher main window into its own file.
Reduces QtLauncher.cxx down to the public API and the static helper
methods; the main window lives in its own file.
2017-04-10 14:38:57 +01:00
Florent Rougon
cf318f1cc5 Better setting of the process exit status for fgfs and fgviewer
Some pieces of code such as fgMainInit() and, by cascading effect,
fgInitHome(), were careful to return a meaningful value indicating
success or error, however the main() function in src/Main/bootstrap.cxx
ignored it royally so far.

main() now returns:
  - EXIT_FAILURE if fgMainInit() or fgviewerMain() throws an exception;
  - whatever said function returns otherwise.
2017-04-10 02:29:48 +02:00
Florent Rougon
4b494a69bd Rename fatalMessageBox() to fatalMessageBoxWithoutExit(), add exiting variant
- Rename fatalMessageBox() to fatalMessageBoxWithoutExit(). This should
  prevent the kind of bug that prompted this set of changes: someone
  calling fatalMessageBox(), assuming the program would stop at that
  point, whereas in reality it did not.

- Add new function fatalMessageBoxThenExit(). This is not vital of
  course, but allows one to spare one line here and there and to apply
  the DRY principle for such fatal exits.

- Replace every existing call to fatalMessageBox() with one or the other
  of the two new functions. Improve formatting along the way. This
  fixes a few bugs of the kind explained above.
2017-04-10 02:29:48 +02:00
Florent Rougon
5040e6c7f0 Don't call fatalMessageBox() from fg_terminate(), make it end with std::abort()
Basically, this is because fatalMessageBox() is only safe to call from
the GUI thread, however it seems fg_terminate() can be called from any
thread (according to C++11 semantics). Additionally, fatalMessageBox()
typically requires some work to happen in the GUI thread (event loop) in
order to display something, but we can't realistically expect this while
running a terminate handler just before the program dies.

See messages around
<https://sourceforge.net/p/flightgear/mailman/message/35775803/> for a
discussion of this subject.

+ Minor header cleanup (<locale.h> replaced with <clocale>, etc.)
2017-04-08 14:03:48 +02:00
Gary Preston
8958b4d130 Cleanup unused variable warning.
Remove, comment out or relocate variables as appropriate to silence
unused variable warning.
2017-04-06 18:26:18 +09:00
James Turner
dd0d03ea1d Fix build on Windows. 2017-04-05 21:34:48 +09:00
Richard Harrison
5d23fa71ff OSG 3.5.x compatibility fix
OSG 3.5 (and maybe before) declares that ThreadSafeRefenceCounting is no longer required and it has been removed.
2017-04-02 02:09:38 +02:00
James Turner
6cd39818c6 Whoops, missed a file. 2017-03-27 16:05:45 +01:00
James Turner
58a7f2c5c2 Unit-test for initPosition.
Only basic, but can be expanded incrementally now
2017-03-27 15:38:05 +01:00
Stuart Buchanan
feb5d599d0 Replace "tile-manager" with "scenery" 2017-03-26 21:49:26 +01:00
James Turner
31e933d836 Kill the Aircraft/foo path warning.
We probably need a warning for cross-aircraft paths, but leaving that
for a separate change since I’m worried it will warn on MP aircraft.

Maybe better checked in the Python scripts than in the app?
2017-03-25 15:40:11 +00:00
James Turner
9e122eaf81 Partial testing framework.
Compile a useful subset of FG as a shared library, and add two basic
uses of this to exercise some Flightplan / RoutePath / navaid
functions.

The test framework can/will be expanded incrementally from here, this
is just a starting point.
2017-03-25 15:35:26 +00:00
James Turner
74e2849293 Move some commands to a separate file.
This simplifies building a subset of the code for testing.
2017-03-22 21:13:40 +01:00
James Turner
63d8c2fd83 Enable —-metar runway selection.
Thanks to Florent for the catch.
2017-03-19 22:41:07 +00:00
James Turner
b1fa31fa09 Restore METAR-based runway selection.
As part of this, add the ability to distinguish default vs explicit
airport selection via a new /sim/presets/airport-requested flag. This
enables us to more cleanly handle different combinations of startup,
especially the case where the user requests an airport but no runway
(wants auto selection), ensuring we don’t look for the default airport’s
runway (from location-presets.xml) in that case.
2017-03-19 11:55:10 +00:00
Florent Rougon
dab68505bb Rename fgfs' option --log-file to --log-dir
This makes sense, since this option expects a directory parameter, or
the special value 'desktop', and computes the file's base name on its
own.

cf. <https://sourceforge.net/p/flightgear/mailman/message/35715817/>
and <https://sourceforge.net/p/flightgear/mailman/message/35715836/>
2017-03-11 09:51:16 +01:00
Florent Rougon
8372f086c1 Add the lists of fix.dat and nav.dat files to the output of --json-report
- Declare 'datTypeStr' and 'defaultDatFile' as public member variables
  of NavDataCache ('defaultDatFile' is not *required* for this commit,
  it just seems to make sense to treat both members the same way/keep
  them together in the source code).

- New keys under "navigation data" in the JSON report: "fix.dat files"
  and "nav.dat files".
2017-03-10 23:04:39 +01:00
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