1
0
Fork 0
Commit graph

14428 commits

Author SHA1 Message Date
Florent Rougon
8e0271d9f6 jsWindows: remove undefined behavior when joyGetNumDevs() > INT_MAX
If joyGetNumDevs() > INT_MAX, casting it to an 'int' leads to undefined
behavior. On the other hand, after the 'ident >= 0' test succeeded, it
is perfectly safe to use static_cast<unsigned int>(ident), since 'ident'
is of type 'int'. Then we get to compare two unsigned ints, which is
well defined.
2019-04-29 13:42:32 +02:00
Florent Rougon
9b019f6b72 FGJoystickInput: increase MAX_JOYSTICKS from 10 to 16
Since PLIBjs uses joyGetDevCaps()[1] on Windows and this function
accepts joystick ids from 0 to 15 (-1 being special), setting
MAX_JOYSTICKS to 16 ensures that FGJoystickInput::init() can scan all
joysticks that joyGetDevCaps() is able to report about.

[1] https://docs.microsoft.com/en-us/previous-versions/dd757105(v%3Dvs.85)
2019-04-29 12:54:03 +02:00
Richard Harrison
9121079cfe Disable time easing if ctrl key pressed. 2019-04-28 19:40:26 +02:00
Richard Harrison
1399640d79 Use OSG to find out the maximum supported texture size
The DDS Texture cache will auto resize textures that are larger than this value.
2019-04-28 19:40:26 +02:00
Richard Harrison
d3ce7adc95 NasalTimers; ensure unique name as this is required to identify the timer for certain operations (e.g. stop) 2019-04-28 19:40:26 +02:00
Richard Harrison
d2a179f1f3 Multiplayer: do not transmit the transmission-frequency-hz 2019-04-28 19:40:26 +02:00
James Turner
bac5d6c713 Windows: read Unicode command line
One more step in full Unicode support.
2019-04-27 18:54:13 +01:00
James Turner
9d71d09072 Enable HID-input on Windows 2019-04-27 18:54:13 +01:00
Bertrand Coconnier
3539b13985 Stricter syntax checking for JSBSim.
JSBSim was not checking the tag names inside <test> and <condition> statements and this has led to abusive use of tags unsupported by JSBSim such as <and> and <or>. The problem is that JSBSim was not interpreting the <or> statement as the user meant it: JSBSim interpreted it as <test logic="AND"> while the user obviously meant <test logic="OR">. As a result JSBSim silently swallowed the tag and gave results which were not was the user expected without any obvious indication about what was going wrong.

As a result, this commit implements stricter syntax checking and rejects illegal tags within <test> and <condition> statements.

This commit also introduces stricter checking on XML elements which allow either a real value or a property name to be used. JSBSim now rejects the statements where the property name is specified inside a <property> statement. For example, the follwoing statement is rejected:

<clipto>
  <min> <property> /fdm/jsbsim/some/property </property> </min>
...

The correct syntax being
<clipto>
  <min> /fdm/jsbsim/some/property </min>
2019-04-27 12:29:22 +02:00
Lars Toenning
aaa753d169 swift: Fixed wrong startup message 2019-04-26 09:37:37 +02:00
Lars Toenning
21124e7b7e swift: CMake adjustment 2019-04-26 09:37:17 +02:00
Florent Rougon
63f6d0b5bf Convert obsolete uses of get_filename_component(<var> <FileName> PATH)
In the context of get_filename_component(), PATH is a legacy alias for
DIRECTORY. Replace it with DIRECTORY, which is recommended[1] for
CMake versions > 2.8.11.

[1] https://cmake.org/cmake/help/latest/command/get_filename_component.html
2019-04-25 19:11:01 +02:00
Florent Rougon
b2d6acdd4d CMake changes related to FGDATA_SRC_DIR and TRANSLATIONS_SRC_DIR
- When FGDATA_SRC_DIR isn't explicitly set by the user, set it to
  ${PROJECT_SOURCE_DIR}/../fgdata if this is a directory.

- When TRANSLATIONS_SRC_DIR isn't explicitly set by the user, look for
  translations in ${FGDATA_SRC_DIR}/Translations instead of
  ${PROJECT_SOURCE_DIR}/../fgdata/Translations (i.e., honor the setting
  of FGDATA_SRC_DIR for the sake of translation lookup).

This fixes the problem explained in [1] and [2].

