1
0
Fork 0
Commit graph

2589 commits

Author SHA1 Message Date
Rebecca N. Palmer
3b1f01c49d stop using /sim/terrasync/scenery-dir, fix scenery path order
Having non-Nasal-readable scenery paths breaks things
(The property continues to exist, but is now from-C++-to-Nasal only)
2016-10-18 22:10:09 +01:00
Rebecca N. Palmer
31cb65e8d9 Nasal security: add --allow-nasal-read, warn on non-Nasal-readable
Terrasync, prepare for allowing --download-dir

Add unmangled_fg_scenery
2016-10-09 15:21:09 +01:00
James Turner
ca70e64261 Request AMD PowerXpress. 2016-09-27 17:16:46 -05:00
James Turner
5bf9b3cd02 Remove the Ati viewport hack. 2016-09-27 17:16:34 -05:00
James Turner
2ff476a217 More safe subsystem accessors. 2016-09-27 05:58:47 -05:00
James Turner
feb10c4c43 Launcher sets —no-default-config automatically. 2016-09-08 11:41:40 +01:00
James Turner
db31e0d49c —config options can load non-XML files
Expand existing —-config option to read either property-XML files (as
it previously did) but for non-XML files, to parse them as command
line argument files.
2016-09-07 23:30:49 +01:00
James Turner
4294966781 Fix setting start offset with MP enabled. 2016-09-07 22:51:27 +01:00
James Turner
13f8f13000 Adjust behaviour of —no-default-config option
Still read autosave and preferences.xml in this case, but skip all
config files (.fgfsrc, etc)
2016-09-05 16:15:55 +01:00
James Turner
324f266283 Pass the install dir to Terrasync.
With Simgear commit d7d59b08a2f1a77a4247ec1a89d6ff48ed73f5c7, this
allows terrasync to be initialised from files in the install data,
which avoids downloading them again.
2016-08-18 16:23:39 +01:00
Torsten Dreyer
1947c100d9 Also use SBRJ as fallback.
Sigh. No real good idea how to /not/ hardcode this.
2016-08-06 23:12:43 +02:00
Alessandro Menti
2d86fc11ad Replace the NOAA METAR URL with the new, updated one 2016-08-04 20:34:34 +02:00
Erik Hofman
9ec4d7749f Add support for AeonWave 2016-08-04 18:43:10 +02:00
Erik Hofman
c17c3595c8 Set /sim/rendering/initialized to true at the appropriate moment and use it instead of /sim/initialized for the messagebox 2016-07-21 13:55:31 +02:00
Erik Hofman
e2216891be Move the PUI dialog code to James' new messagebox code and use that one instead for SG_LOG_POPUP to get a native popup window if available and fall back to a PUI one if not 2016-07-21 08:56:05 +02:00
Erik Hofman
5ab2d82c89 Show a popup dialog for every SG_POPUP message in the queue 2016-07-20 15:03:15 +02:00
James Turner
e30c886068 Adjust runway startup position with MP enabled
Relocate the start-up position to a plausible hold-short position
when MP is active and a runway start is requested. This does not (yet)
use ground-net data to identify a real hold-short position.
2016-07-17 21:11:14 +01:00
James Turner
4aee633be3 Fix starting up at a parking location.
Move parking-pos selection to finalizePosition, so that dynamics and
ATC controllers are available and work correctly.
2016-07-16 11:45:30 +01:00
James Turner
100e8bf2b2 Further SGPath API usage improvements. 2016-07-15 16:49:13 +01:00
Jeremy Bicha
25928bf614 Use CMAKE_INSTALL_BINDIR
Allow /bin install directory to be overriden. Debian for example uses this
to install FlightGear to /usr/games/ instead of /usr/bin/

