1
0
Fork 0
Commit graph

15032 commits

Author SHA1 Message Date
James Turner
83c8c7e0c3 RunwayPrefs: fix an edge case (at KORD)
If we reject all preferences due to missing runways, don’t end up
with un-initialized values.
2020-12-07 17:11:17 +00:00
Erik Hofman
e9e1607fce Fix a possble buffer overflow due to a rounding error 2020-12-07 15:10:20 +01:00
Julian Smith
d0db698c7b Correct any positive value of user and multiplayer chase-distance-m.
Chase distances are supposed to be negative. Otherwise in external views
vertical mouse moves have reversed behaviour when changing view angle. E.g.
see:

    https://sourceforge.net/p/flightgear/codetickets/2454

src/MultiPlayer/multiplaymgr.cxx
    Fix +ve chase-distance-m for multiplayer aircraft.
src/Viewer/viewmgr.cxx
    Fix +ve chase-distance-m for user aircraft.
2020-12-05 21:29:01 +00:00
Scott Giese
43c530b660 Modernize: std::string_literals 2020-12-05 14:25:59 -06:00
Scott Giese
eabd4bbc7f Fix textNasalSys 2020-12-05 13:35:48 -06:00
James Turner
b41e3694b6 Sentry: install new SimGear callback
Requires matching SG change to expose the callback. Allows SimGear 
to explicitly report an error (without any dependency on Sentry of
course)
2020-12-03 21:38:57 +00:00
Automatic Release Builder
8f9f0cbb19 Change default Windows download-dir to
$HOME/FlightGear/Downloads

Add a launcher warning about this, to request users to relocate existing
files, they already downloaded.
2020-12-02 17:36:12 +00:00
James Turner
7279b51785 Traffic: harden RunwayGroup::setActive
When incorrect rwyprefs.XML input is provided, don’t crash in this
method, just skip the incomplete entries.

Ticket: https://sourceforge.net/p/flightgear/codetickets/2439/
2020-12-02 17:29:33 +00:00
James Turner
602360cdeb Add graphics-presets logic (as a subsystem)
Gives the ability to define graphics settings via an XML file at
startup or later during runtime. Tracks if changes to graphics settings
required additional actions (eg, scenery reload or restart of the sim)

When a preset is active, and properties are modified, the system will
detect this and mark the preset as edited.
2020-11-30 15:45:13 +00:00
Erik Hofman
4947b18371 Comment out the weather updating code for now 2020-11-30 10:18:48 +01:00
Nathaniel Warner
f5e277fc5a Remove unnecessary include 2020-11-29 15:04:48 -08:00
Nathaniel Warner
512f1ba3d9 Use observer_ptr in OrthophotoManager 2020-11-29 15:01:23 -08:00
Scott Giese
f03358d4f8 Merge branch 'next' of https://git.code.sf.net/p/flightgear/flightgear into next 2020-11-27 18:00:06 -06:00
Nathaniel Warner
4ddc3dc8aa Fix orthophotos not being cleaned up on scenery reload 2020-11-27 17:54:55 -06:00
James Turner
443b4fa900 Different fix for ticket 2108, avoiding another issue
Original bug: https://sourceforge.net/p/flightgear/codetickets/2108/
New bug: https://sourceforge.net/p/flightgear/codetickets/2430/
2020-11-27 18:51:27 +00:00
Stuart Buchanan
4e46548250 Set minimum expiry time on STG nodes. 2020-11-26 22:59:39 +00:00
Julian Smith
a69e56043a src/Viewer/sview.cxx: fixed incorrect heading and roll when cloning some lookfrom views.
Bug happened with views that specify non-zero heading or roll.
2020-11-25 21:31:05 +00:00
Julian Smith
a094b822f8 Revert "src/Viewer/splash.cxx: also show info about CompositeViewer if disabled."
This reverts commit 1cf5b2ab44.
2020-11-25 21:31:05 +00:00
Colin Geniet
fa09c3a6e2 Submodels: Fix wind being applied twice on init
For FGAIBallistic objects affected by wind, speed vector denotes airspeed.
However, submodels initialize the speed vector using ground speed of the
parent aircraft, instead of its airspeed.

In effect, this means that wind is added to the initial airspeed,
or 'wind is applied twice on initialization'.
This was very noticeable when releasing a submodel with strong sidewind:
the submodel immediately starts drifting laterally at the speed of wind.

Fix the issue by subtracting wind vector from initial speed in
FGSubmodelMgr::transform for submodels affected by wind.
2020-11-24 10:35:01 +00:00
James Turner
43d32e809c Metar parsing: more input validation
Trying to avoid parsing an empty string.

