Commit Graph

5039 Commits

Author SHA1 Message Date
James Turner
8b4ace6fb8 Subsystems: stub code for smart add+remove
Groups track their state, which will enable them to correctly transition
added and removed children in the future. Only stubbed for now, to avoid
breakage on the FG side.
2018-04-25 22:20:12 +01:00
James Turner
368120c479 Track a root property on subsystem-manager 2018-04-25 21:34:17 +01:00
James Turner
48b228f68f Packages: additional test for updating invalid
This is part of trying to trace a crash reported on the devel list,
unfortunately the test passes but it’s sill good to have it
2018-04-25 17:04:07 +01:00
James Turner
bf21c0e099 MSVC build fixes, ooops 2018-04-25 11:41:40 +01:00
James Turner
d85d85e7dc Subsystem improvements for testing
- track more meta-data and a factory function for each subsystem, 
registered either explicitly or via a helper static class.
- add a delegate to receive notifications of subsystem changes
- make sub-grouped subsystems work more naturally, especially for
child lookups
- add some test coverage for all of this
2018-04-25 08:58:58 +01:00
Florent Rougon
99c1dd8124 Add compiler options for GCC and Clang when CMAKE_BUILD_TYPE is Debug
When CMAKE_BUILD_TYPE is Debug and we are compiling with GCC, add the
following options to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS:

  -O0 -fno-omit-frame-pointer -fno-inline

Ditto for Clang, except that -fno-inline-functions is used instead of
-fno-inline.

cf. thread starting at
https://sourceforge.net/p/flightgear/mailman/message/36295412/
2018-04-18 08:25:10 +02:00
James Turner
2797970837 Catalogs: better invalid data handling 2018-04-08 23:57:24 +01:00
James Turner
cf03307b70 More verbose error logging from Repository code 2018-03-30 17:24:58 +01:00
Edward d'Auvergne
dfed2184f1 SGEventMgr: Protection from timer insertion after shutdown.
This actually happens, Nasal timers are added after the event manager shutdown()
subsystem API call.
2018-03-25 22:45:04 +02:00
Edward d'Auvergne
340a469153 LogStream: Added a testing mode to the simgear logstreams.
The new function logstream::setTestingMode() has been created to allow for a
testing mode to be set.  This stores a boolean in the private logstream thread
which modifies the behaviour of the would_log() function, allowing for
everything to be logged.  The removeCallbacks() function has also been added,
allowing for the default fgfs output to STDOUT and STDERR to be silenced when
calling setTestingMode().
2018-03-22 14:45:32 +00:00
Thomas Geymayer
62ae6ca35e Mostly canvas doxygen improvements and C++11 refactoring. 2018-03-02 09:07:01 +01:00
Thomas Geymayer
711a4fe0c8 canvas::Map: Preserve default values without new values
Ensure default values are used (instead of 0) if no values are
specified.
2018-03-01 09:10:24 +01:00
James Turner
cba07157d5 Packages: better version handling & migration
Add test coverage for disabling a catalog due to version, and also
for auto-migrating to a new version. Expose disabled catalogs on the
Root, so they can be checked for.
2018-02-28 17:26:15 +00:00
Thomas Geymayer
a653d67aae canvas: Event improvements and new events (dragstart, dragend) 2018-02-25 14:50:49 +01:00
Erik Hofman
6a142bc264 Merge branch 'release/2018.1' into next 2018-02-20 10:11:38 +01:00
Erik Hofman
8bcdd89796 Properly initialize _bad_doppler 2018-02-20 10:11:04 +01:00
Torsten Dreyer
489573329e new version: 2018.2.0 2018-02-18 21:22:54 +01:00
Torsten Dreyer
843df4b334 new version: 2018.1.1 2018-02-18 21:22:54 +01:00
Erik Hofman
ef1821c025 Switch to C++11 2018-02-16 16:09:26 +01:00
James Turner
ed5372f439 Add new PROTECTED property attribute 2018-02-04 17:10:41 +00:00
James Turner
bc63381fb0 Packages: tweaks to thumbnail cache
Don’t discard the existing data when expiring from the cache, in case
the refresh request fails.
2018-01-31 15:00:58 +00:00
James Turner
c59f2a0749 Fix Windows _wutime compilation 2018-01-31 13:10:34 +00:00
James Turner
5c30ca5dc6 Add SGPath::touch() helper 2018-01-31 11:04:10 +00:00
Thomas Geymayer
37bc43c7aa canvas::Path: support for stroke-opacity and fill-opacity 2018-01-29 09:07:04 +01:00
Thomas Geymayer
4edd3f45b7 canvas: Refactor and protect against expired pointers 2018-01-28 15:57:14 +01:00
Thomas Geymayer
087ea4c5f3 canvas: Refactor with C++11 2018-01-28 00:49:05 +01:00
Florent Rougon
40534d6316 Remove overzealous, invasive behavior from SGBinding's destructor
Since the dawn of times (FG commit
1bcaf4bfdd38f18ac7c375dd9319935ff3df56ac, where SGBinding was called
FGBinding), SGBinding's destructor has had a strange behavior:

