Commit Graph
98 Commits
Author SHA1 Message Date
david 01f4541331 Ignore generated files. 2004-06-15 12:47:52 +00:00
david c06ef23eb1 Added more generated files. 2004-04-04 14:24:06 +00:00
david a616aa8e55 Ignore generated files. 2004-03-23 19:03:40 +00:00
david aa67c738a1 Load submodels before animations, so that we can animate submodels.
Allow submodels to be named when they are loaded.
2004-02-27 03:30:01 +00:00
david 0633d703d0 Be a little quieter at the default debug level. 2004-02-07 21:36:20 +00:00
david c37afce303 Minor changes to logging messages (to STDOUT). 2003-11-24 17:41:43 +00:00
david 0e999f281b Added generated files. 2003-05-13 10:21:53 +00:00
david aadc802fdd Added props_test program. 2003-05-13 10:21:36 +00:00
david f922e84eb6 Use "coverage" instead of "type".
Rename "mostly-cloudy" to "broken" and "mostly-sunny" to "scattered",
to follow standard weather terminology.

Add "few".
2003-04-05 03:32:18 +00:00
david c4fa7a965d Patch from Frederic Bouvier:
I am trying to compile tabbed_values.cxx and found that it requires
assert.h to compile with MSVC (on Linux, it must be included indirectly).
There is a patch below
2003-03-02 16:35:08 +00:00
david 1a6e14c3bb Added tabbed_test program. 2003-03-02 16:34:42 +00:00
david 7379d8a54d Patches from Erik Hofman (for Irix? I've lost the original message). 2003-03-02 14:52:05 +00:00
david 6cf3b54b4b Patches from Erik Hofman for SGI compatibility:
Some more cmall changes to the SimGear header files and removed the
SG_HAVE_NATIVE_SGI_COMPILERS dependancies from FlightGear.

I've added a seperate JSBSim patch for the JSBSim source tree.
2002-12-31 18:03:26 +00:00
david 78411d29a7 Patch from Erik Hofman:
This patch adds some more functionality to the header files and removes
*all* dependencies on SG_HAVE_NATIVE_SGI_COMPILERS in the SimGear code!

[dpm: I had to add some additional SG_USING_STD declarations to make
it compile]
2002-12-31 14:47:34 +00:00
david f8a49c41ef Added missing Makefile.am from Erik Hofman. 2002-12-30 22:33:34 +00:00
david a0a0c8e308 IRIX/MipsPro patches from Erik Hofman:
This patch adds some missing default ISO C++ headers to SimGear,
especially usefull for Irix/MipsPro. To the best of my knowledge this
only affects the Irix/MipsPro compiler combination although it might be
usefull for others as well.

This patch does not yet remove any compiler specific code, but that
would be my next task. The powerfull macros as defined in the compiler.h
file allowed me to split it up into multiple patches.
2002-12-30 21:33:56 +00:00
david e5814dad73 Some trivial typo corrections. 2002-12-21 13:40:50 +00:00
david 2e17b28994 Includes patch from Erik Hofman. 2002-11-17 11:07:40 +00:00
david c3f558b034 Cygwin patch from Patrick Staehlin:
To compile the development CVS version of FlightGear(0.9.0) i had to
apply some small changes to SimGear and FlightGear.

The changes need probably some additional ifdefs for other platforms but
since my linux-hd crashed i can't verify that.
2002-11-17 00:42:17 +00:00
david 65ce1a04b2 MS patch from Norm Vine to fix min/max macro defs. 2002-11-17 00:34:40 +00:00
david 3af4a19f76 Allow 'include' attribute on root PropertyList element. 2002-11-11 14:40:16 +00:00
david 5178f69f18 Simplified the command-manager interface. 2002-10-26 01:18:03 +00:00
david 94fa51e3f7 Change int to GLenum for portability. 2002-10-18 20:25:21 +00:00
david 8d63c300e2 Removed simgear/interpreter directory; most likely we will use the new
PSL interpreted language in plib.
2002-09-18 20:27:17 +00:00
david 7ecf508453 Rolled Norm's change back out; update needs to be called earlier. 2002-09-16 13:13:49 +00:00
david 83e6e44eab Patches from Norm Vine to get clouds working (and add some debugging
information).
2002-09-16 02:26:20 +00:00
david 69a93342c0 Ignore generated files. 2002-09-15 10:42:54 +00:00
david a67fd7ea99 Added autom4te.cache. 2002-09-14 16:06:22 +00:00
david cf2b8afbe9 Added stamp-h1. 2002-09-14 16:05:58 +00:00
david a1e7761384 Removed /usr/local/include (as with plib). 2002-09-14 16:05:41 +00:00
david d068915b42 Added newlines and did other clean-ups to eliminate errors and
minimize warnings compiling with g++ 3.2.
2002-09-14 16:03:39 +00:00
david 2e7e9b73a0 Change from Norman Vine to add new random-number algorithm. 2002-08-05 18:43:28 +00:00
david 7a11523692 Random-number seed patch from Erik Hofman. 2002-07-31 17:14:29 +00:00
david 9b05c27938 Remove ECMAScript interpreter from the default build for now. It can
still be built from inside the directory.
2002-07-30 11:58:34 +00:00
david fd96729362 Patch from Cameron Moore:
* Fixed (un)signed comparison
2002-07-18 20:30:18 +00:00
david c57cc096f8 Patch from Cameron Moore:
* Rearranged member initializers to shut gcc -Wall up
2002-07-18 20:30:02 +00:00
david c8efd0a465 Added JavaScript interpreter, repackaged by Tony Peden. It's not tied
into anything yet, but it builds OK inside SimGear.
2002-07-18 20:27:46 +00:00
david db60139845 Downgrade cloud-base alert to a debug warning. 2002-07-18 20:23:30 +00:00
david cadefd323a Quick fix for bug reported by Julian Foad, where the simplify flag was
not honoured after the first call.  This isn't all that efficient, and
the return type probably should change to string eventually, but this
fix avoids changing the headers for now.
2002-07-18 20:04:50 +00:00
david baab88f42a Fix deletes in destructor. 2002-07-06 15:00:37 +00:00
david 767b74dd35 Added new getDisplayName method that gets the name with its index.
Suggested by Julian Foad.
2002-07-06 14:58:38 +00:00
david 90e8287f43 Made SGPropertyNode::getPath extremely efficient: it now caches its
result, so after the first call for any node, it simply tests and
returns a pointer.  This also fixes the problem of buffer conflicts
with make_string.

Added SGPropertyNode::hasChild(const char * name, int index = 0) to
provide a syntactically-cleaner way to test for the existence of a
child node, i.e.

  for (int i = 0; i < 9; i++) {
    if (node->hasChild("foo", i))
      foo[i] = node->getChild("foo", i)->getDoubleValue();
  }
2002-07-06 13:19:02 +00:00
david d8b7e5b8fd Added simgear_config.h.in 2002-07-06 12:06:40 +00:00
david d6a790cf13 MSVC++ bug work-around from Frederic Bouvier. 2002-07-03 02:06:23 +00:00
david 3ff1789963 Fixed an MSVC compilation problem reported by Frederic Bouvier. 2002-06-28 17:02:42 +00:00
david 9737c0c4dd Fixed bug reported by Julian Foad:
While investigating, I found that SGPropertyNode::getPath returns a
(char *) pointer to the character data of a string on its stack,
i.e. to undefined memory after it returns.  I remember someone was
changing strings to char* for efficiency.  Perhaps this bug was
introduced then.  I'll include a patch for it with my eventual patch
for the above, unless someone beats me to it.  I don't think it
affects any existing callers: they all want a string anyway.
2002-06-28 16:56:14 +00:00
david b201383a80 Patch from Julian Foad:
Initialise a "possibly uninitialised" variable (which was already
functionally correct).

[Note from DPM: this patch will be blown away if we ever update to a
newer version of Expat.]
2002-06-28 15:55:11 +00:00
david 2253b82304 Patch from Julian Foad:
Remove a hack that originally worked around a buffer overflow
elsewhere in the file.  The buffer overflow was fixed long ago, but
the hack was not removed.
2002-06-28 15:54:34 +00:00
david 2581446d85 Patch from Julian Foad:
Remove trailing comma (unportable).
2002-06-28 15:54:15 +00:00
david a6291b286c Patch from Julian Foad:
Remove unused static function (warning because it cannot possibly be used).
2002-06-28 15:53:58 +00:00
david 96a396bfcb Patch from Julian Foad:
This file should be removed from CVS because it is generated by
autogen.sh.
2002-06-28 15:53:31 +00:00
david 0833a11686 Significant improvements to the change-listener support. There are
now three different change events, and the listener base class removes
itself from the parent in the destructor.
2002-06-18 21:17:42 +00:00
david 9c7f7f3d32 Added a ptr() method to SGPropertyNode_ptr to get the raw pointer.
Added the SGPropertyChangeListener interface and addChangeListener and
firePropertyChange methods.
2002-06-18 01:26:09 +00:00
david 7847fe8074 Patch from Melchior Franz:
layer_span used uninitialized in SGCloudLayer::rebuild (line 162, 170, etc.)
2002-06-07 17:39:38 +00:00
david c57d25ac51 Be more conservative and reuse SSG objects. 2002-06-05 19:12:50 +00:00
david 1341b5b9f8 Try to avoid some memory leaks. 2002-06-05 15:43:04 +00:00
david 3a835dde7d Skip drawing clear cloud layers. 2002-05-17 16:53:19 +00:00
david 255bb6dd07 Preparation for making dynamic cloud layers -- moved cloud state out
of sky.[ch]xx and into cloud.[ch]xx, and added setters for modifying
the state of an existing layer.
2002-05-16 23:16:39 +00:00
david c7e6459c64 Modified to work with the new SGPropertyNode_ptr class. 2002-05-10 22:58:03 +00:00
david 86e31e696d Patch from Frederic Bouvier:
I have modified the SGPropertyNode interface to support node removal
and address the issues you mention yesterday.

I added the SGPropertyNode_ptr class that is a smart pointer that
increment and decrement a counter in SGPropertyNode. The _children
vector is changed to a vector<SGPropertyNode_ptr> in order for the
node to hold a reference to its children. I also added a
_removedChildren vector of the same type. When removeChild is called
with the keep parameter set to true, the reference is removed from
_children and inserted in _removedChildren, and the attribute REMOVED
is set. When getChild is called with create set to true, the _children
vector is searched, then the _removedChildren and then a new node is
created. If a resurrected node is returned, the REMOVED bit is cleared.
The static const int LAST_USED_ATTRIBUTE is also added.

The footprint of this patch is light. SGPropertyNode is one int
longer in size, SGPropertyNode_ptr is one pointer large without
virtual functions. Some functions can be inlined if your current
policy change.

The FlightGear patch is to take account the change in the getChildren
function that now returns a vector<SGPropertyNode_ptr>. If the
removeChild functionnality is to be added in FlightGear, all those
SGPropertyNode * floating around should be changed to
SGPropertyNode_ptr.
2002-05-10 22:57:36 +00:00
david be0b1bb994 Mac OS X fixes from Jonathan Polley. 2002-05-10 21:33:12 +00:00
david 03e74bfeb4 Ignore binaries. 2002-05-10 21:31:55 +00:00
david 972223cd50 Eliminate an unsigned-int comparison warning. 2002-05-10 21:31:15 +00:00
david 384e56b9b4 Patches from Erik Hoffman:
Tbis is a first patch in a series to clean up SimGear by removing
warning messages. Most of them are straight forwared, but in pops.hxx
the compile complaints about "type qualifier is meaningless on return
type". I think it's up to you to decide if you want that part applied.
2002-04-25 15:09:10 +00:00
david d198e962b0 Patch from Melchior Franz:
From the cosmetics department ...
2002-04-25 14:56:03 +00:00
david 0136fdadbb Patch from Melchior Franz:
magvar and magdip are used before their initialization
2002-04-25 14:55:40 +00:00
david 711622fd5b Patch from Frederic Bouvier:
A const char * is not supposed to change and cannot be deleted. So
here is a patch that remove unnecessary const from props.hxx and
props.cxx. There also is the addition of a friend directive because
nested classes do not receive special privileges and cannot access
private members of the outer class.
2002-04-07 21:28:43 +00:00
david 96474823b5 Implemented a very simple hash-table cache for property lookup using
relative paths.
2002-04-06 21:47:22 +00:00
david d0d7878e0a Patch from Melchior Franz:
This module works mostly with char* and allocates memory with
strdup ... delete doesn't go well with malloc(). The transition
to string only would be nice, but some class interfaces return
char*, so it was more natural to just drop the deletes.
2002-03-27 11:42:09 +00:00
david be5d365348 Patch from Melchior Franz:
Here is a patch that fixes a little problem in dome.cxx: The fog_color
is created in a sgVec3 (227) but then handed over to ::repaint(), which
expects a sgVec4 (282). Then (343) center_color (although defined as
sgVec4) is only initialized with 3 values, but later (441) assigned to
'slot' via sgCopyVec4.
2002-03-25 19:56:48 +00:00
david a8e0002a64 Patch from Melchior Franz:
at several places material was copied to "buffer" using strncpy
without adding a closing '\0'. This again lead to access to non
initialized memory and potentially (and actually at least in one
case) to feeding garbage to atof(). In case the following garbage
happened to start with digits, we would get funny time
values.  :-)
   I just added the obligatory "buffer[n] = 0", which doesn't
