1
0
Fork 0
Commit graph

416 commits

Author SHA1 Message Date
curt
d05121ef46 Fix my mailing address by replacing it with my web page. 2004-11-19 22:10:41 +00:00
ehofman
7f6466d6f1 Frederic Bouvier:
This is a patch to make display list usage optional. They are on by default.
Use --prop:/sim/rendering/use-display-list=false to use immediate mode.
There is also a change in exception handling in main.cxx and bootstrap.cxx
2004-10-17 17:23:19 +00:00
ehofman
c0c394c188 PLIB_VERSION is localted in plib/ul.h 2004-10-10 19:19:23 +00:00
ehofman
b7afe856c3 Check for the plib version when using display lists, just to be sure. 2004-10-10 19:06:32 +00:00
ehofman
f61014c2ea Frederic: Add display list support without changing plib. 2004-10-10 17:41:11 +00:00
ehofman
986492d72d Finish what was committed in a broken state yesterday.
Split up main.cxx into a program manegement part (which remains in
main.cxx) and a render part (the new renderer.?xx files). Also turn
the renderer into a small class of it's own. At this time not really
exctining because most of the stuff is still global, but it allows us
to slowly migrate some of the global definitions into the new class.

The FGRenderer class is now managed by globals, so to get the renderer
just call gloabals->get_renderer()

At some pijt it might be a good idea to also turn the remaining code in
main into a class of it's own. With a bit of luck we end up with a more
robust, and better maintainable code.
2004-09-20 13:21:51 +00:00
ehofman
3b3600fd21 Make it compile, link and run again (pfew\!) 2004-09-19 18:34:47 +00:00
ehofman
de47d1a7d8 Revert to CVS as of 5000 seconds ago. 2004-09-19 17:59:40 +00:00
ehofman
409dee5a9d Remove unnecessary inclusions of sg.h ans ssg.h 2004-09-19 16:33:38 +00:00
curt
cc3d0221ea Make a subtle change to tile loading/unloading policy in order to make the tile
paging system much more robust when position change is very rapid and sporadic.

Recall that we must load 3d models in the main render thread because model
loading can trigger opengl calls (i.e. with texture loading) and all opengl
calls *must* happen in the main render thread.

To accomplish this we load the base tile in the pager thread and build a work
queue of external models that need to be loaded.  We never allow a tile to be
paged out of the tile cache until all it's pending model loads are complete.

However, when changing position very rapidly, we can quickly create a huge
backlog of pending model loads because we are changing positions faster than we
can load the associated models for the existing tiles.  The end result is
that tiles that are long out of range can't be removed because there is still
a huge backlog of pending model load requests and memory blows up.

This change being committed allows the tile paging system to remove tiles
if they are out of range, even when there are pending models to load.  The
model loading code in the render thread can now check to see if the tile
exists and discard any model load request for tiles that no longer exist.

This situation should never occur in normal operation, but could occur in
"contrived" situations where an external script was rapidly changing
the simulator position to then be able to query FG terrain height, and doing
this for a large number of points that are distributed across a large area.
2004-09-15 15:52:05 +00:00
ehofman
9d972d86bf Jim Wilson: This patch prevents FDM execution until intial scenery load completes making
midair starts in the KSFO area possible again.
2004-07-22 16:42:14 +00:00
ehofman
56f085b6f1 Melchior FRANZ:
Remove an unused test, counter_hack is initialized to 0 and the test never reaches the increment section but instead will always call loader.update();
2004-06-13 18:47:55 +00:00
ehofman
ff9258528c Melchior FRANZ:
Wouldn't it be better to prepare the whole list of paths (or two
separate ones for Terrain/Objects if necessary) in FGGlobals::set_fg_scenery,
and to pass the vector<string>s to FGTileEntry::load? It doesn't seem to make
a lot of sense to split the path up, modify it, mount it together to one string
again, and then let FGTileEntry::load split it up again.

Here we go:

Main/globals.cxx
================
As fg_scenery is now a string_list, we don't need initialization. Furthermore,
this list is cleared with every set_fg_scenery() call.

ctor: create default dir from fg_root if necessary. Otherwise check all paths
of --fg-scenery/FG_SCENERY: If the path doesn't exist, ignore it. If it contains
a dir Terrain and/or Objects, then only add that to the list. If it contains
neither, then use the path as is.


Scenery/tileentry.cxx
=====================
Trivial: don't split a "base path", but use the given path_list as is.
(I considered a variable name "path_list" better suited than "search".)


Scenery/FGTileLoader.cxx
========================
No more fiddling with sub-paths. This has to be delivered by get_fg_scenery
already.
2004-06-08 15:32:09 +00:00
ehofman
079890e955 Make use of the new SGPath::add() function and automatically append 'Terren' and 'Objects' the the scenery path when one or both of those subdirectories exsist. 2004-06-07 09:52:11 +00:00
ehofman
1bdcbd69f3 Windows uses ';' instead of ':' as a path separator. 2004-06-06 19:34:31 +00:00
ehofman
372920236f Make it possible to split the Scenery into Scenery/Terrain and Scenery/Objects in preparation for the next scenery release. 2004-06-06 19:15:04 +00:00
andy
7ceb85d454 Changes to get FlightGear (well, the src directory at least) to
configure and compile out-of-the-box on a MinGW target:

Use -lSDL instead of -lglut32 on windows builds when --enable-sdl
is set.

Link against alut.dll in addition to openal32.dll.

Replace BSD bcopy() with ANSI C memmove() in a few places.  This is
simpler than trying to abstract it out as a platform dependency in a
header file; bcopy() has never been standard.

The ENABLE_THREADS handling has changed to be set to 0 when threads
are not in use.  This breaks expressions like #ifdef ENABLE_THREADS.
Replace with a slightly more complicated expression.  It might have
been better to fix the configure.ac script, but I didn't know how and
this whole setting is likely to go away soon anyway.

The MinGW C runtime actually does include snprintf, so only MSVC
builds (and not all WIN32 ones) need _snprintf in JSBSim/FGState.cpp

Building on a platform with no glut at all exposed some spots where
plib/pu.h was being included without a toolkit setting (it defaults to
glut).  Include fg_os.hxx first.

And when still using glut, glut.h has a bizarre dependency on a
_WCHAR_T_DEFINED symbol.  It it's not defined, it tries to redefine
(!!) wchar_t to disasterous effect.
2004-04-30 00:52:11 +00:00
ehofman
7902c04905 Plib is willing callbacks to return 0, 1 or 2 and not simply a boolean 2004-04-02 19:49:51 +00:00
ehofman
b34f0711c4 Frederic Bouvier:
Add a static function that will be installed as a callback to
  cull or not the terrain leaves in tiles.
  Add a function to set the filter.
2004-04-02 14:42:42 +00:00
ehofman
c98daef926 Frederic Bouvier:
Add a pretrav callback to the first kid of geometry that should
  be the terrain_branch. The callback is a static function in
  FGTileMgr