SGBinding::~SGBinding()
{
  if(_arg && _arg->getParent())
    _arg->getParent()->removeChild(_arg->getName(), _arg->getIndex());
}

In other words, it used to remove the passed-in <binding> node from its
parent node (if any) once the SGBinding instance got destroyed. This
behavior is very unintuitive to several people and has resulted in a few
workarounds in the FG code base just to cope with this strangeness.

This commit gives SGBinding the implictly-generated destructor,
therefore SGBinding::~SGBinding() does not attempt to remove the
property node anymore.

See disussion at:

  https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/87d12b1h0h.fsf%40frougon.crabdance.com/#msg36190666
2018-01-27 11:03:06 +01:00
James Turner
8621925e75 Floating-point comparison helpers for SGMath<T>
Implemented using numeric_limits::epsilon and std::abs, fingers
crossed this is sufficiently portable!
2018-01-26 11:29:18 +00:00
Thomas Geymayer
5cb2360985 cppbind: Use separet Context::to_nasal_vec instead of overload 2018-01-23 16:15:56 +01:00
Thomas Geymayer
b831d2b64a cppbind: Fix for old g++ 2018-01-23 14:02:18 +01:00
Thomas Geymayer
e81597a176 cppbind: Opimize convert fixed size arrays and more type_traits 2018-01-23 09:30:00 +01:00
James Turner
7df4f32de6 Merge /u/janodesbois/simgear-jano/ branch mp-merge into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/42/
2018-01-22 09:48:01 +00:00
Thomas Geymayer
db3725880e cppbind: simplify with 'auto' 2018-01-21 14:39:24 +01:00
Thomas Geymayer
af5833cbc5 cppbind: Refactor to use C++11+ type_traits 2018-01-21 13:21:55 +01:00
James Turner
9078a085c3 Kill exception if removeDelegate fails
This simplifies logic when changing the package::Root
2018-01-20 16:19:13 +00:00
jean pellotier
396a7d7f09 a system clock from simgear, using std::chrono libs
this is to use some kind of utc time for timestamps in mp protocol,
to improve the lag correction system for mp planes, using a
"real time" mode when possible.
2018-01-20 09:15:56 +01:00
Thomas Geymayer
8a128a57cd cppbind: forward declarations 2018-01-19 10:34:37 +01:00
Thomas Geymayer
3dca9b8a68 cppbind: Make Mac and Windows happy and add forward declaration 2018-01-19 10:24:33 +01:00
Thomas Geymayer
5f8f5a1c33 cppbind: More refactoring and finally getting rid of boost.preprocessor 2018-01-19 09:12:11 +01:00
Thomas Geymayer
5a72a7d9f4 canvas: Refactor Path::addSegment with std::initializer_list 2018-01-16 09:01:55 +01:00
James Turner
51a91bfa8a Ignore CmakeList.txt.user files 2018-01-12 22:19:54 +00:00
Thomas Geymayer
4cedd0a346 cppbind: refactor Ghost::method to use variadic templates 2018-01-12 08:32:57 +01:00
Thomas Geymayer
b989f4085d Various doxygen improvements/fixes. 2018-01-12 08:32:04 +01:00
Thomas Geymayer
19cc797c41 cppbind: fix exporting integer_sequence and small codingstyle fixes 2018-01-12 07:57:17 +01:00
Thomas Geymayer
99ee3d9dec cppbind: nasal::Context refactoring and doxygen improvements. 2018-01-09 22:50:29 +01:00
Florent Rougon
455753c774 Simplify code in NetChannelPoller::removeChannel()
Remove an apparently bogus portability workaround (which was presumably
targetting one of the bugs fixed in the previous commit [1]) and further
simplify the code using std::find().

[1] da099d4312/
2018-01-08 10:26:18 +01:00
James Turner
da099d4312 Correct use of remove_if in the test-server
Should fix erratic crashes of some tests.
2018-01-07 16:10:50 +00:00
xDraconian
a88b9181b6 Enable the test 'test_precipitation' 2018-01-04 08:18:43 +01:00
xDraconian
7f7c632914 Simgear::test_precipitation test coverage
Lines:     0.0% >> 92.3%
Functions: 0.0% >> 97.1%

Memory leaks resolved - reclaiming 169kb in 126 blocks
No memory leaks remain
2018-01-03 12:40:49 +00:00
Alessandro Menti
e7356223bb
CMakeLists.txt: explicitly enable the CMP0067 (C/C++ standard flags) policy
Explicitly enable the CMP0067 policy to have try_compile use the correct
C/C++ standard flags; otherwise, CMake will default to not honoring those,
causing the C/C++ checks to be compiled with no standard flags and SimGear
to be compiled with them. This causes errors if we try to detect a new
prototype which is only present in C++14 and above).
2018-01-03 11:54:04 +01:00