Commit Graph

5956 Commits

Author SHA1 Message Date
Erik Hofman
e0d7a92eba Fix a bunch of compiler errors 2021-04-15 10:05:22 +02:00
Erik Hofman
93299bf191 Fix a compiler warning: not defining a virtual destructor results in undefined behavior 2021-04-15 10:05:05 +02:00
Erik Hofman
986867f5c5 Make size_t available 2021-04-15 10:04:00 +02:00
Erik Hofman
bcfff2a967 Bi-directional I/O using Data Distribution Services requires a separate reader and writer. 2021-04-15 09:45:17 +02:00
Richard Harrison
9b3265c46c Emesary: lock free performance improvements
After testing with multithreading there were still problems related to
scope and transmitters - because a transmitter that was on the stack
as an object could go out of scope before a notify all had finished
and lead to invalid data and a crash

The solution is to always have Recipients allocated via new() and to
use a shared pointer to manage the scope and garbage collect when the
last reference goes out of scope.

To achieve the threadsafe minimal locking the rules are as follows;

* All recipients must be allocated via new()
* Register and DeRegister will only happen when on the outermost
  level of NotifyAll.
 - all other add or delete will be put into the pending queue and
   added at the start of the next outer notify all
 - at outer level notify all a lock will be taken to process pending
   items
* during the main notify processing there will be no locks - however
  it is also assumed that the recipient list will not be changed
2021-04-11 00:42:49 +02:00
Richard Harrison
739c76e862 Win32 console; added method to ignore errors
This is mainly for standalone FGCOM - because the error message is always shown because it is a console app and --console isn't required.
2021-04-08 21:57:31 +02:00
Erik Hofman
9ae26d7f80 Get the GUID from DDS and store it for future use. Which coul be handy for point-to-point connections over DDS. 2021-04-07 11:51:32 +02:00
James Turner
89271e85a0 Shaders: report all shader file paths
When reporting a shader log error, include all the shader file
paths and the effect path in the detailed error information.
2021-04-05 12:06:55 +01:00
Erik Hofman
e4c214578b Allow parsing a DDS configuration file. Add a guard condition to wake up the waitset at exit. 2021-04-05 12:38:13 +02:00
Stuart Buchanan
769e00ffdf WS30: AREA_FEATURE_LIST STG verb - lakes, lochs
- Add and AREA_FEATURE_LIST STG verb.
- /sim/rendering/static-lod/area-features-lod-level to control point at
  which such feature are rendered
- /sim/rendering/static-lod/lod-leve[n]/area-features-min-width sets
  the minimum width for feature rendering at that LoD level.

STG Format:

AREA_FEATURE_LIST <file> <material>

File format:

Area Attrib A B C D lon0 lat0 lon1 lat1 lon2 lat2 lon3 lat4....

where:
 Area is the area of the feature in m^2
 Attrib is an integer attribute (currently unused)
 A, B, C, D are generic float attributes.  Their interpretation may vary by feature type
 lon[n], lat[n] are pairs of lon/lat defining straight road segments
2021-04-04 16:25:04 +01:00
James Turner
5f026c840c TerraSync: better reporting of permissions failures removing files
Log a ‘failed to remove orphan’ error as an error with the repository,
instead of failing the entire sync
2021-04-02 16:46:47 +01:00
James Turner
ae920c6ebd TerraSync: add a warning file to the root dir.
Try to discourage users from adding custom content underneath the
Terrasync dir, since it can be over-written.
2021-04-02 16:45:50 +01:00
James Turner
0343ef7246 Fix windows build, missing <algorithm> 2021-04-02 16:45:03 +01:00
Fernando García Liñán
00a6f02a55 Sort lights when we can only render a limited number of them
This ensures that higher priority lights and lights that are closer to the viewer get rendered.
2021-04-01 03:14:12 +02:00
Fernando García Liñán
eb761fc7ee Add compile_commands.json to .gitignore 2021-04-01 01:40:22 +02:00
Erik Hofman
9cb98475b2 Fix MingW and MSVC builds: return a uniform type name across platforms. 2021-03-29 16:08:06 +02:00
Erik Hofman
e58ca605b6 Delete the readers and writers (which closes them automatically) to prevent memory leaks. 2021-03-29 11:41:12 +02:00
Stuart Buchanan
deb802f74a WS30: Improve random vegetation, reduce frame paus
- Generate vegetation based on underlying landclass material mapping
- Reduce frame pauses by removing terrain init from update visitor
- Fix a couple of small timing windows causing crashes.
2021-03-28 19:50:26 +01:00
Erik Hofman
17c79caea3 Add a convenience constructor which uses the types typename to call setup, eliminating the need to call setup separately. 2021-03-28 08:57:37 +02:00
Erik Hofman
8e97b5e414 Add a helper function which converts the template typename into a topic name. 2021-03-27 15:21:22 +01:00
Erik Hofman
5e837b50c4 Add a fubction which converts a template typename to a string 2021-03-27 15:19:23 +01:00
Erik Hofman
0530bc2cd7 Add a templated helper function for read and write to simplify the code 2021-03-27 13:56:21 +01:00
Erik Hofman
4b530e9376 Fix a mistake of effectively multiplying by DDS_NSECS_IN_SEC twice. 2021-03-27 13:16:24 +01:00
James Turner
0a7e6b9b84 Subsystems: add checks to avoid crash on early exit
Don’t crash if the user exits before subsystems are bound / init-ed
2021-03-23 17:06:05 +00:00
James Turner
676a2e3880 Fix for local particle update
See issue at:
https://sourceforge.net/p/flightgear/codetickets/2568/
2021-03-22 19:28:14 +00:00
James Turner
4c89e8a9d5 Packages: add ‘provides’ listing support
Support a list of provided files on a package, to make it easier to 
identify which package to install based on a required file path.
2021-03-21 16:00:33 +00:00
James Turner
4810eaab92 HTTP: permit cancels inside callbacks 2021-03-21 13:26:04 +00:00
James Turner
224b557573 Packages: support a type enum
Work towards other package types, conceptually. (Not actually
implemented yet)
2021-03-21 13:26:04 +00:00
Stuart Buchanan
a02353a280 WS30: Separate Water mesh and Effects
- Rip out various pieces of irrelevant code, simplifying VPBTechnique.
  Largely dealing with multiple textures per terrain tile, which we
  don't need.