2004-04-02 14:42:03 +00:00
curt
2acdd02879 Clean up various compiler warnings that have crept into the code. This
by no means get's them all, but it's a start.
2004-04-01 15:27:53 +00:00
ehofman
cf96deac29 Frederic Bouvier:
The message 'Alert: catching up on tile delete queue'
comes from the fact that 48 tiles are scheduled and
added to the cache at startup before the plane location
is initialized. My proposed patch is to initialize
SGLocation with an invalid position and detect this
fact before scheduling tiles. I prefer to do that
rather than testing for lon and lat being 0,0 because
it is a valid position and someone could want to fly
near Accra.
2004-03-20 22:42:41 +00:00
curt
a1a68b9c93 Various preparations for the next release. 2004-03-18 02:37:01 +00:00
curt
72f2c5c4f4 Fix a type ... 2004-01-26 22:44:27 +00:00
curt
492d5fbd8d Fix a small mistake in the scene graph arrangement for vasi lights. 2004-01-11 19:45:29 +00:00
curt
461baef128 Add a small optimization to reduce the amount of vasi computation that is
done every frame.
2003-12-30 15:12:04 +00:00
curt
a80b033104 Smarter vasi/papi coloring. 2003-12-30 07:04:40 +00:00
curt
3d7f467c61 First stab at correct vasi/papi coloring. This is still rough and doesn't
account for variation in lighting alignment, but it's more useful than the
previous attempt which was based on a misunderstanding of how environment
mapping worked.
2003-12-30 05:57:25 +00:00
andy
439a9fa1e4 Minor API changes to support the new sg_geodesy implementation. A few
places now use sgCartToGeod() instead of rolling their own
approximation.  And YASim is now using exactly the same 3D coordinate
system as the rest of FlightGear is.
2003-12-19 02:42:32 +00:00
curt
071a3d99b9 The code to find the highest hit below you didn't work quite right when
reinitializing at a new location.  This should fix the problem.
2003-11-25 01:08:39 +00:00
david
e95e9bbf4e Oops -- checked in last version with a small typo. 2003-11-24 18:00:48 +00:00
david
d296e5a7df Use proper logging facility, and lower the priority of some of the
logging messages.  This is part of an effort to make FlightGear a bit
quieter during normal operations.
2003-11-24 17:45:35 +00:00
curt
a62e09d72b Comment out timing calls, but leave them there for future timing experiments. 2003-11-24 01:47:09 +00:00
ehofman
4626ff428d Make sure SGTimeStamp is found 2003-11-22 12:03:10 +00:00
curt
f6fad7f000 Tweaks and massages to the ground intersection code. Most of the changes
are cosmetic, but we now have a combination of code that seems to work
very robustly.  I was able to land the yf23 at about 130 kts on the lower
level of the bay bridge and then taxi the entire length.
2003-11-21 22:00:46 +00:00
curt
ca6067cbc0 With this patch, you can fly under bridges, then turn around and land on
them lengthwise.
2003-11-21 04:41:01 +00:00
curt
0f1c24bbed Fix a terrain intersection calculating bug. The code wasn't quite handling
traingle strips right ... it was mixing up the vertex ordering slightly.
Oh what the heck, it was really screwing up tristrips.  Everything else looks
correct though. :-)  Hurray for the red book.
2003-11-21 03:13:52 +00:00
david
03741a6936 Modified so that a multiple-element FG_SCENERY path will work:
1. Do not stop scanning STG files after OBJECT_BASE is found.

2. Load OBJECT_BASE only once.

3. Load OBJECT only when no OBJECT_BASE has been found or when
   OBJECT_BASE was found in the same file (probably should be only the
   latter, if we constrain OBJECT_BASE always to come first).

4. Always load OBJECT_STATIC and OBJECT_SHARED.
2003-10-01 22:49:06 +00:00
david
65177d27f5 Don't make SG_SCENERY into an SGPath before splitting, to avoid
normalizing ':' to '/'.
2003-10-01 22:38:53 +00:00
curt
905b48c55c Sort VASI lights into their own tree so we can control them separately
from the rest of the runway lighting.  VASI/PAPI lights are generally
always on.  Also, the red/white VASI coloring has never worked right.
This is also a step towards fixing that problem.
2003-09-24 19:59:25 +00:00
ehofman
980012e168 Move FGEventMgr and FGSubsystemMgr over to SimGear, add SGEventMgr to FlightGear's globals structre and some small code cleanups 2003-09-24 17:20:55 +00:00
ehofman
a33ad90ed7 Convert fgLIGHT to FGLight and make it FGSubsystem compatible. Let the subsystem manager handle it and let FGLight::update() handle the repositioning of the sun and the moon. 2003-09-20 09:38:32 +00:00
ehofman
7249aaea33 Frederic Bouvier:
This patch is there to correct a problem that prevent to load static objects when specifying a relative fg-root or a different, relative, fg-scenery. It appears that there is a mix between fg-root, fg-scenery and PLIB's model-dir.
It has been reported on the list that users are not able to see the buildings, especially those running the win32 builds because they run 'runfgfs.bat' that set FG_ROOT=./DATA.

I decided not to use model-dir because it just add confusion and to build a valid path earlier.
2003-09-13 11:47:30 +00:00
ehofman
1dea70fffa Use the glPointParameter function pointer rather than the function itself 2003-08-29 16:50:20 +00:00
ehofman
82ba3ebbde Remove a possible glut dependency and do some code cleaning 2003-08-29 16:46:21 +00:00
curt
b23183f018 Put the id of the tile we are flying over into the property tree for
convenience of debugging.
2003-08-28 20:52:34 +00:00
ehofman
c745a8f956 Add a comment on how to enable an alternative HOT algorithm that enables one to fly underneath static objects 2003-08-18 09:34:12 +00:00
curt
02b758c87b Oops, fix a typo. 2003-08-09 02:45:23 +00:00
curt
b206ef0a4b Add support for specifying a ";" delimited list of scenery locations to
search when loading scenery tiles.  (I am not set on using ";" as the
delimiter because it is a command separator in unix, but ":" is a critical
part of the windows file naming scheme (c:\foo\bar) so that is even worse.)

Example:

