curt [Sun, 25 Aug 2002 17:31:47 +0000 (17:31 +0000)]
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.
curt [Sat, 24 Aug 2002 03:54:45 +0000 (03:54 +0000)]
Brandon Bergren:
2. I changed Simgear's autogen.sh so it is quieter, and errors out if
autoheader or autoconf fails. It puts all error output in autogen.err, and
deletes it if nothing errored out. The patch is in (sg.autogen.sh.patch.gz)
This patch applies to flightgear, too. If someone doesn't like what I did
here, please speak up! I really believe that this patch will help cause
less confusion among people new to compiling flightgear.
curt [Fri, 23 Aug 2002 17:52:10 +0000 (17:52 +0000)]
Bernie Bright:
Here are some changes that gave me a significant frame rate increase of about 10 fps with random objects disabled. The interesting thing is that these changes aren't in the main loop but are in tile loader. My guess is that I've reduced the memory footprint just enough to reduce CPU cache misses, though I have no hard evidence of this.
Initially I modified all SGBinObject member functions to pass/return by reference instead of by-value. This gives little or no speed up but allows for some optimizations in fgBinObjLoad(). It is these changes that reduce the number of memory allocations. Needless copying of vectors, and vectors of vectors, can be very memory intensive, especially if they are large.
Anyway I would be interested to see if you get similar results. I would emphasize that the frame rate increase only occurs with random objects disabled. I lose about 10-15 fps on my GF2MX 32MB with random objects, probably a fill-rate limitation or texture memory thing.
david [Thu, 18 Jul 2002 20:04:50 +0000 (20:04 +0000)]
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.
david [Sat, 6 Jul 2002 13:19:02 +0000 (13:19 +0000)]
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();
}
david [Fri, 28 Jun 2002 16:56:14 +0000 (16:56 +0000)]
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.
david [Fri, 28 Jun 2002 15:54:34 +0000 (15:54 +0000)]
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.
david [Tue, 18 Jun 2002 21:17:42 +0000 (21:17 +0000)]
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.
david [Thu, 16 May 2002 23:16:39 +0000 (23:16 +0000)]
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.
david [Fri, 10 May 2002 22:57:36 +0000 (22:57 +0000)]
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.
curt [Fri, 10 May 2002 13:53:22 +0000 (13:53 +0000)]
Bernie Bright:
Here's a first cut at SGSocket reimplemented using plib.net. I've
maintained the same TCP server behaviour, that is only one client
connection at a time. I don't think it is possible within the current
framework to handle simultaneous clients.
I've also added two simple test programs, tcp_client and tcp_server.
curt [Fri, 10 May 2002 13:32:44 +0000 (13:32 +0000)]
Bernie Bright:
Here is a total rewrite of the strutils package. I've reimplemented the
trimleft(), trimright() and trim() functions as lstrip(), rstrip() and
strip() respectively. Additionally I've added a split() function that
behaves like its perl/python equivalent. Just the thing for splitting
comma separated option strings or space separated telnet commands and
arguments. I've also enclosed the whole thing in a namespace
simgear::strutils. Since I seem to be the only one who uses these
functions, SimGear and FlightGear compile without change.
PS It is no coincidence that the new function names bear an uncanny
resemblance to the python functions of the same name.
david [Thu, 25 Apr 2002 15:09:10 +0000 (15:09 +0000)]
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.
david [Sun, 7 Apr 2002 21:28:43 +0000 (21:28 +0000)]
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.
Added src-libs subdirectory for keeping source code to extra libs. These
are things that are needed, but that many systems already have packages
available to install, and many users may have versions of these already
installed to support other projects. So rather than build and install by
default with the main SimGear build/install, these are kept separate so that
those users that don't have them already installed can build and install
them separately.
- Added src-libs/boost.tar.gz and README.boost. This is in anticipation
of actually using them in the flightgear event manager.
- Now that we have several add on libs we are bundling with simgear (but
not automatically built as part of the simgear build) I have moved them
to their own subdirectory (src-libs).
curt [Thu, 28 Mar 2002 02:21:00 +0000 (02:21 +0000)]
Updated to the latest metakit release. This fixes a few bugs that could
possibly affect some users. For details, see the metakit changelog at
the metakit home page: ttp://www.equi4.com/metakit/
david [Wed, 27 Mar 2002 11:42:09 +0000 (11:42 +0000)]
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.
david [Mon, 25 Mar 2002 19:56:48 +0000 (19:56 +0000)]
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.
david [Mon, 25 Mar 2002 19:50:32 +0000 (19:50 +0000)]
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.
david [Tue, 19 Mar 2002 16:07:47 +0000 (16:07 +0000)]
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.