1
0
Fork 0
Commit graph

5648 commits

Author SHA1 Message Date
andy
a40cab8321 Oops, stray line in the checkin. I'm sure fenv.h would have broken on
at least one system...
2005-04-08 20:55:02 +00:00
andy
7eb194b3f8 Export "rollspeed-ms" and "caster-angle-deg" properties for gear
objects.  Josh Babcock wanted these for the B-29 model so he can
properly animate the gear.
2005-04-08 20:46:43 +00:00
ehofman
d28e99d913 Melchior FRANZ:
Make SDL window resizable; This exposes the same problem that many
GLUT users have: resizing up may cause a temporary switch to software
rendering if the card is low on memory. Resizing down again switches
back to HW rendering. (KSFO is texture intensive, but there are no
problems in LOWL, and elsewhere.) Less and less users will have the
problem as cards become better, and it's no reason not to allow
resizing altogether.
2005-04-06 08:46:39 +00:00
ehofman
28fe28ec4f Melchior FRANZ:
_course_deg is first initialized in the if()-branch (gps.cxx:419). But
this branch isn't entered at first run if wp0==wp1, so that in line 615
fgfs tries to SG_NORMALIZE_RANGE() a random value, which can take a
long while if the number huge. This was occasionally a number greater
than 10160!

- initialize all vars before they are used (fixes endless loop)
- fix some compiler warnings (initialization order, unused vars)
2005-04-06 08:24:30 +00:00
ehofman
d3bdc4e7bc Melchior FRANZ:
FGAIMgr::GenerateSimpleAirportTraffic() tries to determine the airport's local
hour from the /sim/time/gmt-time string, which fails, because at this time the
property is still empty. That's why I don't get ATIS at LOWG (where it is *not*
midnight right now.  :-)    -> use sg's get_cur_time() instead
2005-03-31 17:00:27 +00:00
ehofman
d461e7868f Melchior FRANZ:
- don't treat *every* child in the xml as submodel, especially not a "param"
  block
- do not only *enable* the contrail flag above some altitude, but also
  disable it below
2005-03-31 08:54:04 +00:00
ehofman
f43b011ee3 Cygwin (windows) fix. 2005-03-31 08:41:41 +00:00
ehofman
019a7a186b Melchior FRANZ:
showDialog() is careful not to create a new FGDialog() if a dialog with the
same name is already open (active). But at this point it is already too late:
newDialog(), which was called shortly before, has already overwritten the
dialog properties. This leads to animated garbage in the best case, and a
segfault in format_callback() in the worst case.

- GUI::newDialog(): Don't you overwrite properties of an active dialog!
- GUI::readDir(): You may do that, but delete the old dialog first!
  (necessary for reloading the GUI)

- FGDialog::makeObject(): only set format_callback() with setRenderCallback()
  if the property is "live". Otherwise, only call it once at construction
  time. This isn't only a performance improvement. Without this the label
  was growing until it hit the limit (256).
2005-03-29 08:35:13 +00:00
ehofman
71dd0f8f96 Melchior FRANZ:
The previous message wasn't totally correct. Strings are now allowed, too. And
the pattern is now '[ -+#]?\d*(\.\d*)?l?[fs]' and *may* be embedded in a string.
There may only be one %s or %f, though. %% is allowed in the preamble/postamble.
(Yes, %ls is allowed, too, and treated as %s.)

Also, "end" is superfluous now.
2005-03-26 10:45:00 +00:00
ehofman
db989269b8 Melchior FRANZ:
Printing floats in dialogs with 8 digits after the comma is inappropriate
for most cases.

- implement a "format" property for "text" gui elements (a.k.a. pui label).
  Number formats are set by strtod/snprintf, while formats on non-numbers
  are replaced by "%s". Practical example in the upcoming material.nas update.
  Valid formats regex:  '%[ -]?\d*(\.\d*)?l?f' (IOW: the format must begin
  with '%' and end with 'f').

  # Nasal:
  number = dialog.addChild("text");
  number.set("label", "3.1415926");
  number.set("format", "%.3f");
2005-03-26 10:09:34 +00:00
ehofman
a488ab4d31 MipsPRO needs -c99 for int16_t types. 2005-03-26 10:08:32 +00:00
curt
babb51ba02 Update nasal function name. 2005-03-25 01:37:58 +00:00
curt
f55f96c44a Use standard length types (stdint.h where available) to make the FGNetCTRLS,
FGNetFDM, and FGNetGUI structures more cross platform/architecture portable.
2005-03-24 19:56:57 +00:00
ehofman
4b116a1196 Melchior FRANZ:
The dialog handling has been written at a time when only one dialog was
shown at the same time, and dialogs were shallow -- with only children, but
no grand-children. This makes finding a draggable spot on modern, dialogs
with nested objects quite a challenge. The patches fixes this, and other things:

