timoore [Thu, 20 Dec 2007 23:20:51 +0000 (23:20 +0000)]
Fix for "falling through ground" problem
The LOD far range on the tile entry scenegraph node was initialized to
0. This meant that any traverals of active children that happened
before the tile manager updated the node would ignore the node
altogether. Among these is the groundcache traversal which was failing
at startup even though scenery was loaded.
Also added a function to dump scene graph nodes to files; very handy
in gdb.
timoore [Fri, 14 Dec 2007 22:51:56 +0000 (22:51 +0000)]
Use the OSG DatabasePager instead of FGTileLoader
Make an OSG file reader for .stg files.
New class flightgear::SceneryPager, which is a subclass
osg::DatabasePager to handle explicit delete requests.
Modify FGNewCache, FGTileEntry, and FGTileManager to use
SceneryPager. Mostly this involved removing the queues that talked to
FGTileLoader.
Calculate accurate tile timestamps from the time they are traversed in
the cull stage (which means that they are visible) instead of updating
them periodically.
Replace tile entry transform and range node with one LOD node
timoore [Tue, 11 Dec 2007 11:10:35 +0000 (11:10 +0000)]
Check if scenery is available before blowing away existing values in ground cache
This fixes a race condition when teleporting somewhere outside of the
currently loaded scenery. Before, if there was no valid scenery, an
aircraft might end up at the center of the earth...
timoore [Fri, 7 Dec 2007 12:43:42 +0000 (12:43 +0000)]
Check for valid multiplayer packet.
Instead of just reporting that the magic number, length, etc. of a
multiplayer packet is invalid, abort processing this packet. Also,
check if enough space remains to send a property string.
mfranz [Wed, 5 Dec 2007 10:57:51 +0000 (10:57 +0000)]
add runway number as "id" to the runway hash within an airport hash
(It's already available as runway hash key, but the runway hash shouldn't
depend on it and be self-contained.)
mfranz [Sun, 2 Dec 2007 10:36:58 +0000 (10:36 +0000)]
make the state of the Meta and Super modifier keys available. These keys
are not available out-of-the-box on all systems and keyboards, and should
therefore not be used in files committed to CVS. This makes them well
suited for local key bindings, as they aren't likely to get overwritten
with later releases. SDL supports Meta and Super, OSG supports only Meta,
and GLUT supports neither.
(Somehow this part escaped the previous commit. :-)
mfranz [Sat, 1 Dec 2007 19:44:00 +0000 (19:44 +0000)]
- minor command update (loadxml, savexml, property-scale)
- add <condition> and <mod-{up,shift,ctrl,alt,meta,super}>
example to key definition description
mfranz [Sat, 1 Dec 2007 13:09:11 +0000 (13:09 +0000)]
make the state of the Meta and Super modifier keys available. These keys
are not available out-of-the-box on all systems and keyboards, and should
therefore not be used in files committed to CVS. This makes them well
suited for local key bindings, as they aren't likely to get overwritten
with later releases. SDL supports Meta and Super, OSG supports only Meta,
and GLUT supports neither.
timoore [Fri, 30 Nov 2007 00:01:01 +0000 (00:01 +0000)]
Rewrite SDL code to use an embedded osgViewer.
This uses the osgViewer infrastructure instead of setting up and osg::SceneView.
When the same change is made for glut, much of render.cxx can be deleted.
timoore [Thu, 29 Nov 2007 23:59:14 +0000 (23:59 +0000)]
Move to loading tiles and their submodels only by name.
Some cleanup in tileentry.cxx, but mostly code to implement loading of tiles
and their models without reference to FGTileEntry or SGBucket structures.
Also, don't do deferred model loading; load them when the tile is loaded.
timoore [Thu, 22 Nov 2007 23:46:39 +0000 (23:46 +0000)]
initialize _material pointer in FGGroundCache
_material was uninitialized. This was causing a segfault with
as-yet-to-be-checked-in paging code; I don't know if it ever resulted
in a segfault with the old tile loader, but it certainly could have.
curt [Wed, 21 Nov 2007 20:51:49 +0000 (20:51 +0000)]
Add a command to dump just the terrain portion of the scene graph to a .osg
file. Possible uses of this functionality could include converting the
model to some other format or coordinate system for use in some other
visualization or simulation.
mfranz [Mon, 12 Nov 2007 19:29:08 +0000 (19:29 +0000)]
- move temporary keyboard fix from input.cxx to fg_os{,_sdl}.cxx.
This is required to make sure the same letter key gets released,
which got the press event. (After Ctrl-press -> a-press -> Ctrl-release
a-release we want the Ctrl-a binding released, not the a binding.)
- add key listener interface for direct key access from Nasal space
mfranz [Tue, 6 Nov 2007 21:05:38 +0000 (21:05 +0000)]
move event_mgr and view_mgr bundle right before the requestRedraw()
This fixes the last jitter problems with views attached to MP/AI
objects, and doesn't seem to cause any new ones.
mfranz [Tue, 6 Nov 2007 12:01:29 +0000 (12:01 +0000)]
change update order to fdm -> events -> viewmanager
This removes some jitter in cases where Nasal is used to set up view
parameters from FDM data, such as position and orientation. (The event
subsystem handles Nasal's settimer() calls.)
mfranz [Mon, 5 Nov 2007 22:19:39 +0000 (22:19 +0000)]
revert swapping of x & y offsets in "lookat" mode
This was correct in the old repository and in revision 1.1 of the new,
but then broken in revision 1.2. After that, "lookat" and "lookfrom"
mode used different coordinate systems, and the "Adjust View Distance"
didn't work correctly in "lookat" mode.
mfranz [Sat, 3 Nov 2007 21:02:28 +0000 (21:02 +0000)]
Csaba HALASZ: fix IVSI instrument problem
"I have been investigating the Concorde IVSI problem. I came to the
conclusion that the trouble is that the environment altitude and thus
the pressure (which is calculated from that) is lagging by 1 frame.
Normally that wouldn't be a problem, but the IVSI calculates rate of
change and it will use the new dt with the old value difference,
thereby arriving at bad results if dt changes (and it does)."
andy [Wed, 24 Oct 2007 18:07:02 +0000 (18:07 +0000)]
Fix memory leak introduced when we stopped using _context for script
invocations, but left it in place for miscellaneous allocation work.
Contexts cache allocated objects in a temps vector and only clear it
out when they are used.
durk [Sat, 20 Oct 2007 08:36:21 +0000 (08:36 +0000)]
Miscellaneous tweaks and Bugfixes. Mostly memory leaks ported from the plib
version
* Delete ai list objects in ~ATC/AIMgr.cxx:AIMgr::~AIMgr()
* Delete colors in GUI/new_gui.cxx: NewGui::~NewGui.cxx
* Delete memory allocated to the class member "route" in
Instrumentation/gps.cxx
* Delete all globals (except a few "unsafe" ones that still cause segfaults
and need further examination.
* Use an SGShared pointer for navaid memory allocation, so that pointers to
individual navaid objects can be included safely in multiple navaid lists
mfranz [Thu, 18 Oct 2007 11:43:38 +0000 (11:43 +0000)]
- airportinfo(): don't bark when no airport was found (K. HOERCHER)
- simplify listener purging and fix removelistener() return value for
one-shot listeners
- listener: inherit virtualness
- s/handler/code/ in listener code to be consistent with NasalSys::call
mfranz [Tue, 16 Oct 2007 15:15:41 +0000 (15:15 +0000)]
- listener: re-order and change callback function args; simplify code
- make code look like Andy wrote it (so people know whom to blame :-)
- nasal-props.cxx: warning--
mfranz [Mon, 15 Oct 2007 16:28:40 +0000 (16:28 +0000)]
- add argc/argv arguments to FGNasalSys::call
- add support for childAdded/childRemoved listeners
- use regular function arguments for property ghosts
- warning--
This definition defaults to the old behavior. The fourth argument can
be set to zero, in which case the function is only called when the
node value has actually changed. It should really default to zero, but
then all callers would have to be reviewed, which is a bit too dangerous
"shortly" before a release.
mfranz [Fri, 12 Oct 2007 17:24:43 +0000 (17:24 +0000)]
add new listener type: setlistner(<prop>, <func> [, <type=0>]);
0 -> trigger whenever property is written to (even if it's the old value; default)
1 -> like 0, but also trigger the function initially
2 -> trigger initially, but then only on changes
mfranz [Thu, 11 Oct 2007 13:51:11 +0000 (13:51 +0000)]
prevent endless loop. The new awy.dat.gz has entries like line 2632 ...
AMIBO 34.973889 021.658056 ARLOS 34.625278 023.000000 1 095 195 M871-MT E-MT W-N4
... where unexpected ids follow (here E-MT W-N4). The loader didn't skipeol.
The additional values are for a first quick&dirty fix just dropped.
mfranz [Thu, 11 Oct 2007 09:19:49 +0000 (09:19 +0000)]
Make sure the __MWERKS__ test can't go unnoticed. It's really time to
remove all those 41 hacks if possible. Metrowerks is under category
"Defunct software companies" in Wikipedia, its compiler was known to
work on PowerPC (which we don't support, anway, right?) and on some
Unices. The hacks are in CVS since the first commit 2002/9/10 (old
repository!) and probably were in the code long before that. Any
platform where such a broken compiler is still used, will hardly
be suitable to run fgfs at all.
mfranz [Sun, 7 Oct 2007 19:27:05 +0000 (19:27 +0000)]
save some startup parameters under /sim/startup/options/. options.cxx puts
them under /sim/presets/ but they aren't save there, and as fgInitPosition
and its subroutines overwrite them, we lose the information about what the
user really wanted. This is a temporary solution -- it really belongs into
options.cxx.
mfranz [Fri, 5 Oct 2007 22:15:55 +0000 (22:15 +0000)]
use airport search filter to only search for "regular" airports (no
seaports or heliports, as they aren't rendered at the moment, anyway).
This shall later be made configurable via argument.
mfranz [Fri, 5 Oct 2007 21:54:52 +0000 (21:54 +0000)]
- make FGAirport::search() more versatile, so that it can't only search
the next airport or airport with METAR station, but about any type of
airport
- as a side effect this change makes it also 30 to 50% faster :-)
In the long run this linear search shall be replaced with a spatial
algorithm (like octree), which will be a much bigger performance gain.
mfranz [Fri, 5 Oct 2007 12:59:43 +0000 (12:59 +0000)]
- rename dynamics to _dynamics for consistency reasons
- preserve information from apt.dat about whether an airport is a "normal"
airport, a seaport, or a heliport. Do it without wasting another byte
in the FGAirport structure (saves 50kB of memory). Yes, I know bitfields. :-)
timoore [Thu, 4 Oct 2007 20:40:29 +0000 (20:40 +0000)]
Make comparisons against OSG version less flakey
Turn OPENSCENEGRAPH_MAJOR_VERSION, OPENSCENEGRAPH_MINOR_VERSION and
OPENSCENEGRAPH_PATCH_VERSION into a single number for comparisons in the
preprocessor.