1
0
Fork 0
Commit graph

15162 commits

Author SHA1 Message Date
Scott Giese
2c9e2d86db Maintenance: MPServersModel
type correctness
2021-02-20 22:29:55 -06:00
James Turner
caad29e7c8 Add error reporting to common failure points.
Not exhaustive by far, but adds many of the common failure points
witnessed on Sentry.
2021-02-20 20:06:27 +00:00
James Turner
a0ff4adbc6 Tweaks to sentry integration
Report menu item activation, and define a RAII helper for setting
the XML error reporting state.
2021-02-20 20:05:51 +00:00
James Turner
c85916d88d Add error reporting subsystem
Requires corresponding SimGear commit
2021-02-20 20:05:03 +00:00
James Turner
cab0dc12a1 Remove a lingering Boost usage 2021-02-20 19:59:13 +00:00
James Turner
67d235a17e Add a CMake message when ASan is enabled 2021-02-20 19:59:13 +00:00
Scott Giese
dd60a041b1 Maintenance: Yasim
unused static const char* warning.
Eliminate the variable since it is the only one defined.
2021-02-20 11:12:15 -06:00
Scott Giese
20c386a2f4 Maintenance: flite
fix whitespace and unguarded warning.
2021-02-20 11:09:12 -06:00
Scott Giese
01d912ad73 Maintenance: flite - unused variable 2021-02-20 10:07:27 -06:00
Scott Giese
92e34d5bf5 Maintenance: flite
logic error: Use of uninitialized variable.
clean up a few whitespace issues.
2021-02-20 10:06:23 -06:00
Julian Smith
32a066f810 Fixed replay-from-url bug.
Need to use simgear::HTTP::FileRequestRef shared pointer, otherwise
HTTPFileRequest will delete it after the transfer.

Also changed callback to a lambda to match reinstated simgear API.
2021-02-20 13:54:04 +00:00
Scott Giese
9fdb3e2c2a Maintenance: flite - type safety
address of struct containing union.  explicit cast to suppress warning.
2021-02-19 23:49:30 -06:00
Scott Giese
2e6ee5c2d3 Maintenance: iaxclient - Prevent buffer overflow 2021-02-19 23:03:12 -06:00
Scott Giese
d73bc11cf5 Maintenance: iax_transfer
Set but unused return code.  Removed.
2021-02-19 22:48:14 -06:00
Scott Giese
580d069a1f Maintenance: Prevent buffer overflow 2021-02-19 22:43:44 -06:00
Scott Giese
0df12d9c60 Maintenance: _BSD_SOURCE is deprecated
_DEFAULT_SOURCE supercedes _BSD_SOURCE
Suppresses glib warning
2021-02-19 22:03:02 -06:00
Julian Smith
309e28c6d7 src/Viewer/viewmgr.cxx: removed asserts on inputs from aircraft/nasal code.
The fgfs executable is the unit within which it makes sense to check
preconditions with assert. We are not in control of aircraft code in the same
way.

This allows debug build of test-suite to check handling of out-of-range view
numbers.
2021-02-19 22:27:34 +00:00
Julian Smith
ca423e0e3e src/Aircraft/replay.cxx: downgrade recording indexing diagnostic. 2021-02-19 10:21:21 +00:00
Julian Smith
5b2fd572e4 src/Main/options.cxx: fixed Windows build error - use SGTimeStamp::sleepForMSec(), not sleep(). 2021-02-19 10:21:21 +00:00
Scott Giese
0019b22046 Code Maintenance - nullptr checking 2021-02-18 23:52:46 -06:00
Scott Giese
0555d70a37 HTS: Code Maintenance
Resolve logic bug
Strengthen type safety
Prevent buffer overrun
2021-02-18 23:17:46 -06:00
Scott Giese
86ff18e0e6 Replay: Resolve missing mutex header 2021-02-18 23:12:31 -06:00
Julian Smith
5a70245ba9 src/Aircraft/replay.*: modified to match change to simgear::HTTP::FileRequest::setCallback().
We now use a function pointer instead of a lambda.
2021-02-18 23:21:01 +00:00
Julian Smith
f3679f121d Allow replay of Continuous recordings if --load-tape is given a URL.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.

We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).

Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.

src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    FGReplay::loadContinuousHeader()
        Loads properties from Continuous recording's header, distinguishing
        between failure due to incorrect header, or due to a truncated file.
    FGReplay::indexContinuousRecording()
        Contains Continuous recording indexing code, in a form that can be used
        in background while we are downloading.
    Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
    be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
    fgOptLoadTape():
        Modified to handle --load-tape=<url>. We start download, and read
        the header before returning, so that we can force the FDM to use the
        recording's aircraft instead of the user's default. Limit recording
        download rate if /sim/replay/download-max-bytes-per-sec is set, by
        calling new filerequest->setMaxBytesPerSec().
2021-02-18 09:32:15 +00:00
James Turner
02e0d17dbc Fix MSVC unused-var warning 2021-02-15 09:33:30 +00:00
jano
4a4117b9ab make the mp protocol send rate independant from time accel,
based on mp protocol clock.
2021-02-15 09:27:36 +00:00
jano
a28bf28ee0 Throttle Hz aligned to time-grid, add initial offset.
Allows sync of two or more FG session, if wall clock are in synch.
2021-02-15 09:11:46 +00:00
jano
7dfbcf0918 Make the steady clock and MP clock init at modelHz boundary.
This removing any fractional (of a modelHz step) part when initialising.
This allow us to sync time in different FG instances, if FPS allow.
2021-02-15 08:58:51 +00:00
legoboyvdlp R
bf26817d53 Splash screen: add counter displaying how many MBs are left to extract 2021-02-14 17:07:18 +00:00
James Turner
00dbd23bec Fix unit-tests for particles lifetime.
Missed call to ParticlesGlobalManager::clear on scenery shutdown
2021-02-14 16:40:14 +00:00
Julian Smith
af3afb55db Fixed test-suite build error on OpenBSD.
assertEquals<> template requires first two args to be the same type, and old
code assumed that time_t was a long int.
2021-02-13 23:04:35 +00:00
Julian Smith
31ec727872 Added record/replay of extra properties, with specific support for window size/position and view settings.
Recording of extra properties is only supported in Continuous recordings.

Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.