- check full object tree on button press, not only the outmost layer;
  and don't give up just because we are in *something* (which could well be
  something harmless, like a group); only ignore a few, sensible objects
  (we don't want to drag after a click on a button or into an input field)

- don't lose dialogs as easily when dragging too fast (it does still happen
  if one manages to enter an editable field while dragging, but this is
  a plib problem and I don't feel like fixing that now  :-)

- don't "live"-update input fields while they are in edit mode

- remove some "if (foo) delete foo;" redundancy
2005-03-24 13:41:43 +00:00
andy
c89e5203a5 Insert a sanity hack from Melchior that apparently prevents a NaN from
popping up and crashing when the B-29 model is in use.  This isn't the
right solution; we should fine the NaN condition.  But it's harmless
and allows development with the B-29 to continue.
2005-03-23 18:54:58 +00:00
andy
e4142d94d4 I fixed the gear-ratio handling in the solution computations a while
back, but forgot to put the same fix into the runtime code.  Also
added some comments so I don't get confused again the next time I come
through here. :)
2005-03-22 18:17:08 +00:00
ehofman
50bdf6098a Mathias Frhlich:
I have done some cleanup where I moved some values out of classes where they
do not belong and such stuff.
Also the fols offsets are now named in the carrier xml file with a more
verbose name (flols-pos/offset-*) than before (only offset-*).
There is a little preparation for definitions of parking positions on the
carrier which should later be used for starting flightgear directly on the
carrier.
2005-03-19 09:57:18 +00:00
curt
ecfaa79b9e Permit a single nasal module to reference any number of files which are all
loaded into that single nasal name space.
2005-03-16 21:36:55 +00:00
curt
ebfaccd95b Add support for "offset" tag ... (value = raw * factor + offset) 2005-03-10 19:06:30 +00:00
curt
2e308fe928 Updated hybrid of original busy-wait frame rate throttling loop combined with
a safe undersleep() to conserve cpu.  Essentially we undersleep our target by
just a bit (to avoid the chance of oversleeping.)  Then we finish off the
remaining time slice with a busy-wait loop.
2005-03-09 21:56:00 +00:00
ehofman
d1168b493a Frederic Bouvier:
Norman Vine wrote :

> Frederic Bouvier writes:
>
>> Quoting Andy Ross:
>>> * Hopefully in a CPU-friendly way.  I know that older versions of
>>>  the NVidia drivers did this by spinning in a polling loop
>>>  inside the driver.  I'm not sure if this has been fixed or not.
>>>
>>> From my experience, the latest non-beta Windows NVidia driver seems to eat CPU
>>
>> even with sync to vblank enabled. The CPU usage is always 100%.
>
> Buried in the PPE sources is a 'hackish' but portable way to limit CPU usage if the desired framerate is met
>
>  /*
>    Frame Rate Limiter.
>
>    This prevents any one 3D window from updating faster than
>    about 60Hz.  This saves a ton of CPU time on fast machines.
>
>    ! I THINK I MUNGED THE VALUE FOR ulMilliSecondSleep() NHV !
>  */
>
>  static ulClock *ck = NULL ;
>
>  if ( frame_rate_limiter )
>  {
>     if ( ck == NULL )
>     {
>       ck = new ulClock ;
>       ck -> update () ;
>     }
>
>     int t_ms = (int) ( ck->getDeltaTime() * 1000.0 ) ; /* Convert to ms */
>
>     if ( t_ms < 16 )
>       ulMilliSecondSleep ( 16 - t_ms ) ;
>  }
>
>

I implemented the method pointed out by Norman. It works great on windows and saves me a lot of CPU cycles. This way, I can get the same framerate in moderately populated areas and have CPU idle 50% of the time instead of wildly looping in the NVidia driver while waiting to sync on vblank.