--fg-scenery=/stage/fgfs04/curt/Scenery-0.9.1/Scenery;/stage/helio1/curt/Scenery
-0.7.9
2003-08-08 20:11:22 +00:00
ehofman
f46bda0621 A bounding sphere may be empty, which is perfectly valid.
Such empty spheres have negative radius, but undefined center.
2003-06-04 09:57:11 +00:00
curt
b749638fd6 Move low level "tg" object loader code over to SimGear. 2003-05-28 21:01:55 +00:00
curt
56592f3869 Moved random ground cover object management code (userdata.[ch]xx) over
to SimGear.
2003-05-28 20:29:05 +00:00
curt
6200c3cb62 Changes to track updates to SimGear. 2003-05-15 21:35:51 +00:00
curt
9d16b308b1 Break a few more dependencies ... working towards being able to move
obj.[ch]xx over into simgear.
2003-05-14 20:48:31 +00:00
curt
df1cae3b65 Did some renaming of new simgear code. 2003-05-14 19:32:10 +00:00
curt
8dcf08c965 Moved some of the low level scene graph construction code over to simgear. 2003-05-14 19:22:24 +00:00
curt
d6ae1c2205 Create an instance of SGMaterialLib in the "globals" structure and use
that.
2003-05-14 18:33:56 +00:00
curt
3c7bdc31d9 Cosmetic changes for new code moved into simgear to make the naming scheme
better follow simgear conventions.
2003-05-13 03:18:42 +00:00
curt
65c3caa032 Moved fgfs_src/Object/newmat.[ch]xx and fgfs_src/Object/matlib.[ch]xx into
simgear/scene/material/
Adjusted flightgear code to match this change.
2003-05-12 21:34:29 +00:00
curt
56db994994 Moved src/Model/loader.[ch]xx and src/Model/model.[ch]xx to
simgear/scene/model/
2003-05-09 20:40:59 +00:00
curt
677ec873be Clean up various dead, depricated, or otherwise unused code. I don't believe
the ascii scenery file format has actually worked in quite some time, and the
ADA runway light code has been supersceded by a slightly different mechanism.
2003-05-08 03:29:49 +00:00
curt
198b88ca9b This is step "1" of probably "many" in the process of separating out the
scene management code and organizing it within simgear.  My strategy is
to identify the code I want to move, and break it's direct flightgear
dependencies.  Then it will be free to move over into the simgear package.

- Moved some property specific code into simgear/props/
- Split out the condition code from fgfs/src/Main/fg_props and put it
  in it's own source file in simgear/props/
- Created a scene subdirectory for scenery, model, and material property
  related code.
- Moved location.[ch]xx into simgear/scene/model/
- The location and condition code had dependencies on flightgear's global
  state (all the globals-> stuff, the flightgear property tree, etc.)  SimGear
  code can't depend on it so that data has to be passed as parameters to the
  functions/methods/constructors.
- This need to pass data as function parameters had a dramatic cascading
  effect throughout the FlightGear code.
2003-05-06 23:54:17 +00:00
curt
f347d6d291 Removed support of old Ascii scenery format. The loader had not been
maintianed or upgraded in a *long* time so it didn't support many new
features like the runway lighting.  If anyone was using it for anything,
it should not be a huge amount of work to switch to the binary format.
SimGear includes a reader and writer for the binary format.
2003-05-06 14:20:30 +00:00
curt
2e90248df8 Make error message slightly more informative. 2003-03-21 20:39:59 +00:00
curt
53083bf9fb Another tilemgr fix from Jim W. 2003-02-11 15:50:53 +00:00
curt
0fe90a83dd Fix a bug in tile manager updating when switching from one view to the next. 2003-02-10 15:34:18 +00:00
curt
43e48070fe - Some refactoring of the configure.ac script.
- Better Mac OS X support (they put glut.h in GLUT/glut.h) :-(
2002-12-10 20:50:48 +00:00
curt
28243f40ca White space cleanups. 2002-12-07 02:26:50 +00:00
curt
1feedec8d1 - Change the global_tile_mgr to a globals->get_tile_mgr() which is
dynamically created at run time.
- Further clean ups to the FGTileMgr class interface.
2002-12-06 22:29:46 +00:00
curt
a6ce9a5b2a A small amount of additional massaging of tile manager update() interface. 2002-11-30 14:22:00 +00:00
curt
bcf9fa3695 Massaging the FGTileMgr->update() interface towards using FGLocation. 2002-11-30 03:05:34 +00:00
curt
95109cec57 Split out tile load/free queue processing into a separate routine. 2002-11-30 02:21:04 +00:00
curt
89874fd5f5 Make tile_mgr->prep_ssg_nodes() use an FGLocation object. 2002-11-28 01:08:25 +00:00
david
f2a5f98532 Patch from Jim Wilson:
That's a little too small to resolve differences at 16bpp. Try the
patch below.  It decreases the lifting substantially.  You will see
a slight increase in z-buffer flickering but it isn't bad.  Note
that we removed the "distance" component the other day,  the purpose
of it was to lift the lights higher when viewed at shallow viewing
angles.  The distance component is critical for the street lights that
can be very long distances away.

But with the distances we're working with here it really doesn't
do all that much.  The factor used in this patch is about as shallow
a lift as can be used when looking straight down at the airport.  At
24bpp there's no effect from incorporating a distance component.

The choice is to reintroduce a distance component...one that works (and
only for 16bpp), or alter the factor used in the patch below to strike an
acceptable balance between different viewing angles when in 16bpp mode.
2002-11-04 02:17:13 +00:00
curt
dbf997a2d3 Put taxiway lights in their own scene graph so we can adjust their brightness
(or fog punch through) independently from the ground or runway lighting.
2002-11-01 21:56:48 +00:00
curt
eb0c92f8ff Fix a couple oversights in the runway light lifting formula. 2002-10-30 22:56:22 +00:00
curt
94a36038d2 Remove distance component from runway lifting function. Only use the AGL
component.  This seems to work pretty well and simplifies things a fair bit.
2002-10-30 21:59:05 +00:00
curt
72017fc671 Andy Ross:
The biggest and coolest patch adds mouse sensitivity to the 3D
cockpits, so we can finally work the radios.  This ended up requiring
significant modifications outside of the 3D cockpit code.  Stuff folks
will want to look at:

+ The list of all "3D" cockpits is stored statically in the
   panelnode.cxx file.  This is clumsy, and won't migrate well to a
   multiple-aircraft feature.  Really, there should be a per-model list
   of 3D panels, but I couldn't find a clean place to put this.  The
   only handle you get back after parsing a model is a generic ssg
   node, to which I obviously can't add panel-specific methods.

+ The aircraft model is parsed *very* early in the initialization
   order.  Earlier, in fact, than the static list of allowable command
   bindings is built in fgInitCommands().  This is bad, as it means
   that mouse bindings on the instruments can't work yet.  I moved the
   call to fgInitCommands, but someone should look carefully to see
   that I picked the right place.  There's a lot of initialization
   code, and I got a little lost in there... :)

+ I added yet another "update" hook to the fgRenderFrame routine to
   hook the updates for the 3D panels.  This is only required for
   "mouse press delay", and it's a fairly clumsy mechanism based on
   frame rate instead of real time.  There appears to be delay handling
   already in place in the Input stuff, and there's a discussion going
   on about different mouse behavior right now.  Maybe this is a good
   time to unify these two (now three) approaches?