Sentry-Id: FLIGHTGEAR-132
2020-11-24 09:08:50 +00:00
James Turner
6e79485b65 Start adding MarkDown docs for various internals 2020-11-24 09:08:50 +00:00
James Turner
c2e4e46546 Remove docs from the dawn of time.
All of these are subsumed by CMake these days, hurrah.
2020-11-24 09:08:50 +00:00
Nathaniel Warner
88a8cada51 Rebase photoscenery patch on next 2020-11-23 17:53:35 -06:00
Erik Hofman
b73413d52e Part 2: Work towards the option of interpolating between climate tiles by combining all climate related ground level parameters in one structure and calculating the sea level tile from the (not yet interpolated) ground level tile. Read the elevelation of the climate tile from the köppen database image which now contains the climate class in the red channel and the ground elevation in the green channel. 2020-11-22 19:29:35 +01:00
Erik Hofman
9cac817ad9 Work towards the option of interpolating between climate tiles by combining all climate related ground level parameters in one structure and calculating the sea level tile from the (not yet interpolated) ground level tile. Read the elevelation of the climate tile from the köppen database image which now contains the climate class in the red channel and the ground elevation in the green channel. 2020-11-22 15:01:43 +01:00
Julian Smith
bd0452c793 src/Viewer/renderer.cxx: disabled CompositeViewer assert that fired on shutdown after --help. 2020-11-22 08:24:49 +00:00
Julian Smith
1cf5b2ab44 src/Viewer/splash.cxx: also show info about CompositeViewer if disabled. 2020-11-22 07:45:17 +00:00
Chris Frey
fddb32f5c1 fgelev: Support WS3.0
added --use-vpb argument

fgelev: added --tile-file argument

fgelev: enable VPBActive via SGSceneFeatures() as well

When fgelev runs, it does not load the scenery through the normal
process of FGScenery::ScenerySwitchListener(), so
SGSceneFeatures::instance()->setVPBActive() won't get called
unless we do it manually here.
2020-11-21 21:50:43 +00:00
Erik Hofman
e1cf9eff49 Instead of using our own logic of calculating sea level parameters from ground level parameters, switch to using the FGEnvironmetn class instead. 2020-11-21 15:47:10 +01:00
Julian Smith
f62e5b9ce3 CompositeViewer: Support for multiple view windows using osgViewer::CompositeViewer.
Overview:

    Previously Flightgear always used a single osgViewer::Viewer(), which
    inherits from both osgViewer::ViewerBase and osgViewer::View, giving a
    single view window.

    If CompositeViewer is enabled, we instead use a osgViewer::CompositeViewer
    which contains a list of osgViewer::View's. Each of these View's can have
    its own eye position, so we can have multiple different views of the same
    scene.

    Enable at runtime with: --composite-viewer=1

Changes to allow use of osgViewer::CompositeViewer:

    Previously FGRenderer had this method:

        osgViewer::Viewer* getViewer();

    This has been replaced by these two new methods:

        osgViewer::ViewerBase* getViewerBase();
        osgViewer::View* getView();

    If CompositeViewer is not enabled (the default), the actual runtime state
    is unchanged, and getViewerBase() and getView() both return a pointer to
    the singleton osgViewer::Viewer() object.

    If CompositeViewer is enabled, getViewerBase() returns a pointer to a
    singleton osgViewer::CompositeViewer object, and getView() returns a
    pointer to the first osgViewer::View in the osgViewer::CompositeViewer's
    list.

    The other significant change to FGRenderer() is the new method:

        osg::FrameStamp* getFrameStamp()

    If CompositeViewer is not enabled, this simply returns
    getView()->getFrameStamp(). If CompositeViewer is enabled it returns
    getViewerBase()->getFrameStamp(). It is important that code that previously
    called getView()->getFrameStamp() is changed to use the new method, because
    when CompositeViewer is enabled individual osgViewer::View's appear to
    return an osg::FrameStamp with zero frame number).

    All code that uses FGRenderer has been patched up to use the new methods so
    that things work as before regardless of whether CompositeViewer is enabled
    or not.

    We make FGRenderer::update() call SviewUpdate() which updates any extra
    views.