[1] https://sourceforge.net/p/flightgear/mailman/message/36645499/
[2] b2274fbbed/
2019-04-25 19:11:01 +02:00
James Turner
b83c069b0b Move power-btn and operable props into base class
AbstractInstrument now handles a generic power-btn and operable
property, and hence includes them in the serviceable-and-powered
check.
2019-04-25 17:11:50 +01:00
James Turner
40b96fef48 Convert ADF and (old) NavRadio to use new base class
This enables separate power-supply for each installation.
2019-04-25 17:11:50 +01:00
James Turner
9cd8ccae80 Merge /u/fgarlin/flightgear-src/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/157/
2019-04-25 12:52:46 +00:00
Dan Wickstrom
1948304157 Fix problem where AI planes are placed on top of user aircraft when user either selects a specific spot or user selects parking to be an available spot. 2019-04-25 11:39:41 +01:00
James Turner
6261b71774 Add AbstractInstrument base class and convert DME
Base class handles some common instrument features, such as the
serviceable node and electrical supply. The electrical supply node
and minimum voltage to operate can now be set in the configuration
via <power-supply>/path/to/output/volts</> and <minimum-supply-volts>
2019-04-24 18:56:56 +01:00
Fernando García Liñán
e0507e9095 Fixed the aircraft showing on top of the splash screen when relocating/resetting 2019-04-23 13:21:19 +02:00
James Turner
b2bedfd485 Fix typo in submodels commit 2019-04-22 11:58:55 +01:00
Scott Giese
7ef4fb50ec [fgpanel] resolve linking error with GLEW 2019-04-20 21:56:16 -05:00
James Turner
ea336af4dc Submodel offset supports pitch/yaw values
Reported by Stewart Andreason
2019-04-19 10:15:36 +01:00
James Turner
79562bcf31 Avoid crash on Cmd-Q exit of the app on macOS
On this code path, AppKit uses exit, rather than letting main run as
normal. We handle most things via C++ destructors, which do run, but
Qt is happier if we clean it up explicitly.
2019-04-17 22:53:10 +01:00
James Turner
e2ed179f4c Temporarily log out UI languages on launcher start
This is to help with diagnosing:
https://sourceforge.net/p/flightgear/codetickets/2121/
2019-04-17 15:11:23 +01:00
Florent Rougon
b405bd47d0 Use the system CppUnit only when -DSYSTEM_CPPUNIT=ON is passed to CMake
According to the discussion around [1], using the system CppUnit library
is rarely useful but likely to cause problems (due to possible
incompatibilities between versions); that is, unless people doing so
really know what they are doing. For this reason, this commit changes
the CMake config logic as follows: the system CppUnit library is now
only used when explicitly asked for with -DSYSTEM_CPPUNIT=ON on the
CMake command line.

[1] https://sourceforge.net/p/flightgear/mailman/message/36636483/
2019-04-11 22:14:53 +02:00
James Turner
4e8e69b4f8 Migrate invert-mouse-wheel setting from pre 2019.x
Flip the sense of this property, since the interpretation in SG is
also flipped now.
2019-04-11 20:40:17 +01:00
James Turner
4d562e2a90 Check existence of an OpenGL extension 2019-04-11 11:36:22 +01:00
Lars Toenning
85acefab95 Swift: initial support 2019-04-11 11:36:22 +01:00
Richard Harrison
8e1e6c8254 AI Traffic - better integration with terrasync.
- allow on demand update

new property traffic-manager/active indicating that AI Traffic is running
2019-04-07 09:00:01 +02:00
Stuart Buchanan
ff12994554 Execute load/unload Nasal for both detailed and AI
Previously only the first of a detailed/bare AI model tuple's Nasal
would be executed when the model is loaded.  This loads both.
2019-04-06 22:22:02 +01:00
Bertrand Coconnier
f011d5f567 JSBSim bug fixes
- Fixed the scripts end time computation
- Fixed nested tests in switches
- Simplifications to the computation of the aerodynamics angles alpha & beta
- Account for the contact transition in the gear compression speed
- Fixed docs in FGTank
2019-04-06 23:09:36 +02:00
Florent Rougon
2720d9fd9f Minor improvements to loading of nav.dat files
- simgear::strutils::readNonNegativeInt<unsigned int>() is better than
  std::stoul() at detecting and reporting erroneous input (for one, it
  checks that the given string *represents* an integer that fits in the
  specified type, as opposed to just "starts with digits").