2002-10-29 19:44:03 +00:00
curt
786e58aa1a Removed some left over debugging output. 2002-10-24 12:12:14 +00:00
curt
d62b1a0a66 Fix a subtle bug in the partial ssg tree deleter which was leaving some
parts of the tree left over at the end which the failsafe was catching, but
this could impose a huge framerate hit if the missed portion of the tree
was large enough (and it very often was.)
2002-10-24 03:38:14 +00:00
curt
66e8d3fe65 Updates to how we structure runway lighting in the scene graph so we can get
the range selector to work on a per runway (or per lighting group) basis.
2002-10-22 20:47:14 +00:00
curt
7df3da668c Fix a bug in ground elevation measuring for the first frame after we cross
a tile boundary.  (Potentially imposes a slight performance penalty, but
getting the correct answer needs to be higher priority than getting the
wrong answer really quickly.)
2002-10-17 15:54:31 +00:00
curt
83314d3f45 Fix a potential crash with William Riley's scenery build. 2002-10-09 14:29:42 +00:00
curt
f54302e9e9 Begin work on improving runway lighting infrastructure. 2002-10-09 03:40:23 +00:00
curt
c162577340 Begin work on rendering runway lights using environment maps. The basics
are now working.  A runway light is defined by a point and a direction.  The
point and direction are combined with the local up vector to create a small
triangle orthogonal to the direction.  The two ficticous corners of the
triangle are given an alpha value of zero, the orignal corner is given an
alpha of one.  The triangle is drawn in glPolygonMode(GL_FRONT, GL_POINT)
mode which means only the corner points are drawn, and since two have alpha=0
only the original point is drawn.  This is a long way to go to draw a point,
but it ensures that the point is only visible within 90 degrees of the light
direction, behind the light it is not visible.  This is still a long way
to get to drawing a point, but we use an environement map, with the direction
vector as the normal to mimic a light that is brightest when viewed head
on and dimmest when viewed perpendicularly or disappears when viewed from
behind.

- warning, there is a bug in how the current runway light direction vector
  is calculated which will adversely effect runway lighting.  The airports
  should be regenerated in order to fix this problem.
2002-10-06 03:53:19 +00:00
david
5eef7d7ad1 Removed tabs. 2002-09-23 15:27:46 +00:00
curt
7b01068d9c Bernie Bright:
fgLoad3DModel() throws an exception if it fails to load the requested model.
This causes FGTileMgr::update(...) to exit.  So I've added a try/catch block
to catch the exception and display an error message instead.
2002-09-23 14:23:17 +00:00
david
c3a1a9335e Added OBJECT_SHARED, which is identical to OBJECT_STATIC except that
the object is loaded relative to $FG_ROOT rather than to the current
scenery directory.
2002-09-22 11:46:53 +00:00
curt
25c4d9b620 Minor tweaks to sound subsystem update rates. 2002-08-26 20:46:13 +00:00
curt
4f00d9a959 Tidy up the autoconf/automake configuration a bit.
- Removed some old cruft.

- Removed some support for older versions of automake which technically was
  correct, but caused the newer automakes to squawk warnings during an
  initial sanity check (which isn't done very intelligently.)

  NOTE: this fix is technically not correct for older version of automake.
  These older version use the variable "INCLUDES" internally and could have
  them already set to an important value.  That is why we were appending
  our values to them.  However, newer versions of automake don't set this
  value themselves so it is an error to append to a non-existant variable.
  We seem to "get away" with overwriting the value on older versions of
  automake, but if you have problems, consider upgrading to at least
  automake-1.5.
2002-08-25 19:40:04 +00:00
curt
4dac47f558 * Cleaned up some loose ends with free tiles that are paged out of the cache.
* Finally I think I have the partial ssg tree deletion routine working correctly
  after I managed to break it (and other confusion in the code cause it to
  never be called so I didn't notice the problem.)
* Converted several SG_INFO statements to SG_DEBUG to clean up some
  extraneous console output.
* This *should* conclude my investigation into a massive memory leak. :-)
2002-08-07 02:53:01 +00:00
david
0ebe8ec8f0 Removed the FG3DModel class and replaced it with fgLoad3DModel.
Animations are now contained within the scene graph itself and are
updated whenever the graph is traversed -- that saves time by not
updating animations not currently in sight, and it allows animations
to be used for static objects and random objects as well.

Added new FGModelLoader and FGTextureLoader classes.  These are intern
tables for models, to guarantee (mostly) that no model is loaded more
than once.  FGTextureLoader is not yet used anywhere, but
FGModelLoader is now in place everywhere that ssgLoad* used to be
used (thus adding the ability to use animations).

In the future, FGModelLoader will add some interesting functionality,
including the ability to reload 3D models on the fly.
2002-08-07 01:34:49 +00:00
curt
29d20b1703 Temporarily fix a crash and correctly free memory until I can sort out a
problem with the partial ssg tree freeing code.
2002-08-06 18:52:45 +00:00
curt
9885169964 Working on hunting down a really awful memory leak. This arose out of a
misunderstanding over which section of code would be freeing tiles.  This
patch cleans up several things, but a little more work is still needed.
2002-08-06 18:50:12 +00:00
curt
2619106044 Fix tile cache resizing bug (which could lead to thrashing.) 2002-08-01 06:15:59 +00:00
curt
b3c5a8fb95 Various tweaks, enhancements, and optimizations surrounding tile paging
(specifically freeing tiles when we need to remove them from the tile cache.)
2002-07-29 05:07:38 +00:00
curt
dc40db3b33 Modified the partial ssg tree deletion algorithm so it correctly preserves
subtrees that may be connected into the scene graph multiple times.
(i.e.  our random ground cover objects.)
2002-07-26 22:23:49 +00:00
curt
27158525a9 Restructure the way tile freeing is handled. When a tile is removed from
the tile cache it's ssg elements are disconnected from the main ssg scene
graph, and then the tile is thrown on the end of a delete queue.  The
tilemgr->update() routine runs every frame.  It looks at this queue and if
it is non-empty, it incrementally frees the compents of the first tile
on the queue.  When the tile is completely free it is removed from the queue.

The amount of time to free the memory for even a single tile can be quite
substantial, especially with the increased overhead of dynamic/random
ground objects.  This change allows the system to spread the work of freeing
tile memory out over many frames so you don't get a noticable single frame
hit or stutter.
2002-07-25 23:59:04 +00:00
curt
96d499f4f1 Restructuring how tiles are freed to allow us to eventually spread the task
out over multiple frames.
2002-07-25 21:57:58 +00:00
david
140f58b4ca Patch from Julian Foad:
Use defined constant instead of yet another approximation to pi.
2002-06-28 18:00:49 +00:00
curt
8ae364a220 Jim Wilson:
This is a small fix for what turned out to be a major bug.  Ground elevation
was calculated incorrectly when distant from one of the view locations. This
resulted in several problems including bizarre gear trimming, mid air
"crashes" (as in thinking we hit the ground) and so on when close to or on the
ground.

Unfortunately it does require a second ssg traversal when in tower view
(only), but the increased load isn't all that noticable.  For the time being
this really is the best solution.  In a future update I will be eliminating
the unecessary per frame traversals for the static views (without having to
maintain multiple ssgRoots).

When we go to multiple FDM instances we will perhaps need to put the ssg
traversal and ground elevation queries for the FDMs into an event timer that
updates the FDMs ground elevation in a round robin fashion (maybe every 1/n
seconds where n is the number of FDM instances running).
2002-05-20 16:13:37 +00:00
david
9002aa41ff Corrected "#ifdef 0" to "#if 0" to keep ANSI-conformant compilers
happy.
2002-05-17 18:56:13 +00:00
curt
b1674cb506 From: "Jim Wilson" <jimw@kelcomaine.com>
This is a new improved patch for the previous tile manager fixes.

Rather than building dependencies between FGlocation or the viewer or fdm with
tilemgr what I ended up doing was linking the pieces together in the Mainloop
in main.cxx.  You'll see what I mean...it's been commented fairly well.  More
than likely we should move that chunk somewhere...just not sure where yet.

The changes seem clean now. As I get more ideas there could be some further
improvement in organizing the update in tilemgr.  You'll note that I left an
override in there for the tilemgr::update() function to preserve earlier
functionality if someone needs it (e.g. usage independent of an fdm or
viewer), not to mention there are a few places in flightgear that call it
directly that have not been changed to the new interface (and may not need to be).

The code has been optimized to avoid duplicate traversals and seems to run
generally quite well.  Note that there can be a short delay reloading tiles
that have been dropped from static views.  We could call the tile scheduler on
a view switch, but it's not a big deal and at the moment I'd like to get this
in so people can try it and comment on it as it is.

Everything has been resycned with CVS tonight and I've included the
description submitted earlier (below).

Best,

Jim

Changes synced with CVS approx 20:30EDT 2002-05-09 (after this evenings updates).

Files:
http://www.spiderbark.com/fgfs/viewer-update-20020516.tar.gz
 or
http://www.spiderbark.com/fgfs/viewer-update-20020516.diffs.gz

Description:
In a nutshell, these patches begin to take what was one value for ground
elevation and calculate ground elevation values seperately for the FDM and the
viewer (eye position).  Several outstanding view related bugs have been fixed.

With the introduction of the new viewer code a lot of that Flight Gear code
broke related to use of a global variable called "scenery.cur_elev".

Therefore the ground_elevation and other associated items (like the current
tile bucket) is maintained per FDM instance and per View.  Each of these has a
"point" or location that can be identified.  See changes to FGLocation class
and main.cxx.

Most of the problems related to the new viewer in terms of sky, ground and
runway lights, and tower views are fixed.

There are four minor problems remaining.  1) The sun/moon spins when you pan
the "lookat" tower view only (view #3).  2) Under stress (esp. magic carpet
full speed with max visibility), there is a memory leak in the tile caching
that was not introduced with these changes.  3) I have not tested these
changes or made corrections to the ADA or External FDM interfaces.  4) The
change view function doesn't call the time/light update (not a problem unless
a tower is very far away).