really look professional now. Maybe we should use the string
class or define a helper function that strncopies =and= adds
a trailing zero?
   The last hunk fixes another buglet, that wasn't dangerous
at all, but caused an error message. The loop that should cut
the string at hash marks ('#') did neither stop at such, nor at
string ends. It always scanned the whole 256 character long
buffer and accessed uninitialized memory. valgrind doesn't
like that. I dropped the 256 counter, because fgets =does=
add the closing zero. It is safe to scan until we either
get the zero or the hash mark.
2002-03-25 19:50:32 +00:00
david bf75cf7225 Removed an unnecessary string allocation during copying. 2002-03-22 15:02:50 +00:00
david c024b680bc Removed commented-out dead code. 2002-03-22 13:18:49 +00:00
david c896475765 More rearrangement of headers. Replaced delete with delete[] where
appropriate.
2002-03-22 12:45:11 +00:00
david 101fdb3598 Moved up #include <algorithm> 2002-03-22 12:38:34 +00:00
david b13505afdf Fix segfault when deleting a node with a string value. 2002-03-21 15:19:26 +00:00
david 9d96b171a0 Patch from Frederic Bouvier:
deletion of a const char * is not allowed with MSVC 6. I had to cast to char
*
to avoid compile errors.
2002-03-20 21:44:38 +00:00
david 8b5a0cde69 Patch from Tony Peden to remove unused variable and eliminate compiler
warning.
2002-03-20 21:31:53 +00:00
david bed7593cdd Moved includes higher to make sure that std::sort is known. 2002-03-20 13:43:23 +00:00
david 9fed946567 Include <algorithm> and <stdio.hxx> to fix compilation errors on some
platforms (I should have done this anyway).
2002-03-19 18:17:36 +00:00
david 4d0bc0ae39 Major property-manager rewrite, using const char * throughout
interface instead of string.  This will result in a lot more
efficiency later, once I add in a simple hash table for caching
lookups, since it will avoid creating a lot of temporary string
objects.  The major considerations for users will be that they cannot
use

  node->getName() == "foo";

