Commit Graph
100 Commits
Author SHA1 Message Date
Torsten Dreyer 2523236cec Merge /u/frougon/flightgear-simgear/ branch thread-safe-alternative-to-strerror into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/9/
2016-05-09 10:51:13 +00:00
Torsten Dreyer 1c182ff69d Merge /u/psadro/simgear/ branch terragear-changes into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/8/
2016-05-09 10:47:04 +00:00
Torsten Dreyer 561e451192 Introduce SGBinaryFile
For Windows, default file mode is TEXT.
If binary files should be created _O_BINARY shall be or'ed to the open
flags. This is not necessary on *nixes.

Introduce a SGBinaryFile as extension to SGFile which adds the flag
upon construction on Windows.

This should keep existing behaviour for all other usages of SGFile.
2016-05-06 22:01:42 +02:00
Torsten Dreyer 74b4df9452 Don't use object returned from vector::end()
Replace all use of c->name by it->file() in
updateChildrenBasedOnHash()'s fsChildren loop
to avoid confusion.

Thanks to Geoff for spotting this!
2016-05-06 16:21:43 +02:00
Torsten Dreyer 862980a67a Remove unneeded local scope
(no functional change intended)
2016-05-06 16:20:09 +02:00
Torsten Dreyer 5fb8891e86 Fix one more crash on Windows in HTTPRepository
inner scope it seems to overwrite out scope it on Win :-/

Anyway, the erase-remove-idiom is a better solution for that task
https://en.wikipedia.org/wiki/Erase%E2%80%93remove_idiom

Also remove some useless debug messages
2016-05-06 10:48:16 +02:00
Torsten Dreyer f3d68a170e Don't continue parsing after processing version line 2016-05-05 21:59:35 +02:00
Torsten Dreyer 639e16b722 use safer stl functions instead of pointer operations 2016-05-04 21:10:12 +02:00
Torsten Dreyer 9456ff838c Add a bunch of debug messages to help fixing the Windows crash
This patch should be reverted once the bug is fixed
2016-05-04 15:44:55 +02:00
Torsten Dreyer eac3402176 Enable DNS resolver code by default 2016-05-03 14:58:38 +02:00
Torsten Dreyer 9a29f54f8a Terrasync: implement HTTP service lookup via DNS
Let terrasync use the http repository if
  /sim/terrasync/http-server == "automatic"
  resolve DNS NAPTR RR for terrasync.flightgear.org with service "ws20"
  and flags "U". Pick one of the returned entries with lowest order
  and preference. If more than one entry  with the same order and
  preference is returned, pick a random entry of those returned.

or if
  /sim/terrasync/http-server != "automatic"
  explicitly use the value of that property as the http server

if
  /sim/terrasync/http-server is empty, fall back to the legacy
  SVN repository