- The format version is now an unsigned int (just because it's largely
  enough and simgear::strutils::readNonNegativeInt<unsigned long, 10>()
  isn't instantiated for now).

- The format version is now printed to the log (it was already for
  apt.dat files, but not for nav.dat files).
2019-03-28 07:44:59 +01:00
Florent Rougon
378999dd80 Improve parsing of apt.dat header
Properly report errors in the line that is supposed to contain the
format version of an apt.dat file.
2019-03-27 08:31:09 +01:00
Florent Rougon
8fbbf91270 Prevent a segfault when parsing malformed nav.dat files
Instead of doing an illegal memory access (to fields[0]), properly
report the problem when the line that is supposed to contain the format
version of a nav.dat file is empty.
2019-03-27 07:57:24 +01:00
Richard Harrison
f014e8825d FGComm: added listener for comm volume
Without this listen volume only changed on comm retune / PTT release
2019-03-27 00:28:20 +01:00
James Turner
64eaf6fe03 Fix for route-path when leg 0 is not a runway
Avoid doing turn-computation for the first waypoint, even if it’s not
a runway. Add a unit-test to cover this case.

Reported by Josh Davidson
2019-03-26 22:50:46 +01:00
James Turner
7c2a5e9e99 FlightGear support for queued commands
This enables queued commands to be processed once per main event loop.
At present this is done after subsystem updates.
2019-03-24 17:59:23 +00:00
James Turner
6860627dea Tweaks to launcher diagrams, to debug parking clicks
Adding some info/qInfo log output, to try and diagnose missed clicks
reported by some users.
2019-03-23 14:46:03 +00:00
Richard Harrison
8db784bf17 FGcomm: PTT usage and volume
- PTT will now use whatever channel is selected; non zero simply means PTT active.
- The volume as set in the comm[]/radio will now be used as a factor on the FGComm volume
2019-03-21 17:56:59 +01:00
James Turner
669a80216d Launcher: fix aircraft switching on update
Remove some obsolete code which caused the current aircraft to get
switched unexpectedley when updating
2019-03-20 17:09:12 +00:00
Richard Harrison
b9dc64ab87 FGComm; logic change to disconnect comm when selected channel set to 0.
It will be reconnected if PTT is set; and not disconnected until selected channel is again set to 0.
2019-03-20 15:13:11 +01:00
Richard Harrison
b42969ae91 Add support for FGCom multiple radio support
PTT now uses an int channel number (0 means not pressed, 1 = comm radio 1 (index [0]),etc...)

/comm-radio-selected is the default comm channel to use. This should usually be the same as will be set by PTT into /controls/radios/comm-ptt

However PTT will switch the FG comm inbound and outbound frequency to whichever radio was PTT'd.

New properties also set in multi-player to indicate the transmission frequency and normalised power (currently just set to 1.0)

13001(int)        : sim/multiplay/comm-transmit-frequency-hz
13002(short-norm) : sim/multiplay/comm-transmit-power-norm
2019-03-19 21:20:17 +01:00
Richard Harrison
a9761bb3ba Use simgear::strutils::replace instead of regex for compatibility. 2019-03-17 18:22:04 +01:00
Richard Harrison
c686f61817 Configurable METAR url
Use environment/realwx/metar-url if present; otherwise default to hardcoded value.

format: https://tgftp.nws.noaa.gov/data/observations/metar/stations/[station].TXT

i.e. [station] is replaced with the required station.
2019-03-17 00:45:31 +01:00
Torsten Dreyer
f007dd3ea1 new version: 2019.2.0 2019-03-13 21:20:53 +01:00
Torsten Dreyer
bff6f230f1 new version: 2019.1.1 2019-03-13 21:20:52 +01:00
Richard Harrison
a81607049f Merge /u/fgarlin/flightgear-src/ branch next into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/153/
2019-03-07 15:23:30 +00:00
James Turner
d5ce11ce55 Merge /u/dancliff/flightgear/ branch launcher_addons_merge into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/151/
2019-03-04 15:20:44 +00:00
Dan Wickstrom
1e858767b1 Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox. Fixes also submitted by Florent Rougon. 2019-03-03 12:59:48 -05:00
James Turner
1183d282ae Avoid copying SGShared<FGTaxiNode> in ground-net
This makes some common iterations in the AI traffic code faster,
since there is no thrashing of the atomic operations.
2019-03-03 12:12:03 +00:00