any more, and will have to use c_str() when setting a string value
from a C++ string.
2002-03-19 16:07:47 +00:00
david f9824aa7de Removed SGRawValueInternal class (it's now handled directly by
SGPropertyNode) and updated some out-of-date documentation comments.
2002-03-18 14:55:59 +00:00
david 4d2522964a Some code fixes to keep untying clean with new optimizations. 2002-03-18 14:55:15 +00:00
david dbe4a59b8e Code cleanup and minor speed improvements. For the record, accessing
an internally-managed property is nearly twice as fast as accessing
one tied to methods.
2002-03-18 03:21:18 +00:00
david 918f8a3ed4 Patches from Tony Peden to separate property XML I/O operations into a
separate header file.  This change will help integrate properties into
JSBSim.
2002-03-15 23:16:46 +00:00
david a2d95ac742 Patch from Martin Dressler to ensure that values as well as children
get written with write-all.
2002-03-09 11:14:29 +00:00
david 10715bbea7 Modified to add an optional parameter to writeProperties to allow
*all* properties to be written, rather than just the ones flagged as
archivable.  Tony Peden requested this feature to make it easier for
people to document properties.
2002-03-03 21:22:24 +00:00
david 89fcb12556 Cleanups from Petru Paler:
It's basically a couple unused variables, an explicit cast, some unused
functions removed or commented out, and a whole bunch of pragmas
removed.
2002-03-02 23:37:04 +00:00
david cc3d7ddee5 Minor changes to path caching. 2002-02-28 14:37:00 +00:00
david aef809348f IMPORTANT: backwards-incompatible change to properties.
The useDefault argument for the SGPropertyNode::tie(...) methods will
invoke the setter only when there is already a property value defined;
previously, the setter was always invoked, with a default value if
necessary.
2002-02-19 15:20:02 +00:00
david dd629da8d3 Replaced some cout's with SG_LOG (fixes namespace problem with
ANSI-conformant compilers).
2002-02-13 12:14:01 +00:00
david 2d1b2ca938 Minor fixes from Cameron Moore. 2002-01-30 15:09:56 +00:00
david a6251606dd Added some new functionality to the property manager:
1. Nodes cache previous relative paths so that they do not have to
parse the paths each time.