It has been tested on Linux by Melchior. He saw the same gain in CPU cycles.
2005-03-09 15:12:01 +00:00
ehofman
c1f250fd33 IRIX fixes. 2005-03-08 19:47:51 +00:00
ehofman
811591734e IRIX fix. 2005-03-08 18:05:24 +00:00
curt
fa2a9854a4 Revert last change. 2005-03-03 23:33:29 +00:00
curt
85509fff03 Change fuel selector data type from bool to int. 2005-03-03 23:14:57 +00:00
curt
076aa3b402 Fix a small oops. 2005-03-03 18:25:25 +00:00
curt
61ed285d06 Add support for a simple deadband. 2005-03-03 18:22:48 +00:00
curt
c6c094034c Add support for drawing only a portion of the configured view frustum. This
is one way to get an asymmetric view frustum without needing to compute the
sgFrustum parameters directly.
2005-02-25 22:27:15 +00:00
curt
5accfdeb90 Currently, aspect ratio is computed directly from the window dimensions.
I have added a --aspect-ratio-multiplier=x.xx option to give some end user
control over the aspect ratio.  (This may seem a little strange, but it's a
building block towards the capability of doing asymmetric view frustums in
FlightGear.)
2005-02-25 21:20:17 +00:00
curt
7c43f5c924 Oops, committed some code that should *not* be in the default. 2005-02-25 19:47:40 +00:00
curt
40170cb722 The view frustum is defined in plib apps using calls to ssgSetFOV() and
ssgSetNearFar().  This by default creates a symmetric view frustum which is
typically what an application wants.

However, to get control of the view frustum in order to build support for
asymmetric view frustums, we need to wrap these calls with a bit of our own
logic.

This set of changes wraps all calls to ssgSetFOV() and ssgSetNearFar() with
FGRenderer methods.

I also standardized how the FGRenderer class is handled in globals.[ch]xx.
This led to some cascading changes in a variety of source files.

As I was working my way through the changes, I fixed a few warnings along
the way.
2005-02-25 19:41:53 +00:00
ehofman
7cc58da6a9 Vivian Meazza:
I attach the long-promised improved version of the USS Nimitz.

It includes an improved version of the FLOLS, which requires the attached
diff to be applied to AICarrier.cxx and AICArrier.hxx.

I've made lots of eye-candy in the form or the flightdeck crew.
Unfortunately, it about doubles the size of the tarball. I'll send it to you
later; when I've figured out some way of only loading on request (any advice
would be very welcome).

I could provide a \u2018bare\u2019 version to cut down on the vertex count for
less capable systems however, the count isn\u2019t huge in the first place.
I've cut the textures down as far as I can without losing definition.
2005-02-24 15:05:56 +00:00
ehofman
743379925e update paths. 2005-02-22 18:56:13 +00:00
ehofman
ba13669d32 Add the ability to set the minimum allowed age for metar reports. 2005-02-22 18:12:32 +00:00
ehofman
2a8f368072 yet another Cygwin fix. 2005-02-18 17:42:46 +00:00
ehofman
1a93ac450a Another Cygwin fix. 2005-02-18 14:17:03 +00:00
ehofman
d871ca845f Cygwin fixes. 2005-02-18 12:40:38 +00:00
ehofman
02a757f9e6 MSVC (warning) fixes. 2005-02-18 10:16:30 +00:00
ehofman
b5bfbcf706 Add the missing carrier files. 2005-02-17 10:37:26 +00:00
ehofman
c2e688244d Mathias Frohlich: Add carrier capabilities for YASim aircraft. 2005-02-17 10:26:14 +00:00
ehofman
950ceb02f4 automake 1.8+ fixes 2005-02-15 18:16:18 +00:00
curt
4ec654d043 Add support for aileron and rudder trim. 2005-02-15 18:11:48 +00:00
curt
9d8b687fc5 Add support for aileron and rudder trims. 2005-02-15 18:11:03 +00:00
curt
cdfb43f94d Tweak ... 2005-02-15 18:09:52 +00:00
curt
bf4aa941be Add an "additive-switch" type. 2005-02-15 18:09:20 +00:00
curt
5783208d9d Fix a "signededness" error. 2005-02-15 18:07:06 +00:00
ehofman
73fb59a7dd MacOS X fix(?) 2005-02-11 15:12:30 +00:00
ehofman
5bc15d7a69 Durk Talsma:
I just heard from John Wojnaroski that you and he are going to work on getting
a flightgear demo machine up for the linux expo thursday and Friday. John
indicated that he would very much like to get a CVS version with the new
traffic code up and running before the expo.
2005-02-10 09:01:51 +00:00
daveluff
03f0ac8519 Minor fix 2005-02-02 19:16:51 +00:00
ehofman
a7ee9554e7 Make sure snprintf can be found 2005-02-02 08:47:33 +00:00