https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
2016-07-09 18:52:58 -04:00
James Turner
7e607b8403 Fix fgValidatePath on Windows 2016-07-04 22:22:32 +01:00
James Turner
400901c239 Update for changed SGPath::realpath signature 2016-07-04 09:06:42 +01:00
James Turner
8e875b22f5 fgValidatePath uses SGPath 2016-07-03 23:59:40 +01:00
James Turner
fc3d47cd34 More std::ifstream -> sg_ifstream 2016-07-03 23:48:44 +01:00
James Turner
6d0c2070fd Use future-proof SGPath APIs.
Remove uses of .str(), .c_str() and some other methods of SGPath.
Pass SGPath directly where possible, or explicitly convert to the
appropriate 8-bit encoding.
2016-06-28 10:08:38 +01:00
Bertrand Coconnier
54274a4b9c convert another path to std::string before using it to prevent a compiler error 2016-06-25 21:26:50 +02:00
Erik Hofman
e165fc5ebe convert the path to std::string before using it to prevent a compiler error 2016-06-25 15:00:35 +02:00
Erik Hofman
7f4fe977a1 Convert PKGLIBDIR to SGPath before returing it to prevent a compiler error 2016-06-24 12:54:01 +02:00
James Turner
16814800ce Use Paths instead of strings. 2016-06-22 17:36:05 +01:00
James Turner
03ecac9dbc Work with new SGPath API. 2016-06-22 17:36:05 +01:00
James Turner
e4e0db5cac Aircraft-states feature. 2016-06-17 18:15:35 +01:00
James Turner
a3d660e423 Revert "Special case this define"
This reverts commit 58731a01e2.
2016-06-09 20:34:43 +01:00
James Turner
58731a01e2 Special case this define 2016-06-09 16:20:25 +01:00
James Turner
e672626558 Explicitly shut down logging
- needed to call FreeConsole on Windows.
2016-06-09 11:04:32 +01:00
James Turner
861b682acf VS2015 fixes
Explicitly specialize these templates.
2016-06-01 22:57:11 +01:00
Torsten Dreyer
5c0a477a47 Slightly better handling of setting initial pos
don't use KSFO as default when an unknown ID was
specified for --airport arg
TODO: don't hardcode default airport
2016-04-24 10:42:58 +02:00
James Turner
ca6424f76a Fix a reset crash with pager threading.
Ensure pager thread is stopped before we touch
the sgUserData reference to the main props tree.
2016-03-28 23:50:47 +01:00
James Turner
6fc2403449 Fix iterator const-ness. 2016-03-24 20:23:39 +00:00
James Turner
5baca8598f Improve download-dir behaviour.
When set on the command line, will be used for aircraft packages. When
set in the Qt launcher, will also be used for aircraft downloads at
all times.

When changing the path in the launcher, the set of aircraft catalogs
is refresh automatically. Note the default catalog may need to be
re-installed.
2016-03-24 15:10:06 +00:00
James Turner
733e3b3f0c HTTP subsystem has a default name.
Switch to using type-safe accessors now.
2016-03-24 15:08:38 +00:00
James Turner
88bfaca2b3 New options setting/clearing helpers. 2016-03-24 15:05:03 +00:00
Erik Hofman
209194ecba Reload user preferences after reading the video configuration file 2016-03-21 11:50:11 +01:00
Florent Rougon
0cfa4ced9c Make --metar automatically imply --disable-real-weather-fetch
The --metar option has no effect unless --disable-real-weather-fetch is
also passed. This often makes users believe that --metar doesn't work.
Change the implementation for --metar so that it automatically implies
--disable-real-weather-fetch.
2016-03-20 19:56:18 +01:00
Torsten Dreyer
585b4a7f70 Fix "failed to load file: Models/..."
After removing /Models from FGData loading of shared models from
within a scenery model failed because the ResourceManager did not know
about additional scenery paths.
2016-03-19 21:08:24 +01:00
Erik Hofman
e1bb47bc89 Add support for Video adapter rendering presets 2016-03-19 13:10:36 +01:00
Torsten Dreyer
a1e81a2fdc Make some more noise if (stale) fgfs.pid file exists 2016-03-08 18:37:32 +01:00
Rebecca N. Palmer
41b78ce150 Nasal security: allow reading explicit --terrasync-dir
(but not /sim/terrasync/scenery-dir - https://bugs.debian.org/780716 )
Needed for animated jetways:
https://sourceforge.net/p/flightgear/mailman/message/34870606/
2016-02-21 20:25:02 +00:00
James Turner
de959a14f3 Rename Viewer/viewer.cxx to view
- keep class and file names in sync.
2016-02-17 21:25:39 +00:00
James Turner
02ff854603 Re-Name FGViewer to flightgear::View
- avoids confusion with osgViewer and fgviewer application.

(source files to be renamed in a follow-up commit)
2016-02-17 21:25:39 +00:00
Edward d'Auvergne
97f8cdaaea Fix for the particle system.
The problem was that the change to make FGScenery a standard subsystem caused
the particle OSG group to no longer be inserted into the scene graph.  The
solution was to convert the particle group to be set up as a standard branch of
the scene graph, alongside the terrain, models, aircraft, and interior branches.
The particle system is now set up as part of the init() subsystem function call,
so it is compatible with the new subsystem design.
2016-02-16 17:33:40 +01:00
Edward d'Auvergne
34daa4de0b HUD fix for MSVC math.h incompatibility with C-99 and the round() function. 2016-02-11 19:36:32 +00:00
Rebecca N. Palmer
16e6009255 Nasal security: give a more user-friendly error on self-check fail
https://sourceforge.net/p/flightgear/mailman/message/34701972/
2016-02-10 22:54:52 +00:00
Edward d'Auvergne
c889198d09 Redesign of the latitude and longitude formatting for the HUD.
This follows from http://thread.gmane.org/gmane.games.flightgear.devel/78650 and
resolves the sign bug https://sourceforge.net/p/flightgear/codetickets/1778/ .

Combined with a matching change to FGData, this changes the HUD formats from the
current set of 3 (note that the text in brackets is not shown in the HUD
preferences PUI dialog, but is show here for reference):

    0) Decimal degrees (37.618890N -122.375000W)
    1) Degrees, minutes (37*37.133N -122*22.500W)
    2) Degrees, minutes, seconds (37*37 08.0 N -122*22 30.0 W)