2. There are new getNode() methods that include indices, so that users
do not have to sprintf to a buffer to iterate through indexed nodes.
2002-01-19 03:06:22 +00:00
david 93fd948978 Added aclocal.m4 2002-01-16 00:04:16 +00:00
david c6aa8bc8e9 Fixed Makefile.am to install easyxml.hxx in the simgear/xml rather
than simgear/.
2001-12-16 20:59:16 +00:00
david 6f1bfa202e -Added .cvsignore files to clean up CVS messages 2001-12-12 02:44:37 +00:00
david 6fa9f86d1c Added trace attributes to properties:
TRACE_READ - log a message whenever the property is read.

TRACE_WRITE - log a message whenever the property is written.

The second one works only when the property value is changed through
the property manager; tied variables and accessors are not polled for
value changes because of the performance hit.

These methods end up invoking private methods
SGPropertyNode::trace_read and SGPropertyNode::trace_write.  By
setting breakpoints on these methods inside a debugger, it is possible
to debug property access and find what parts of a program are reading
or writing specific property values by doing a backtrace.

In the XML property files, users can use the attributes 'trace-read'
and 'trace-write' to control tracing; the value should be 'y' to
enable tracing or 'n' to disable it (the default).
2001-12-12 02:28:28 +00:00
david 019a9527d2 Added Curt to empty Authors file as CVS test. 2001-12-11 22:23:25 +00:00