2016-05-03 12:11:38 +02:00
Torsten Dreyer 5e7b5cbf68 udns: fix self baked inet_pton 2016-05-03 09:43:56 +02:00
Torsten Dreyer bba11c18d1 Fix Nasal math.clamp()
Thanks to "Red Leader" from the forum for spotting
2016-05-02 21:57:35 +02:00
Torsten Dreyer 379a171d24 Use simgear sleep instead of usleep 2016-05-02 21:25:19 +02:00
Torsten Dreyer 87eaec3ce7 Fix some warnings reported from msvc 2016-05-02 20:54:28 +02:00
Torsten Dreyer b5dace5f08 Fix Windows build (hopefully) 2016-05-02 20:46:42 +02:00
Torsten Dreyer 5ecf07e92d udns: add missing config.h 2016-05-02 20:27:04 +02:00
Torsten Dreyer 53d8dcfc77 Try fix windows compile for udns 2016-05-02 17:42:01 +02:00
Torsten Dreyer 6b31646d61 Hardening the DNSClient code
- add a timeout to avoid deadlock without a dns server
- test against existing terrasync.flightgear.org RR's
2016-05-02 16:21:42 +02:00
Torsten Dreyer 51ad61061f Fix broken build/install with DNS enabled 2016-04-28 10:50:15 +02:00
Torsten Dreyer ff5b09c97b Initial commit for a DNS service resolver
- import udns library
  (http://www.corpit.ru/mjt/udns.html)
- initial draft for a DNSClient (derived from HTTPClient)

Enable compile and test by adding -D ENABLE_DNS=Yes to cmake flags
2016-04-28 09:37:08 +02:00
Torsten Dreyer ce245059b8 Merge /u/edauvergne/simgear/ branch particles into next
http://sourceforge.net/p/flightgear/simgear/merge-requests/4/
2016-02-23 21:55:18 +00:00
Torsten Dreyer da6b395008 Fix SimGear compile on Linux 2016-02-22 19:49:20 +01:00
Torsten Dreyer 951859d8a7 correct user-agent string for terrasync 2016-02-15 16:53:31 +01:00
Torsten Dreyer 7afd2be652 Version 2016.1.0 2016-01-05 20:45:11 +01:00
Torsten Dreyer 6be4ad27ee Add fg_root and cwd to the search path for loaded models
ref: http://sourceforge.net/p/flightgear/mailman/message/34650992/
2015-11-27 11:11:42 +01:00
Torsten Dreyer 589c5ba35a SGMaterialAnimation: Better handling of missing texture
Don't retry loading a missing texture on every frame.
Emit a warning message instead and retry on the next
change of the textures name.
2015-11-27 11:09:16 +01:00
Torsten Dreyer ff3efaee93 Fix wrong log-class for debug message 2015-11-02 10:56:17 +01:00
Torsten Dreyer b7c7f66bf3 Fix #1783: repeated error message on console
This downgrades the "file not found" message to a warning.
2015-08-05 09:26:46 +02:00
Torsten Dreyer c7a60d4dc4 Bump version to 3.7.0 2015-07-27 21:42:17 +02:00
Torsten Dreyer a841fcc89e bump version -> 3.6.0 2015-07-14 11:35:35 +02:00
Torsten Dreyer e64902ae8c Amend previous patch also for PropertyObject<string> 2015-05-28 12:03:48 +02:00
Torsten Dreyer 0b1399479a PropertyObject: enable creation of property
add a create-flag to the node() method of a PropertyObject,
defaulting to false to maintain existing behaviour.
This could be used to add a listener to a non-existing property
without having to write a dummy-value beforehand.

Usage:
myPropertyObject->node() returns the corresponding node or NULL if
does not exist or has not been accessed before.
myPropertyObject->node(true) returns the corresponding node, never NULL.
If the property does not exist, it will gets created.
2015-05-27 20:18:22 +02:00
Torsten Dreyer 541239ceac StateMachine: fix transition source location
source should be child of transition
2015-04-21 13:45:16 +02:00
Torsten Dreyer fd74095939 StateMachine: fix messed up entry/exit/update bindings 2015-04-21 10:02:22 +02:00
Torsten Dreyer e836e85697 Bump version to 3.5.0 2015-01-17 19:33:25 +01:00
Torsten Dreyer 023b5a09f7 Make expiry time for paged models settable from props
Our paged models used the default minimumExpiryTime of zero seconds
which caused frequent stutter with AI traffic loaded.
This patch sets the minimumExpiryTime to 180 seconds, more than enough
to hold the models in memory during a full standard rate turn.

The property to set the expiry time is
/sim/rendering/plod-minimum-expiry-time-secs
2014-11-19 17:23:29 +01:00
Torsten Dreyer 75271c44a8 Precipitation updates from ThorstenR
Since the consensus seems to be that the precipitation clipping issue is with the panel code, attached is  my proposed update for the precipitation system in SG and FG

* without corresponding control structures in FGData it falls back to default, except I have fixed an inconsistency in freezing behavior - previously rain changed suddenly to snow when the temperature dropped below zero, but the reverse transition was dragged out and gave odd visible motion with the wind as snow gradually changed back to rain with the particle speed not well defined. Now both transitions are sudden. And I see no more particles flow against the wind

* with

 <!-- definitions for the detailed precipitation manager -->
 <precipitation-control>
     <rain-droplet-size type="float" userarchive="n">0.015</rain-droplet-size>
     <snow-flake-size type="float" userarchive="n">0.03</snow-flake-size>
     <detailed-precipitation type="bool" userarchive="n">false</detailed-precipitation>
     <illumination type="float" userarchive="n">1.0</illumination>
     <clip-distance type="float" userarchive="n">5.0</clip-distance>
  </precipitation-control>

added to Environment/environment.xml, the new system allows to switch more detailed management on. This provides

* explicit setting of rain droplet size and snow flake size by the weather system

* automatic sqrt(r) scaling of the vertical speed of raindrops

* automatic transition to snow when freezing for small droplets but hail for large droplet sizes (looks like snow, but has different particle dynamics)

* an illumination scaling factor to dim the precipitating based on the light we have in the scene (I still need to devise a property rule to set this automatically)

The clip distance is also exposed now and considered at startup of the system - might be useful for e.g. airships when the gas bag provides rain cover (?)   or to be simply off for open airplanes
2014-10-21 10:46:48 +02:00
Torsten Dreyer 543f1b7902 Set sun color below horizon
Thorsten Renk:
The following patch sets the sun color to alpha=0 when
the sun is below the local horizon, removing the oddity
that the sun is seen 'through' the terrain when the terrain
at large distance is rendered by the skydome.
2014-10-08 12:45:01 +02:00
Torsten Dreyer 2bf79a2fa1 Merge branch 'UniformFactory' into next
Merging in Stuart's fix for the Effect system
2014-09-27 21:50:44 +02:00
Torsten Dreyer ab956f15c3 A better fix for crash in the Effect System
Stuart has improved the UniformCache approach, here are his
changes:
- We have a UniformCache so that each unique Uniform is only created once
- As part of the UniformFactory we also have a queue of listeners that are still to be added
- When the main thread sends an Update node visitor across the Effects,
  all queued listeners are de-queued and added.
2014-09-27 21:48:36 +02:00
Torsten Dreyer 46bed67cce first stab at UniformFactory 2014-09-05 11:28:58 +02:00
Torsten Dreyer 5b9af0c0aa Revert "Partial fix for crash in SGPropertyNode::fireValueChanged"
This reverts commit f33ad357e9.
2014-09-05 11:28:28 +02:00
Torsten Dreyer f33ad357e9 Partial fix for crash in SGPropertyNode::fireValueChanged
The effect system used Listeners on property nodes to get the values
for shader uniforms. These listeners get deleted by an osg thread
causing access to freed memory when this happens while the main thread
calls fireValueChanged.

This patch changes the update method to polling for scalar properties.
This isn't 100% threadsafe, too. But at least it does not crash anymore.
2014-08-29 15:30:25 +02:00
Torsten Dreyer 3ca7369fb2 Canvas: add stroke-linejoin handling for path elements 2014-08-26 00:08:35 +02:00
Torsten Dreyer 1d93e8d61e New Version: 3.3.0 2014-07-17 14:54:35 +02:00
Torsten Dreyer 4bd34991e9 New Version: 3.2.0 2014-07-16 14:56:49 +02:00
Torsten Dreyer d44a3117d9 Partial fix of #1408, add missing throw 2014-03-12 21:10:14 +01:00
Torsten Dreyer ea02453f63 fix typo
Thanks to Alex Romosan
2014-01-24 11:10:34 +01:00
Torsten Dreyer 12d0d4140e Version 3.1.0 2014-01-17 21:59:58 +01:00
Torsten Dreyer d6c8008978 No double-zero for the version number :-/ 2014-01-17 21:49:13 +01:00
Torsten Dreyer 1061580118 Version 3.0.0 2014-01-16 21:47:13 +01:00
Torsten Dreyer 5818366d92 Bump version number to 2.12.0 2013-06-28 12:09:30 +02:00
Torsten Dreyer 7489771ad2 Bump version to 2.11.0 2013-01-17 19:22:07 +01:00
Torsten Dreyer c53fd5fc9a feature freeze for 2.10.0, new version number 2012-12-18 21:57:02 +01:00
Torsten Dreyer 70ec13e10b Make the sky disable cutoff distance configurable 2012-03-09 20:58:24 +01:00
Torsten Dreyer 441dc41715 Don't untie a property when loading from xml
executing the fgcommand loadxml implicitely untied every previously
tied property if a property type was given in the property element.
That made it impossible to autosave aircraft data for tied properties.
This patch should fix this. It adds an inconsitency, though:
if a property with a given type is read in which has been tied to
before and the property types do not match, the property type in the
xml file will be ignored.
2012-02-15 14:54:02 +01:00
Torsten Dreyer b20a49b018 bump version number to 2.7.0 2012-01-17 08:35:57 +01:00
Torsten Dreyer 5a6b760847 bump version number to 2.6.0 2012-01-17 07:46:13 +01:00
Torsten Dreyer 3d44f1c825 Revert changes to xmlparse.[ch]
These files are copies from libexpat and should not be touched.
Thanks to Mathias for pointing this one out.
2011-12-26 11:40:57 +01:00
Torsten Dreyer 306c58e7ed Some more trivial warning fixes 2011-12-25 20:28:38 +01:00
Torsten Dreyer 82588b0daf Remove stray ';' 2011-12-25 20:12:48 +01:00
Torsten Dreyer aef8f13290 Use of copy-constructors
explicitly initialize the base class in a copy-constructor instead
of implicitly calling the default constructor.
2011-12-25 20:11:06 +01:00
Torsten Dreyer 4ae7c90d49 Small warning fixes, mostly unused variables 2011-12-25 14:40:07 +01:00
Torsten Dreyer c6d5cbd52c Keep VC90 project file working with SGAtomic 2011-10-27 08:18:54 +02:00
Torsten Dreyer b7173100c8 Merge commit 'refs/merge-requests/11' of git://gitorious.org/fg/simgear into merge-requests/11 2011-09-12 17:26:01 +02:00
Torsten Dreyer 9ef56cbc48 Merge commit 'refs/merge-requests/7' of git://gitorious.org/fg/simgear into merge-requests/7 2011-09-02 12:11:42 +02:00
Torsten Dreyer db509f4075 Merge branch 'next' of gitorious.org:fg/simgear into next 2011-10-08 20:36:20 +02:00
Torsten Dreyer eb52f38c47 Stuart Buchanan:
A further fix to the cloud placement, to make it more accurate over longer distances.
2011-10-06 16:49:09 +02:00
Torsten Dreyer c1f51d5be7 Stuart Buchanan:
Add additional lighting factors for 3D clouds so you can set the bottom, middle, top, and shade lighting factors.
2011-10-06 16:47:03 +02:00
Torsten Dreyer 08cb2039c5 Merge commit 'refs/merge-requests/12' of git://gitorious.org/fg/simgear into merge-requests/12 2011-10-06 16:42:36 +02:00
Torsten Dreyer 09e610b900 Implement #327 Add condition checking the range of a value
New feature for <condition> elements:
An (optional) element <precision> allows for fuzzy equals checks
example:
<condition>
  <equals>
    <property>/foo</property>
    <value type="double">0.0</value>
    <precision>0.1</precision>
  </equals>
</condition>

This condition evaluates as true if /foo is within [-0.05..0.05]
(both inclusive)
The precision tag works for int, long, float and double propeties.
It has no meaning for bool properties. For string properties,
precision sets the length of the strings to compare.
2011-08-24 21:26:02 +02:00
Torsten Dreyer 669ab640da Remove (last) reference to obsolete visual_enviro.hxx 2011-08-21 21:13:38 +02:00
Torsten Dreyer 225c2803ac remove reference to obsolete visual_enviro.hxx 2011-08-20 08:51:39 +02:00
Torsten Dreyer 45f642c4e4 Don't rely on simgear/version.h
version.h is generated by the build system for official builds of
FlightGear. To avoid complicating the life of regular developers,
especially on Windows, we set HAVE_VERSION_H if version.h is generated.
If that define is not set, we include this file instead, which provides
placeholder values instead.
2011-07-25 20:22:57 +02:00
Torsten Dreyer 69cbc2feb5 Bump to version 2.5.0 2011-07-17 11:06:45 +02:00
Torsten Dreyer feb0b83365 Bump version to 2.4.0 2011-07-17 10:46:56 +02:00
Torsten Dreyer da707f3e40 terrasync: some code cleanup - don't use snprintf 2011-06-28 13:16:08 +02:00
Torsten Dreyer d36170879c Terrasync: make whitespace in pathnames work under windows 2011-06-25 00:04:44 +02:00
Torsten Dreyer 6f9a14d6c4 Fix bug #346: httpd broken
Fix bug introduced by myself in
commit b06e38699a
2011-06-22 22:40:23 +02:00
Torsten Dreyer f8a337fb9f gcc warning fix: remove unused variable 2011-05-31 15:53:25 +02:00
Torsten Dreyer c828961327 Merge branch 'next' of gitorious.org:fg/simgear into next 2011-05-28 10:20:03 +02:00
Torsten Dreyer 83a95a0488 (Re)fix bug #285, textranslate broken
Due to fingertrouble, I removed the check for _step == 0 which
this patch re-adds.

Also, make this function look more like a template by not using
0.0 - constants.
2011-05-28 10:17:19 +02:00
Torsten Dreyer b06e38699a Make multicast sockets work under windows
msdn article 737550 states that "the preferred method is to call the
bind function to associate a socket with a local IP address and then
join the multicast group. Although this order of operations is not
mandatory, it is strongly recommended".
Since binding to the multicast address seems to fail, let's try binding
to INADDR_ANY and joint thereafter.
2011-05-27 21:06:06 +02:00
Torsten Dreyer 3a07e2fe21 ignore cmake generated files 2011-05-25 19:21:08 +02:00
Torsten Dreyer ca668f8a37 Fix bug #285 textranslate and scroll animation with negative numbers
rewrite SGStepExpression::apply_mods so it creates the same step
for negative numbers as it does for positive numbers.
2011-05-25 19:14:09 +02:00
Torsten Dreyer 4e6159aa07 Remove unused class SGEnviro
This class and their source files visual_enviro.[h|c]xx were
unused since OSG transition. It's only functionality was to
keep a variable for the enable-state of rendering of precipitation.
This has now been moved to SGPrecipitation.
2011-05-06 14:10:04 +02:00
Torsten Dreyer 6a1d05646c fix typo 2011-05-06 13:07:21 +02:00
Torsten Dreyer 1cd17e9edd Improvements to the global 3D clouds system
Stuart Buchanan:
Improvements to the global 3D clouds system
- clouds now move with the wind
- bug causing cloud coverage to be less than it should have been fixed
- support for adding 3D clouds with an fg_command.

(https://gitorious.org/fg/flightgear/merge_requests/1554)
2011-04-23 20:56:28 +02:00
Torsten Dreyer 4ff014d275 Add multicast support for sockets 2011-04-13 18:43:28 +02:00
Torsten Dreyer 83124e0c05 Don't depend on props.hxx
There is no reference to anything defined in props.hxx, so remove
the dependency here.
2011-02-27 20:35:44 +01:00
Torsten Dreyer a079870bca Add strutils::starts_with and strutils::ends_with 2011-02-20 15:29:06 +01:00
Torsten Dreyer 7479ae521c Provide easy Tie() for indexed properties 2011-02-14 20:24:41 +01:00
Torsten Dreyer 3a620fe55d Fix initial value for tied read-only properties 2011-02-12 14:46:58 +01:00
Torsten Dreyer 503310cdb8 Darn! Typo in vc90 project file 2011-02-06 16:37:48 +01:00
Torsten Dreyer bda8d34c2b Use tiedpropertylist.hxx in cmake and vc90 2011-02-06 16:35:15 +01:00
Torsten Dreyer 2ee87483f9 Move TiedPropertyList from flightgear to simgear 2011-02-06 15:05:50 +01:00
Torsten Dreyer 6d2646239e Fix wrong difference calculation in SGExpression 2011-01-25 23:01:14 +01:00
Torsten Dreyer c955e61ba7 Fix wrong difference calculation in SGExpression 2011-01-25 22:58:50 +01:00
Torsten Dreyer e988dc0e42 Fix bug in SGMisc<T>:: normalizePeriodic()
SGMisc<T>::normalizePeriodic(min,max,value) returned zero for
all values less than min.
Example:
A call of normalizePeriodic(0,twopi(),-pi()) returned zero
where the correct value would be 3*pi().
2011-01-17 19:51:29 +01:00