to (here the text in brackets will be shown in the PUI dialog):

    0) DDD format (37.618890N 122.375000W)
    1) DMM format (37*37.133'N 122*22.500'W)
    2) DMS format (37*37'08.0"N 122*22'30.0"W)
    3) Signed DDD format (37.618890 -122.375000)
    4) Signed DMM format (37*37.133' -122*22.500')
    5) Signed DMS format (37*37'08.0" -122*22'30.0")
    6) Zero padded DDD (51.477500N 000.461389W)
    7) Zero padded DMM (51*28.650'N 000*27.683'W)
    8) Zero padded DMS (51*28'39.0"N 000*27'41.0"W)
    9) Trinity House Navigation (51* 28'.650N 000* 27'.683W)
2016-02-10 21:49:56 +00:00
Rebecca N. Palmer
f749953493 Nasal security: don't break file dialogs
Include the directory itself when allowing reading
Don't kill the script on a denied directory read
2016-02-09 23:17:41 +00:00
James Turner
c72309360e Defensive handling of locales.
- Use setlocale() to ensure consistent handling of locales and
  string handling irrespective of whether or not QCoreApplication
  is invoked. Forces a the C locale for numerics and collation,
  since many pieces of FG assume this.
2016-02-02 20:44:46 +00:00
James Turner
acb630095d Possible fix for Mac strncmp crashes. 2016-01-26 07:48:30 +01:00
James Turner
81792bd6d0 Adjust fg root processing order
- ensure fg-root and FG_ROOT are higher precedence than the Qt gui
2016-01-19 18:32:20 -05:00
James Turner
d81d353940 Improved fg-root control from the Qt Launcher
- add a button to the main dialog, explaining how to adjust the 
  fg-root path via the GUI
- tweak the GUI flow to support explicitly changing the path even
  when the default path is acceptable.
2016-01-18 20:06:43 -05:00
James Turner
e37e0d1bcf New log class for TerraSync 2016-01-16 15:50:13 -06:00
James Turner
e3fe8ae199 Log options to INFO level when processing
- ensures they occur in the fgfs.log which should aid problem
  tracing.
2016-01-12 17:33:57 -06:00
Torsten Dreyer
296849cf3d Fix a bug for allowed paths
Under some conditions on my system
aircraft_paths.begin() was equal to scenery_paths.end()
This resulted in neither of them being added to read_allowed_paths
followed by failure to load Nasal scripts from the aircraft directory.