Extra view windows:

    If CompositeViewer is enabled, one can create top-level extra view windows
    by calling SviewCreate(). See src/Viewer/sview.hxx for details.

    Each extra view window has its own simgear::compositor::Compositor
    instance.

    Currently SviewCreate() can create extra view windows that clone the
    current view, or view from one point to another (e.g. from one multiplayer
    aircraft to the user's aircradt) or keep two aircraft in view, one at a
    fixed distance in the foreground.

    SviewCreate() can be called from nasal via new nasal commands "view-clone",
    "view-last-pair", "view-last-pair-double" and "view-push". Associated
    changes to fgdata gives access to these via the View menu. The "view-push"
    command tags the current view for later use by "view-last-pair" and
    "view-last-pair-double".

    Extra view windows created by SviewCreate() use a new view system called
    Sview, which allows views to be constructed at runtime instead of being
    hard-coded in *-set.xml files. This is work in progress and views aren't
    all fully implemented. For example Pilot view gets things slightly wrong
    with large roll values, Tower View AGL is not implemented, and we don't
    implement damping. See top of src/Viewer/sview.cxx for an overview.

OpenSceneGraph-3.4 issues:

    OSG-3.4's event handling seems to be incorrect with CompositeViewer -
    events get sent for the wrong window which causes issues with resize and
    closing. It doesn't seem to be possible to work around this, so closing
    extra view windows can end up closing the main window for example.

    OSG-3.6 seems to fix the problems.

    We warn if CompositeViewer is enabled and OpenSceneGraph is 3.4.
2020-11-21 13:27:02 +00:00
Erik Hofman
578f414c42 Convert wind speeds to meter per second (from kilometers per hour) since that turns out to be the meteorological standard unit for wind speeds. 2020-11-21 09:43:39 +01:00
Erik Hofman
45b6f87351 Set the wind speed based on latitude and climate code 2020-11-20 16:29:19 +01:00
Erik Hofman
0baf9f2ff3 Add wind direction based on viewe latitude. Add a number of retriever functions for weather parameters. 2020-11-19 17:17:55 +01:00
Erik Hofman
6a97b1724a Add a function to construct a METAR string from climate data 2020-11-19 14:17:43 +01:00
Erik Hofman
ef9636c8e5 Use local gravity, Use a more accurate way to calculate saturation vapor pressure. 2020-11-19 11:21:25 +01:00
Erik Hofman
98a94ecac4 Also calculate air pressure and density (while we're at it) 2020-11-19 08:29:40 +01:00
Erik Hofman
108f2d4328 Swith to the terrain presampling code for a more stable ground elevation if it is enabled. 2020-11-19 08:29:40 +01:00
Fernando García Liñán
b3e4c25358 Fix CameraGroup relative cameras 2020-11-18 14:31:06 +01:00
Automatic Release Builder
3dd4971056 Launcher: skip missing add-ons in collectArgs
Avoid passing missing add-ons to FlightGear. Since we only write a
cleaned list back to QSettings upon some user change, we can persist
bad paths.

Sentry-Id: FLIGHTGEAR-NG
2020-11-18 09:52:56 +00:00
James Turner
e8c8495d7b NavCache: clean up the tables check query
This very first query was left un-finalized, which apparently blocks
another process from obtaining the exclusive lock needed to
COMMIT. Found using the trace funtions, phew.

Sentry-Id: FLIGHTGEAR-8C
Sentry-Id: FLIGHTGEAR-8F
2020-11-18 09:52:56 +00:00
James Turner
5273c03c6c NavCache: tolerate missing branch nodes
Since we don't insert nodes in read-only mode, we need to
tolerate their absence when loading.
2020-11-18 09:52:56 +00:00
Fernando García Liñán
78a89b3507 Remove unused files 2020-11-17 19:43:08 +01:00
Richard Harrison
b41bc317dd DDS-TC identify images coming from Canvas
This is to allow the DDS texture cache to take appropriate action (such as not compressing these images to ensure that the aspect ratio is good).
2020-11-17 19:09:06 +01:00
Erik Hofman
35da4231dd Use a different way to calculate relative humidiity across the year and adjusted for daytime. 2020-11-17 15:54:43 +01:00
Fernando García Liñán
b0a64e119a Restore Launcher renderer settings to pre-Compositor state 2020-11-16 18:37:05 +01:00
Erik Hofman
627fd24fc1 Switch from season specific interpolator functions to generic interpolator functions and do the season/day specific offset calculation in dedicated helper functions. Add a daytime effect of three hours, so temperatures get it's highest peak at 15:00. 2020-11-16 15:48:27 +01:00
Fernando García Liñán
255d193bc8 Make Compositor default
- Removed the ENABLE_COMPOSITOR CMake flag.
- Removed /sim/version/compositor-support.
- Removed miscellaneous branching to check if the Compositor is enabled.
- Removed custom resource loader since Compositor Effects are now located in $FG_ROOT/Effects.
- Removed splash screen warning.
- Only use the Compositor versions of CameraGroup and FGRenderer.
- Fix redout/blackout not appearing under certain circumstances.
2020-11-16 13:25:29 +01:00
Erik Hofman
1c923ea1d0 Specify the annual sea water temperature with a month delay compared to the air temperature and use it to calculate ice cover. 2020-11-15 17:50:01 +01:00
Stuart Buchanan
566428d5b9 WS3.0: Buld airports at 0 elevation.
Previously the center of the airport was defined with the correct
elevation, but the runways etc. were built at 0 elevation.

This makes everything at 0 elevation so we can set the elevation
in the STG file for the moment.
2020-11-15 11:20:41 +00:00
Erik Hofman
f0b24af3f1 Fix an off by one problem which is left from a failed attempt to interpolatre between classes 2020-11-15 09:31:26 +01:00