- Use a lookup of the landclass of mesh vertices to identify sections of
  the mesh that are entirely in water, and split those out into a
  separate water mesh, using it's own Effect.
2021-03-20 22:01:12 +00:00
Erik Hofman
55e0d4760f Rename the SG_DDS class to SG_DDS_Topic and create a new SG_DDS class which can handle multiple SG_DDS_Topic classes with a single waitset. Add a unit test for DDS 2021-03-19 13:51:58 +01:00
James Turner
8e338389dd MMap: fix a missed change to use pimpl. 2021-03-16 20:33:44 +00:00
James Turner
522aed9b73 MMap : improved error reporting, Win32 compat
Use strutils::sterror to print errno; convert to pimpl idiom to
avoid pulling Windows.h into public view.
2021-03-16 15:49:58 +00:00
Erik Hofman
0c72b5e622 Of course Windows has it's own _read and _write function whcih conflict with our own. Rename to mmap_read and mmap_write. 2021-03-16 11:55:40 +01:00
Erik Hofman
c6a7dbd755 Do not allocate any memory but work directly on the mmapped buffer 2021-03-16 10:30:58 +01:00
Erik Hofman
84f7faea05 Set EOF when reaching the end of the mmap buffer 2021-03-16 10:30:27 +01:00
Erik Hofman
e8cbcebad8 Make life easier by implementing the system read and write function and call that from the classes read and write functions. Add a forward and rewind function. Add a test_untar derived mmap test utility. 2021-03-16 09:51:37 +01:00
James Turner
cf2fe76bb8 Log positions in courseDeg/distanceM failures
Trying to understand what causes FLIGHTGEAR-71G on Sentry; suspect it
might be passing in uninitalised values.
2021-03-15 15:45:19 +00:00
James Turner
798e690279 ReadWav: error reporting
Report errors from readWAV, and improve attribution for the
format error (include the file path). As a result, mark the individual
exceptions as dont-report, since we will report higher up.
2021-03-15 15:45:19 +00:00
Erik Hofman
931a696007 Add a setup function which takes the topic name from the descriptors typename 2021-03-15 15:16:28 +01:00
Erik Hofman
76cf1e01c6 Sigh, fix a stupid typo. 2021-03-15 15:16:00 +01:00
Erik Hofman
88beb40090 Make simple_mmap and simple_unmmap static private members of SGMMapFile. This should also fix the Windows build error on Jenkins. 2021-03-15 14:45:52 +01:00
Erik Hofman
c539f7ebb6 Add an advance function to step through the mmaped buffer 2021-03-15 13:29:39 +01:00
Erik Hofman
4ace6bda60 Use the new mmap functionality to access the timezone file, removing the need to keep the database in memory. 2021-03-15 11:08:22 +01:00
Erik Hofman
f00a825e2d Add a cross-platform file mmap class and use it to access the timezone file, removing the need to keep the database in memory. 2021-03-15 10:58:17 +01:00
Erik Hofman
508a511070 More gracefully bail out on a missing timzeone file 2021-03-13 13:09:59 +01:00
Erik Hofman
1ea11d987e Add a function to get the timezone description 2021-03-13 10:12:46 +01:00
James Turner
feaac37705 Make SGTimeZoneCOntainer using a pimpl
Keeps zonedetect data private to SimGear
2021-03-12 14:44:26 +00:00
James Turner
4a1809b566 TerraSync: allow an explicit osm2city server
Fixes an error case where a manual TerraSync server is specified; we
would attempt to use an empty string as the OSM2City server, with
hilarious consequences.

Sentry-Id: FLIGHTGEAR-NCZ
2021-03-12 12:47:51 +00:00
Erik Hofman
a9615869e3 If a reader is detected there is no need to test it further, just set a boolean. 2021-03-12 10:48:12 +01:00
Erik Hofman
878b742558 Display the time file that fails 2021-03-12 10:45:01 +01:00