This might happen, if scenery_paths gets allocated just before aircraft_paths
in memory.
Better loop across the desired lists instead of using fancy tricks with
the iterator.
2016-01-12 11:19:26 +01:00
James Turner
c400405b0a Chatter-queue moved out of globals
- now lives as part of the sound-manager, yay.
2016-01-03 12:00:15 -06:00
James Turner
fc9c43b48d Remove FontCache from globals.
- access via a singleton instead.
2016-01-03 12:00:15 -06:00
James Turner
52fd6986f8 Pull Sound-manager out of FGGlobals 2015-12-31 15:19:57 -06:00
James Turner
ba56c42eb4 Pull Ephemeris out of FGGlobals 2015-12-31 15:19:51 -06:00
James Turner
6da9461f92 Fix a typo 2015-12-19 00:32:25 -08:00
James Turner
c69e6fde12 AI subsystem now does an orderly shutdown
- remove special case logic which is no longer required
2015-12-19 00:30:31 -08:00
James Turner
83ea6d32d0 Make PerformanceDB a real subsystem 2015-12-19 00:29:00 -08:00
James Turner
b7c88e7acc Stop OSG threading earlier on shutdown.
Avoid intermittent race conditions on shutdown when the OSG 
pager/Db thread is running. Ensure the OSG threads are stopped before
we start tearing down any scene graph nodes.
2015-12-18 22:00:37 -08:00
James Turner
0f590280c7 Aircraft-model subsystem behaves better
- make shutdown logic more robust
- shutdown is no longer special cased in globals.
2015-12-18 20:13:23 -08:00
James Turner
89065ea5c2 Proper shutdown() for the model manager
- also move property setup to bind/unbind
2015-12-18 19:56:56 -08:00
James Turner
8877b442f8 ATC/Traffic doesn’t crash reset.
- remove some global headers from AI headers, to avoid pollution
- change how ATC owns the ‘player’ FGAIAircraft so reset works
- ensure AIAircraft controllers are cleared on unbind for reset
2015-12-11 12:11:59 -06:00
James Turner
1544641405 Remove view/tile/scenery members from globals
- also fix sound manager creation
2015-12-11 12:11:59 -06:00
James Turner
43fcbd2246 Progress towards testing
- remove route-manager from global variables
2015-12-10 16:40:22 -06:00
James Turner
76c6665af4 Merge /u/edauvergne/flightgear/ branch lat_lon_precision_fix_v3 into next
http://sourceforge.net/p/flightgear/flightgear/merge-requests/23/
2015-12-10 22:39:31 +00:00
James Turner
d891c5928c Remove /sim/temp/winding-ccw property
- part of work on unit-testing, remove OpenGL usage in fg_props
2015-12-10 15:53:05 -06:00
James Turner
d7a680e848 Templated subsystem handling
- remove explicit FGControls var from globals, as part of work
  towards unit-testing infrastructure.
2015-12-10 15:53:05 -06:00
Edward d'Auvergne
912215e949 The OSG version is now printed with --version.
This adds the OSG version number between the simgear and PLIB versions.
2015-12-05 15:24:47 +01:00
James Turner
2af076e6cb Add airport dynamics manager
- decouple dynamic airport data from the static (nav-db) data.
2015-12-05 00:25:29 +00:00
Edward d'Auvergne
524136d709 Minor rounding error fix for the latitude and longitude strings.
This is for the FGProperties::getLongitudeString() and
FGProperties::getLatitudeString() functions.  The previous algorithm was to
round the degrees up by the smallest fraction required to prevent a round up to
60 minutes or seconds, and then round down the final minutes or seconds by the
same fraction.  The new algorithm is to detect if the final minute or seconds
will be rounded to 60 by the string formatting and, if so, the higher unit
(degrees or minutes) is incremented by one, and the lower unit decremented by
60.
2015-12-02 17:48:02 +01:00
James Turner
fc887b106b Checkpoint - ground-net skips the cache 2015-12-01 14:01:32 +00:00
Rebecca N. Palmer
d56fbfd415 Revert "Initialise Qt earlier, and whenever available"
Temporary workaround for
http://sourceforge.net/p/flightgear/codetickets/1819/