To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.

Recording extra properties:
    This is enabled by:
        /sim/replay/record-extra-properties

    The extra properties that are recorded are identified by the property
    paths in the values of /sim/replay/record-extra-properties-paths/path[]
    properties. We record the entire tree for each specified path.

Recording of main window position size:
    We have specific support for record and replay of main window position/size.

    This is enabled by:
        /sim/replay/record-main-window

Recording of main window view:
    We have specific support for recording the view type and direction/zoom
    settings.

    This is enabled by:
        /sim/replay/record-main-view

    We record the /sim/current-view/ property tree, excluding some subtrees
    that continuously vary but are not required for replaying of the view.

When replaying, we allow separate control of what extra property changes are
replayed, with:

    /sim/replay/replay-extra-property-changes
    /sim/replay/replay-extra-property-removal
    /sim/replay/replay-main-window-position
    /sim/replay/replay-main-window-size
    /sim/replay/replay-main-view

We work around some problems caused by the use of tied properties when
replaying changes to view-number.

Window position issue:

    When replaying window position and size changes, things get a little tricky
    because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
    for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
    the position of the interior of the window; for example the y values will
    differ by the height of the window's titlebar. This can cause windows to
    move progressively further down each time they are positioned or resized.

    There doesn't seem to be a way of finding the size of a window's
    furniture directly. So instead this commit adds a new method
    osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
    wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
    following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
    for x and y position that are used for subsequent calls.

docs-mini/README-recordings.md:
    Updated to document new Continuous format.

scripts/python/recordreplay.py:
    New script to test various aspects of record/replay.

Other:

    We now create convenience softlink to most recent continuous recording, using
    SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
    Windows.

    Changed format of Continuous recordings to contain a single property tree
    in header. This is much simpler than having separate Config and Meta trees.
2021-02-13 11:38:52 +00:00
Julian Smith
1ff0ce2222 src/Viewer/sview.*: added support for damping in rotate steps. 2021-02-13 11:38:52 +00:00
Colin Geniet
9008b3194f AI: Fix unit problems for AIBase::vs
It was supposed to be in ft/min, but everything except AIAircraft was
using it as ft/sec. Change the name to AIBase::vs_fps and ensure the
same unit is used everywhere.
2021-02-11 09:27:36 +00:00
James Turner
130cd2ae41 Fix crash spotted on Sentry 2021-02-11 09:26:38 +00:00
James Turner
ab95c8149a Change code to use copyProperties 2021-02-10 13:42:50 +00:00
Guillaume Deshors
0bca9e75b0 take into account headtracking offsets in the view 2021-02-10 12:49:47 +00:00
Erik Hofman
7847418005 Differentiate between snow and wetness. Snow shows with every amount of precipitation but rain puddles only start showing up above 50mm of rain per day. 2021-02-10 11:32:12 +01:00
Stuart Buchanan
2dbf915393 WS30: Remove listener for lod-max-range 2021-02-09 10:31:46 +00:00
Erik Hofman
4894497ce2 Update the way the snow thickness is calculated, otherwise there will never be snow 2021-02-07 16:03:08 +01:00
James Turner
ba8b25db5f Update particles API again
Rename methods to make it clear they do additional work
2021-02-07 11:36:06 +00:00
James Turner
0cc465d39f Tweak Natural-earth loading to reduce DB contention
Reduce ‘SQLITE BUSY’ issues with multiple running copies of FG
2021-02-05 11:14:34 +00:00
James Turner
b915d02f55 Fix crash in AI/Traffic code
Sentry-Id: FLIGHTGEAR-139
2021-02-04 16:11:08 +00:00
James Turner
2ae51b69b0 Sentry: fix UUID init 2021-02-04 11:49:25 +00:00
James Turner
3e9a9e3730 Attempt to log bad allocation errors at source
Use a std::set_new_handler to capture allocation failures at their
origin, instead of in the main loop exception handler
2021-02-04 11:49:25 +00:00
James Turner
7214d95040 Sentry: suppress more XML errors from reports
DOn’t report Ground-net or traffic schedule XML errors, and add
another XML message whitelist entry.
2021-02-04 11:49:25 +00:00
James Turner
7f5f7e0b11 Sentry: add reporting for common path errors
Adding bread-crumbs preceding common failures seen on Sentry, around
addon and aircraft loading.
2021-02-04 11:49:25 +00:00
James Turner
b86baa68c0 Launcher: quit if OpenGL 2.1 isn’t available
Avoid crashing if no OpenGL drivers are available, instead show a
warning message to alert the user.

Sentry-Id: FLIGHTGEAR-76
2021-02-04 11:49:25 +00:00
James Turner
85f870f607 macOS: don’t crash if menu items are used early
Because we create the menubar earlier on macOS, the user can select
items before Nasal is loaded, causing a crash.
2021-02-04 11:49:25 +00:00
James Turner
f5410cee9c Sentry: whitelist one more XML message 2021-02-04 11:49:25 +00:00