1
0
Fork 0
Commit graph

5579 commits

Author SHA1 Message Date
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
curt
ec50bcfb5a Roy Ovesen:
I've added some features to the PID controller:

Ability to set desired sampling interval in seconds. Use <Ts> under <config>
to set the desired sampling interval of the PID controller.

Example:
<config>
     <Ts>0.1</Ts>        <!-- desired sampling interval -->
     <Kp>-0.05</Kp>        <!-- proportional gain -->
     <beta>1.0</beta>    <!-- input value weighing factor -->
     ...
     ...
</config>

Ts defaults to 0.0, so if you don't set it it samples at the highest possible
frequency.


Add an offset to the input variables (input and reference).
Example:
    <reference>
      <prop>/controls/flight/elevator</prop>
      <scale>-1.5</scale>
      <offset>1.0</offset>
    </reference>

Note that <scale> has higher precedence than <offset>, regardless of the order
that they appear in the config file.
2005-02-01 21:00:24 +00:00
ehofman
5a5b67bab1 Melchior FRANZ:
Yesterday night it occurred to me that the current handling of missing METAR
strings isn't good enough:

- in case of missing METAR strings, don't re-send the last successful string,
  but the last successful string sent to *this* client. (If one client is
  running in virtual December, it won't be happy about dropped in summer
  weather.)

- fix a bug that allowed -vc notation (options -v and -c), but broke a lot of
  other notations (-b/var/tmp). Only -v can now be accumulated again, as
  in -vvvv.
2005-01-31 18:18:25 +00:00
ehofman
964349e401 Andrew Midson:
I have made the
'Select Airport from List' option in FlightGear work
(I think) properly. I have some concerns about the
solution, which could be broken by changes to plib (if
they re-use the value I have assigned to
PUCLASS_LIST), but for the moment it seems to work OK.

Erik Hofman:
A request has been sent to John Fay to include the puList
code in the puAux subdirectory of plib so expect some
changes for future version of FlightGear.
2005-01-31 10:36:59 +00:00
ehofman
394fe84351 Put the code at the proper place. 2005-01-29 13:12:34 +00:00
ehofman
9c743fc4c9 Geoff Air:
RE: --aircraft=ufo in system.fgfsrc is ignored

To change a 'feature', one that has been mentioned here many
times, and again recently, place the following code block
into fgInitFGAircraft.

In its favour, I would argue this means FG can be run without
a command line, provided FG_ROOT has been set in the
environment, and that seems to me, as it should be ... ;=))

Perhaps the only counter, is that system.fgfsrc is read twice,
but so are others, like .fgfsrc, for other (local) options ...
or system.fgfsrc should .nt. be used for 'aircraft' ?
2005-01-29 10:22:44 +00:00
ehofman
4ffb6c0fe9 Melchior FRANZ:
Here's a Perl implementation of a METAR proxy server. Tested on Linux only, but
should work on all Unices, and possibly on Windows, too. Its purpose is to:

- provide METAR data for machines without internet connection
- centralize METAR fetching: one machine in a network runs the proxy, all
  other connect to the proxy
- deliver defined and reproducible weather for educational purposes
- save weather situations for later use in fgfs

Quick instructions to download the world weather for the last 3 hours
and run proxy and fgfs with it (~ 2MB download; for less bandwidth
consumption see the --record mode):

  $ metarproxy --download 3h
  $ metarproxy -v -c &
  $ fgfs --proxy=localhost:5509 --time-offset=-2 --enable-real-weather-fetch
2005-01-29 09:45:12 +00:00
ehofman
ded8b8f34e Cosmetic updates. 2005-01-27 10:58:05 +00:00
ehofman
031f062686 Melchior FRANZ:
Here's again one of the more obscure bugs that valgrind complains about: somehow
the STL container classes manage to read out values before they were ever set.
This patch fixes that. This may not cause any harm in this case, but valgrind
seems to *always* be right about them.
2005-01-27 10:49:58 +00:00
andy
671bffe9af Constant-speed props were seeking to engine speed, not prop speed. 2005-01-26 18:30:45 +00:00
ehofman
73541395cc Remove another unneeded dependency. 2005-01-24 12:17:39 +00:00
ehofman
91cb15d9b0 Martin Spott:
Remove all dependencies of plib's SL sound library.
2005-01-24 10:17:14 +00:00
curt
453e3963d9 Updated to handle scenery files with a .tgz extension. 2005-01-21 23:23:29 +00:00
daveluff
e2a170c7d4 Emergency fix for AI model loading - non existance of the piper model as in the latest base package crashes the program - add exception handler during load. Needs to be replaced with better AI aircraft loading logic at some point 2005-01-21 15:50:29 +00:00
curt
8191d6b00e Fix my contact info. 2005-01-21 01:59:30 +00:00
ehofman
4d8da078a4 Roy Vegard Ovesen:
I guess it is much more efficient to compare integers than comparing long strings like "double-exponential" every frame.
2005-01-20 09:55:47 +00:00
ehofman
33b6694311 Melchior FRANZ:
The following patches to SimGear & FlightGear ...

- create an FGMetar abstraction layer, whose purpose is:
  * provide defaults for unset values
  * interpolate/randomize data (GREATER_THAN)
  * derive additional values (time, age, snow cover)
  * consider minimum identifier (CAVOK, mil. color codes)
- add rain/hail/snow/snowcover support on the METAR side
- add max age of METAR data handling (currently set to
- add support for an external METAR cache proxy server
- add CAVOK handling
- set missing year/month in regular METAR messages
- fix a small bug in metar.cxx (wrong return value)
2005-01-20 09:28:45 +00:00
ehofman
a3691ac013 Use the proper include definition. 2005-01-20 09:22:38 +00:00
ehofman
f4dd36901e MAcOS X fix. 2005-01-20 08:42:53 +00:00
curt
4bbe855da8 Initial revision. 2005-01-19 22:52:34 +00:00