Details:
FDM/flight.cxx, flight.hxx - FGInterface ties to FGAircraftModel so that it's
 location data can be accessed for runway (ground elevation under aircraft)
 elevation.

FDM/larsim.cxx, larcsim.hxx - gets runway elevation from FGInterface now.
Commented out function that is causing a namespace conflict, hasn't been
called with recent code anyway.

FDM/JSBSim/JSBSim.cxx, YASim/YASim.cxx - gets runway elevation from
FGInterface now.

Scenery/newcache.cxx, newcache.hxx - changed caching scheme to time based
(oldest tiles discard).

Scenery/tileentry.cxx, tileentry.hxx - added place to record time, changed
rendering to reference viewer altitude in order to fix a problem with ground
and runway lights.

Scenery/tilemgr.cxx, tilemgr.hxx - Modified update() to accept values for
multiple locations.   Refresh function added in  order to periodically make
the tiles current for a non-moving view (like a tower).

Main/fg_init.cxx - register event for making tiles current in a non-moving
view (like a tower).

Main/location.hxx - added support for current ground elevation data.

Main/main.cxx - added second tilemgr call for fdm, fixed places where viewer
position data was required for correct sky rendering.

Main/options.cxx - fixed segfault reported by Curtis when using --view-offset
command line parameter.

Main/viewer.cxx, viewer.hxx - removed fudging of view position. Fixed numerous
bugs that were causing eye and target values to get mixed up.
2002-05-17 17:25:28 +00:00
curt
487a14d05b Moved some scenery component initialization into FGScenery. 2002-05-14 06:08:28 +00:00
curt
92a58f6555 Consolodating scenery structures in scenery.hxx. 2002-05-14 05:49:47 +00:00
curt
47825dcbae Moved "scenery" from being declaried in scenery.cxx to being declared
in globals.hxx.
2002-05-14 05:22:52 +00:00
david
5a849b66e8 Major overhaul:
- changed FGSubsystem::update(int) to
  FGSubsystem::update(delta_time_sec); the argument is now delta time
  in seconds rather than milliseconds

- added FGSubsystem::suspend(), FGSubsystem::suspend(bool),
  FGSubsystem::resume(), and FGSubsystem::is_suspended(), all with
  default implementations; is_suspended takes account of the master
  freeze as well as the subsystem's individual suspended state

- the FDMs now use the delta time argument the same as the rest of
  FlightGear; formerly, main.cxx made a special case and passed a
  multiloop argument

- FDMs now calculate multiloop internally instead of relying on
  main.cxx

There are probably some problems -- I've done basic testing with the
major FDMs and subsystems, but we'll probably need a few weeks to
sniff out bugs.
2002-05-11 16:28:50 +00:00
david
56473dc28d Mac OS X fixes and MSVC warning fixes from Jonathan Polley. 2002-05-10 23:35:06 +00:00
david
58a001ad32 Patch from Norman Vine:
Yikes  --
Looks like I broke the scenery.current_normal when I last
reworked the hitlist code.

I guess this is proof that no one has been using it.
2002-04-25 19:44:27 +00:00
curt
bd9b1c7558 Fixed a recently introduced bug which cause the ground lighting to be
wrongly "lifted" a very, very, very large amount more than it was supposed
to be.  I guess the moral of the story is what goes up, must come down. :-)
2002-04-16 06:33:56 +00:00
david
c5f6293f17 Fix for vanishing-model problem: models are drawn in the same scene
graph as the terrain, except for internal cockpit view.  The SSG
scene-graph variables (except for the lighting root -- I'll get that
later) are now held in globals.hxx.

FGModelMgr::draw() is obsolete; I'll remove it in a future revision.
2002-04-13 21:36:22 +00:00
david
6e5d22789b Patches from Norm Vine to improve framerate and add a new
#ifdef'ed-out mode for syncing fullscreen with user settings in
Windows.
2002-04-07 15:24:32 +00:00
curt
e95429572c Converted if ( string == "" ) constructs to if ( string.empty() )
Fixed a warning in soundmgr.cxx.
2002-03-20 19:16:13 +00:00
david
4d4cd16012 Major viewer-code overhaul from Jim Wilson:
Description:

This update includes the new viewer interface as proposed by David M. and
a first pass at cleaning up the viewer/view manager code by Jim W.

Note that I have dropped Main/viewer_lookat.?xx and Main/viewer_rph.?xx and
modified the Makefile.am accordingly.


Detail of work:

Overall:
The code reads a little easier.  There are still some unnecessary bits in
there and I'd like to supplement the comments in the viewer.hxx with a tiny
bit on each interface group and what the groupings mean (similar but briefer
than what you emailed me the other day).  I tried not to mess up the style,
but there is an occasional inconsistency.  In general I wouldn't call it done
(especially since there's no tower yet! :)), but I'd like to get this out
there so others can comment, and test.

In Viewer:
The interface as you suggested has been implemented.  Basically everything
seems to work as it did visually.  There is no difference that I can see in
performance, although some things might be a tiny bit faster.

I've merged the lookat and rph (pilot view) code into the recalc for the
viewer.  There is still some redundancy between the two, but a lot has been
removed.  In some cases I've taken some code that we'd likely want to inline
anyway and left it in there in duplicate.  You'll see that the code for both
looks a little cleaner.  I need to take a closer look at the rotations in
particular.  I've cleaned up a little there, but I suspect more can be done
to streamline this.

The external declaration to the Quat_mat in mouse.cxx has been removed.  IMHO
the quat doesn't serve any intrinsic purpose in mouse.cxx, but I'm not about
to rip it out.  It would seem that there more conventional ways to get
spherical data that are just as fast.  In any case all the viewer was pulling
from the quat matrix was the pitch value so I modified mouse.cxx to output to
our pitchOffset input and that works fine.

I've changed the native values to degrees from radians where appropriate.
This required a conversion from degrees to radians in a couple modules that
access the interface.  Perhaps we should add interface calls that do the
conversion,  e.g. a getHeadingOffset_rad() to go along with the
getHeadingOffset_deg().

On the view_offset (now headingOffset) thing there are two entry points
because of the ability to instantly switch views or to scroll to a new view
angle (by hitting the numeric keys for example).   This leaves an anomaly in
the interface which should be resolved by adding "goal" settings to the
interface, e.g. a setGoalHeadingOffset_deg(), setGoalPitchOffset_deg(), etc.

Other than these two issues, the next step here will be to look at some
further optimizations, and to write support code for a tower view.  That
should be fairly simple at this point.  I was considering creating a
"simulated tower view" or "pedestrian view" that defaulted to a position off
to the right of whereever the plane is at the moment you switch to the tower
view.  This could be a fall back when we don't have an actual tower location
at hand (as would be the case with rural airports).

ViewManager:
Basically all I did here was neaten things up by ripping out excess crap and
made it compatible as is with the new interface.

The result is that viewmanager is now ready to be developed.  The two
preexisting views are still hardcoded into the view manager.  The next step
would be to design configuration xml (eg /sim/view[x]/config/blahblah) that
could be used to set up as many views as we want.  If we want to take the easy
way out, we might want to insist that view[0] be a pilot-view and have
viewmanager check for that.
2002-03-20 17:43:28 +00:00
curt
586d7f127a White space tweaks. 2002-03-18 19:02:59 +00:00
curt
464f036f35 Here is a cleaned up hitlist that should solve the PLib conflict
and fixes a 'potential bug' if the FGFS View code were to change

I also consolidated the specialized IntersectLeaf()
as they really didn't gain us much outside of their having
'more direct access into the SSG controlled data'

I would like to see the fgCurrentElevation functions moved
out of hitlist.cxx.

The one obstacle is their being dependent on my PLib
auxillary functions

ssgGetEntityTransform()
ssgGetCurrentBSphere()

code has been run through astyle with the default options
2002-03-18 16:25:16 +00:00
curt
8138c82b58 Incorporated Norman's optimized line/geometry intersection code. 2002-03-17 00:38:24 +00:00
david
d0eaafb1e1 Patches from Tony Peden to separate property XML I/O operations into a
separate header file.  This change will help integrate properties into
JSBSim.

Also, I (David Megginson) removed most of the SimGear include
statements from globals.hxx, reducing the amount of recompilation
every time SimGear changes.  This required making minor changes to a
lot of files that were depending on the side-effects of the inclusions
in globals.hxx.
2002-03-16 00:18:38 +00:00
curt
914b5636e4 Removed some extra debugging output that wasn't supposed to be committed. 2002-03-11 22:55:01 +00:00
curt
3df76f9401 Oops, make sure we are generating an ocean tile if we can't load a terrain
tile.
Fixed a warning in the sound manager.
2002-03-11 22:50:23 +00:00
curt
536e95b63d Further modifications and restructuring of the scenery loading process. 2002-03-04 02:36:06 +00:00
curt
73b92a697d Further restructuring of the scenery loading code. 2002-03-03 23:20:55 +00:00
curt
938d006188 Updates to the scenery loading infrastructure to make it more flexible,
clean up some messiness, and lay more groundwork for runway lighting.
2002-03-03 20:29:31 +00:00
curt
7631c37f73 Setting up some more ground work for lighting. 2002-03-01 18:08:30 +00:00
curt
9bae80d94a Latest version of hitlist.cxx from Norman Vine:
- Addresses some ot the recent profiling results.
- Added a 'lazy evaluation' in IntersectBranch and inlined a couple
  of HEAVILY called functions.
2002-02-28 23:59:28 +00:00
david
2e4f836a98 General cleanups to cut cross-dependencies and speed up compilation.
Added two new properties:

  /environment/temperature-sea-level-degc
  /environment/pressure-sea-level-inhg

These are now supported in FGEnvironment as well, though they always
have the same value for now.  They need to be hooked up to the FDMs.
2002-02-22 23:37:45 +00:00
david
eaf9fa7621 Added FGEnvironmentMgr to provide information on the environment in
different locations, and hitched it into FGGlobals.  FGEnvironmentMgr
has taken over as the subsystem, while FGEnvironment is simple the
information that it returns.  I've removed current_environment
completely -- everything now uses properties or goes through
FGGlobals.  FGGlobals itself has a couple of useful methods:

  const FGEnvironment * get_environment ();
  const FGEnvironment * get_environment (double lat, double lon, double alt);

The first one returns the environment data for the plane's current
position, while the second returns the environment data for any
arbitrary location.  Currently, they both return the same information,
but that will change soon.
2002-02-22 22:51:34 +00:00
curt
0a61c0da99 Fix a big where the initial ground elevation reported could be bogus
(initialization order problem.)
2002-02-22 20:20:23 +00:00
david
71f120e3be Initial take of new environment subsystem. Configure with
--use-new-environment to active it.
2002-02-19 15:16:08 +00:00
curt
aa65d0c3db Minor, miscellaneous stuff ... 2002-02-19 04:34:18 +00:00
david
3b870192f4 First steps in a weather reorganization. Note especially that
properties have been renamed from wind-(north|east|down)-fps to
wind-from-(north|east|down)-fps, and the FDMs modified appropriately.
No other changes should be visible unless FG_OLD_WEATHER is defined.
2002-02-19 01:26:44 +00:00
curt
9c370c2a9a Converted a cout to SG_LOG() 2002-02-12 16:36:25 +00:00
curt
dd8852dabe Better support for an alternate calendar time (i.e. if time/position/etc.
are being driven from an external data source.)

Akso found and fixed a bug in the simgear that caused the time to go goofy
temporarily while scenery was being loaded.
2002-02-11 23:33:20 +00:00
curt
08bbb83b8e A grab bag of tweaks and patches from Norman Vine.
- Better mingwin/cygwin support
- Various gui tweaks and code clean ups
- Initialization clean ups
- Hitlist/scenery tweaks
- other misc. stuff.
2002-02-05 20:54:08 +00:00
curt
10d63827fb #ifdef out some test code. 2002-01-20 05:58:34 +00:00
curt
dea7284cc7 Restructured the 'freeze' property a bit. We now have
/sim/freeze/master      (implimented)
  /sim/freeze/fuel        (implimented)
  /sim/freeze/position    (not implimented)
  /sim/freeze/time-of-day (not implimented)

/sim/freeze/master is bound to the 'p' key via keyboard.xml, however,
/sim/freeze/fuel is not bound to anything at the moment so you must
change it via the external property interface, or specify an initial
value on the command line.
2002-01-20 03:52:36 +00:00
curt
28d8191dae A couple minor MSVC tweaks contributed by Jonathan Polley 2002-01-17 00:03:02 +00:00
curt
1fa4c88d0e Updates to build system to better support automake-1.5
- automake-1.4 sets default values for INCLUDES which we can't
  overwrite.
- automake-1.5 renames this to DEFAULT_INCLUDES and leaves INCLUDES
  open for the developer to use.

Thus for automake-1.4 we are forced to 'append' to INCLUDES and in
automake-1.5 we can just set the value to whatever we like.
Unfortunately, the behaviors of the two versions are mutually
incompatible.

The solution I am committing now works for both versions but
automake-1.5 generates a lot of spurious warning messages that are
annoying, but not fatal.
2001-12-28 22:29:59 +00:00
david
2db3a9a93c Renamed static function from sgdPointInTriangle to pointInTriangle to
avoid conflict with most recent PLIB CVS.
2001-12-24 18:56:15 +00:00
david
aabdd355f0 Modified FGSubsystem::update() to take an int parameter for delta time
(i.e. multiloop).  Most subsystems currently ignore the parameter, but
eventually, it will allow all subsystems to update by time rather than
by framerate.
2001-12-22 17:33:27 +00:00
david
4f5d70144a -Removed .cvsignore from itself, since .cvsignore is now in the CVS 2001-12-12 04:15:23 +00:00
curt
4cc5cee885 David Megginson writes:
Here's an unusual patch for FlightGear -- I've created .cvsignore
files for every source directory, to make CVS output more informative.
This is especially nice when using cvs-examine from (X)Emacs to look
for changes.
2001-12-09 05:43:40 +00:00
curt
3d1e802b84 Format tweaks. 2001-11-20 22:03:58 +00:00
curt
36de63366b I just nailed an especially annoying tile cache scheduling bug.
What was happening was that we screwed up and scheduled tiles for
(lon,lon) rather than (lon,lat) ... note the typo.  This generated
bogus tile id's which the system happily accepted, put into the tile
cache system, and attempted to load.  The problem was that these bogus
tile id's were negative where as all valid tile id's should be >= 0.

These negative tile id's up the logic used to remove tiles from the
cache.  When identifying tiles for removal, we look for the furthest
tile away from us by starting out the furthest id at -1 and if we find
something further, we update the furthest tile id.  Then at the end we
check if the furthest tile id >= 0 to see if we found anything we
could remove.  However, the furthest tile id was these bogus tiles
with negative tile id's so the system always assumed there was nothing
appropriate for removal.  This made it impossible to ever remove a
tile from the cache meaning it quickly filled up and no more tiles
could be loaded.

I fixed the one instance of scheduling tiles for a bogus location, and
added a sanity check so if it ever happens again we'll bomb with an
appropriate error message.
2001-11-12 22:05:47 +00:00
curt
e19d456716 Tweaks to get startup time, relative sun angle, sky colors, etc. to be
properly initialized.
2001-11-07 04:55:57 +00:00
curt
d0df197e1d Temporarily added some debugging output. 2001-10-29 04:40:19 +00:00
curt
2b056c8452 This set of changes touches a *lot* of files. The main goal here is to
fix startup sequence problems where we initialize the FDM before we know
the desired starting altitude.

These changes delay fdm initialization until the local tile has been loaded
and we can do a real intersection and find the true ground elevation.

In order to do this, I depend more on the property manager as glue, rather
than the FGInterface.

There are some glitches still when switching to a new airport or reseting
the sim.  I will work on addressing these, but I need to commit the changes
so far to keep in sync with other developers.
2001-10-28 16:16:30 +00:00
curt
535d708ee0 Various MSVC patches. 2001-10-24 21:25:11 +00:00
curt
2fbab0d702 Various floating point / initial value bug fixes from Christian Mayer. 2001-10-11 22:07:45 +00:00
curt
c0f70c0d54 Initial supporting code for runway lighting (not yet working) 2001-09-19 22:30:41 +00:00
curt
17c781a870 Remove cached intersection code so that we can support intersecting with
dynamic objects.
2001-07-31 19:54:29 +00:00
curt
96b88e539f Move FGControls declaration to globals.hxx 2001-07-22 19:51:16 +00:00
curt
fe82a3d31f Make the tile loader more tolerant of situations where the cache is full,
but no entries qualify for removal.  It will keep trying to schedule the
tile(s) until an entry frees up.  Entries in the cache do not qualify for
removal if they are in the process of being loaded.
2001-07-20 22:25:12 +00:00
curt
e2dd3ac3e5 MSVC tweaks. 2001-07-12 17:55:44 +00:00
curt
2fba4df258 Begin stubbing in some wrapper code in preparation for runway lighting. 2001-07-12 15:03:49 +00:00
curt
4b23576df1 Shuffled around and restructured the terrain elevation interesection code
to make it usable by the threaded tile loader for placing objects at ground
level at load time.
2001-07-11 15:51:21 +00:00
curt
82f9528927 Fix a bug with old-style binary scenery compatibilty where no ground lighting
was generated.
2001-07-08 23:38:56 +00:00
curt
0648e5c051 Updated to read new scenery configuration files. 2001-06-22 20:35:39 +00:00
curt
4c8a7c3cef - fixed an initialization order bug that prevented reading correct
ground elevation at start-up
2001-06-20 22:22:26 +00:00
curt
81eb6d345d Fixed various warnings. 2001-06-14 22:10:29 +00:00
curt
35533b3a8d Test for null object after load before trying to connect it into the scene
graph (which would cause a crash.)
2001-06-01 18:04:10 +00:00
curt
54a0e1cf52 Make FGViewer::update() a pure virtual because FGViewer is a base class
and can never be instantiated itself.
2001-05-31 04:25:43 +00:00
curt
d5a2533411 Fixed a bug in the tile pager / caching / management system that caused
a crash when relocating to a new airport.  Pending work from the old
area is now just completed as normal, rather than trying to empty the various
queues in their various stages when can lead to many problems in a threaded
environment.
2001-05-30 18:21:03 +00:00
curt
7e4a96dc77 Norman Vine contributed more optimized object placement math. 2001-05-23 22:28:38 +00:00
curt
29d540901c Tile pager tweaks.
MSVC++ tweaks.
2001-05-21 20:44:59 +00:00
curt
2afcbb4bc8 We can't remove ssg branches in the threaded tile page because if we happen
to have attached an ssg loaded object to this branch, then plib will remove
it and all it's states (and textures) which will call opengl api commands
which will crash the program if run from a separate thread from the main render
thread.
2001-05-20 06:49:06 +00:00
curt
34854ab2af Threaded tile paging:
- model loading deferred to primary thread
- tile removal deferred to paging thread
- other tweaks and rearrangments.

Airport signs
- first stab at some support for adding taxiway and runway signs.  This
  is non-optimal, but I'm under the gun for a demo.
2001-05-19 16:59:43 +00:00
curt
865fb56c5a Tile loading is interleaved now when not threaded. Threaded loader is
throttled to one tile per frame maximum.
2001-05-18 20:31:23 +00:00
curt
31890db125 First stab at adding static objects to scene. 2001-05-16 06:00:02 +00:00
curt
a0d50000ba Modifications to coordinate with recent changes in simgear. 2001-05-15 22:30:39 +00:00
curt
051e2a6dc3 Tweaks so tile loading still works in non-threaded mode. 2001-04-17 05:21:56 +00:00
curt
4a609646b6 Modified FlightGear/src/Scenery. The tile loader thread no longer adds
a newly loaded tile to the scene graph.  Instead it puts it in a queue
for the tile manager.  I've used your counter_hack to check the loaded
queue and add any tiles to the scene graph.  I was playing around with
the counter_hack so there might be some commented out code, etc.  I also
changed some SG_DEBUGs to SG_INFOs so I could track the tile loading.
2001-04-16 20:03:52 +00:00
curt
a29cb28e93 Tweaks to the tile pager so it waits for a signal from the main thread before
loading the next tile.  This allows the main thread to "pace" the tile loader
so it consumes fewer resources.
2001-04-14 03:11:39 +00:00
curt
b0b6c34249 Initial stab at a threaded tile loader contributed by Bernie Bright.
He writes:

Here are the final changes to add threads to the tile loading.  All the
thread related code is in the new FGTileLoader class.

./configure.in
./acconfig.h
Added --with-threads option and corresponding ENABLE_THREADS
definition.  The default is no threads.

./src/Scenery/tilemgr
Removed load_queue and associated references.  This has been replaced by
a new class FGTileLoader in FGNewCache.
Made the global variable global_tile_cache a member.
schedule_needed(): removed global_tile_cache.exists() tests since
sched_tile() effectively repeats the test.
initialize_queue(): removed code that loads tiles since this is now
performed by FGTileLoader.
update(): ditto

./src/Scenery/newcache
Added new class FGTileLoader to manage tile queuing and loading.
tile_map typedefs are private.
exists() is a const member function.
fill_in(): deleted
load_tile(): added.

./src/Scenery/FGTileLoader
The new threaded tile loader.  Maintains a queue of tiles waiting to be
loaded and an array of one or more threads to load the tiles.  Currently
only a single thread is created.  The queue is guarded by a mutex to
synchronize access.  A condition variable signals the thread when the
queue is non-empty.

CLO: I made a few tweaks to address a couple issues, hopefully what we
have is solid, but now we kick it out to the general public to see. :-)
2001-04-11 02:47:15 +00:00
curt
606b8d13d9 Added loaded flag to FGTileEntry so that the main thread knows when the
tile has been loaded.  Since this flag can be set by another thread I've
declared it "volatile bool".