This reverts commit 3e67417bf0.
2015-11-30 23:10:32 +00:00
James Turner
8bfb1c3aa5 Move functionality into clear_fg_scenerey helper. 2015-11-27 23:25:53 +00:00
James Turner
e52e20b54f SHPParser 2015-11-27 23:02:42 +00:00
Rebecca N. Palmer
3e67417bf0 Initialise Qt earlier, and whenever available
(to allow it to be used for error boxes)
2015-11-24 07:21:52 +00:00
James Turner
97a5e15aaf Show paused message when starting frozen. 2015-11-23 00:48:20 +00:00
James Turner
a39df48772 Navaid diagram for launcher
- work in progress, needs labels
2015-11-23 00:47:01 +00:00
James Turner
56d7d049bc Launcher GUI for in-air / navaid starts 2015-11-23 00:46:25 +00:00
James Turner
1e213201cf Work on the launcher 2015-11-23 00:45:21 +00:00
Stuart Buchanan
660c38ce72 Fix for SEGFAULT when using multiple loggers.
Patch from Julian BREITENEICHER.
2015-11-22 17:11:36 +00:00
Rebecca N. Palmer
3e462f3056 fgValidatePath: allow Nasal to read user-set scenery directories
(but not the Terrasync directory, as Nasal can change that)
2015-11-22 11:27:39 +00:00
Rebecca N. Palmer
97f235173e fgValidatePath: documentation improvements 2015-11-22 11:03:00 +00:00
Rebecca N. Palmer
91dc448875 Simplify fgValidatePath + minor fix (requires simgear update)
Drop fgNormalizePath, use realpath() only
As this makes it accept relative paths, always use the returned
(absolute) version for the actual file operation to avoid check-to-use
races, or where this is not possible (NasalSGPath) explicitly reject
relative paths
Fix: do_save is a write, not a read
2015-11-21 21:37:19 +00:00
James Turner
29ef561ed9 Fix some inverted logic
- spotted by Thomas Geymayer!
2015-11-20 21:28:19 +00:00
Thomas Geymayer
fdf4a61ed5 fgcommand remove-subsystem: fix double delete/segfault. 2015-11-19 23:17:58 +01:00
James Turner
f110fc57d6 Fix enable/disable-freeze option.
- set /sim/freeze/clock as well as /sim/freeze/master

Fix by Hamza Alloush
2015-11-13 22:13:44 +00:00
James Turner
bf6ef6664c Fix for OSG 3.5 2015-11-13 22:13:44 +00:00
James Turner
ca1f8cddc9 Fix a package crash on startup. 2015-11-13 22:13:44 +00:00
James Turner
2314ccfe13 Developer-warnings
- make some existing warnings developer-mode only
- add a warning about legacy aircraft path usage
2015-11-13 22:13:44 +00:00
Florent Rougon
7198dec355 Use SGPath::realpath() on the value supplied for --aircraft-dir
* Before setting /sim/aircraft-dir from the --aircraft-dir option,
canonicalize its value with SGPath::realpath() as is already done in
FGGlobals::append_aircraft_path() for the paths given with --fg-aircraft
or via the FG_AIRCRAFT environment variable.

* This fixes a bug when --aircraft-dir is used, due to the fact that
fgValidatePath() canonicalizes its 'path' argument before matching it
against the allowed patterns, and therefore will not validate paths
under the directory specified with --aircraft-dir if this directory has
been given in a non-canonical form by the user (e.g., containing at
least one symlink component).

* This fix does not lower security: the path which is canonicalized has
been explicitely given by the user. This operation is already done for
all paths specified with --fg-aircraft or via the FG_AIRCRAFT
environment variable, via Options::initPaths() which calls
FGGlobals::append_aircraft_paths().

* To reproduce the bug, create a symlink (e.g., /tmp/aircrafts) to a
directory suitable for --fg-aircraft, then run:

  fgfs ... --fg-aircraft=/tmp/aircrafts \
           --aircraft-dir=/tmp/aircrafts/SenecaII --aircraft=SenecaII

This will trigger many failures such as:

  loadxml: reading '/tmp/aircrafts/SenecaII/Dialogs/registration.xml'
  denied (unauthorized directory - authorization no longer follows
  symlinks; to authorize reading additional directories, add them to
  --fg-aircraft)

(from do_load_xml_to_proptree() in flightgear/src/Main/fg_commands.cxx)

I have also tested this with the ec130b4 and the 777-200ER. Same
problem, same fix.
2015-10-06 21:54:50 +02:00