ThorstenB [Sat, 17 Mar 2012 09:02:13 +0000 (10:02 +0100)]
Avoid segfault when a texture file is missing.
Always check the return value of "findDataFile". If it's empty, always
provide the _original_ path being searched in an error message. Otherwise
we eventually just get useless 'Can't find file "".' error messages
(and also a segfault here, since osgDB::readImageFile("") returns NULL).
scenery: Accumulate stg files until we find an OBJECT_BASE.
This should recover most of the old scenery loading behavior
before the last change. The z-fighting due to model duplication
does not happen over solid ground. Sea tiles are still broken.
This change reworks the code block loading the stg files.
It fixes a long standing problem where we end up loading
similar models from different entries of the scenery
path at the same geographic location. This usually results
in models that appear to have z figting, even if the isolated
model does not show z fighting at all.
As a result the lookup sequence for models and scenery has
changed a bit. This should be closer to what it supposed to
be and did not show any problems on the areas and sceneries
I tested.
ThorstenB [Sat, 3 Mar 2012 16:06:51 +0000 (17:06 +0100)]
Dir::tempDir not working on some systems.
Only worked when TMPDIR environment variable had a trailing slash (i.e.
"/tmp/" worked, but not "/tmp").
(Problem shown by simgear's "test suite". It's good to have tests!)
Use simgear internal stuff for the singleton class.
This removes the other still present dependency on osg
in the future sgcore library.
It also remove the need for the NO_OPENSCENEGRAPH_INTERFACE
compile time definition.
Move osg dependent stuff from SGMath into simgear/scene/util/OsgMath.hxx.
Update includes in simgear to reflect this change.
Note that this change also requires an updated flightgear version.
Stuart Buchanan [Fri, 2 Mar 2012 23:04:18 +0000 (23:04 +0000)]
Evaluate <condition> statements in materials.xml at tile loading time
rather than on startup. This will allow changing between winter and
summer textures in-sim, and also allow more interesting regional
textures to be defined.
Better seperation between the rti and the hla level
of classes. Decouple object model setup from the
need to connect at a federate. Fix alignment computations
for the standard hla data types. Work towards an
interaction class abstraction. Add more flexibility in
deriving from the base classes and adding callbacks.
Stuart Buchanan [Sun, 26 Feb 2012 22:38:38 +0000 (22:38 +0000)]
Handle dds object masks properly:
1) Only flip the object-mask if the texture xor the object mask is dds
2) Handle NTFS file systems where the extension may be .DDS rather than .dds.
Introduce read{RTI13,RTI1516,RTI1516E}ObjectModelTemplate
methods. Deprecate the current readObjectModelTemplate method
and provide a short term upgrade path.
Torsten Dreyer [Wed, 15 Feb 2012 13:54:02 +0000 (14:54 +0100)]
Don't untie a property when loading from xml
executing the fgcommand loadxml implicitely untied every previously
tied property if a property type was given in the property element.
That made it impossible to autosave aircraft data for tied properties.
This patch should fix this. It adds an inconsitency, though:
if a property with a given type is read in which has been tied to
before and the property types do not match, the property type in the
xml file will be ignored.
ThorstenB [Sat, 11 Feb 2012 09:55:13 +0000 (10:55 +0100)]
#658: better bugfix for findDataFile issue
Fixes the more basic probelm of "SGModelLib::findDataFile" resolving an
empty file name to the fgdata (directory) path. findData_File_ should
never return a _directory_ path, only valid _file_ names.
ThorstenB [Sat, 11 Feb 2012 08:54:53 +0000 (09:54 +0100)]
#658: avoid crash when Textures.high is missing
Don't resolve the empty file name, which would result in the fgdata
directory path (instead of a path to a file). Eventually this resulted in
a segfault, partly due to a bug in "osgDB::readImageFile", which reports
"success" when given a directory (instead of a file) path, though it
doesn't return a valid image object.