Also cleaned up delete vs delete[] usage.  Gcc is happy with delete[],
which is the correct usage.
2001-04-06 18:30:07 +00:00
curt
2aca8ca2cf Irix MipsPro patches and fixes. 2001-04-02 02:59:31 +00:00
curt
191bb3956a Updates from Bernie Bright to massage tile loading around to make it
slightly more conducive to future threading.
2001-03-29 01:42:31 +00:00
curt
96a9152b02 Irix MIPS patches. 2001-03-26 18:22:31 +00:00
curt
f1b1077d93 More fg -> sg namespace changes in simgear. 2001-03-25 14:20:12 +00:00
curt
9fac7682e3 inlines.h -> sg_inlines.h 2001-03-24 14:56:37 +00:00
curt
182fd42b40 SG-ified logstream. 2001-03-24 06:03:11 +00:00
curt
5ea9c04c64 SG_ namespace. 2001-03-24 04:56:46 +00:00
curt
17c96ae69e SG_ namespace 2001-03-24 04:48:44 +00:00
curt
1bf3001749 FG_ to SG_ namespace changes. 2001-03-24 00:18:01 +00:00
curt
5958389026 FG_ to SG_ namespace changes. 2001-03-23 22:59:18 +00:00
curt
8497f9b1ac FG_ to SG_ name changes. 2001-03-23 22:42:49 +00:00
curt
cdd3082998 MSVC fixes. 2001-03-21 23:10:15 +00:00
curt
c3e3e9f5d7 Reduce spurious output from joystick.cxx
Fix a typo in JSBSim.cxx (#endif in wrong place)
2001-01-29 15:14:12 +00:00
curt
e9b492af4f More tweaking of position reset logic. 2001-01-17 23:30:35 +00:00
curt
a5e4e6be11 Working on setting initial altitude correctly after a reset. 2001-01-17 20:32:02 +00:00
curt
576432ec75 David Megginson writes:
FGOptions is history, and the modules are (starting) to use the property
manager directly.  Let me know if I left any files out.

Inevitably, there will be some problems with broken options, etc.,
that I haven't found in my tests, but I'll try to fix them quickly.
We also need to stress that the property names currently in use are
not stable -- we need to reorganize them a bit for clarity.
2001-01-13 22:06:39 +00:00
curt
cff0022a16 Miscellaneous MSVC porting fixes by Christian Mayer. 2001-01-11 05:04:17 +00:00
curt
e333080388 MacOS changes contributed by Darrell Walisser (12/13/2000) 2000-12-13 23:02:02 +00:00
curt
95d6d93bed Renamed FGBucket -> SGBucket. 2000-12-13 20:36:04 +00:00
curt
65087c6b56 Removed tilecache.cxx tilecache.hxx.
Tweaks to ground lighting.
2000-12-08 17:28:05 +00:00
curt
5fecec2bba More night ground lighting tweaks. 2000-12-06 22:16:12 +00:00
curt
40d68c5627 Tweaks to get lights to fade in quantity-wise as well as brightness-wise. 2000-12-06 13:57:29 +00:00
curt
174553feef Tweaked thresholds for staging in ground lighting. 2000-12-05 18:58:05 +00:00
curt
2baba715b4 Adjust ground lighting up significantly higher to avoid zbuffer fighting
on cards with 16 bit (or less) depth buffers.
2000-12-05 14:27:27 +00:00
curt
a775392e31 Bring lights in in stages as it get's darker. 2000-12-04 23:25:05 +00:00