Commit Graph

984 Commits

Author SHA1 Message Date
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
curt
7769447283 Fixed a couple minor compiler warnings. 2002-07-03 17:35:49 +00:00
david
d6a790cf13 MSVC++ bug work-around from Frederic Bouvier. 2002-07-03 02:06:23 +00:00
curt
033c66363d Fixes for IA-64 with Intel compiler. 2002-07-02 18:44:20 +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
curt
fb54e9e103 Include the autogen.sh script in the distribution. 2002-05-23 13:46:19 +00:00
david
3a835dde7d Skip drawing clear cloud layers. 2002-05-17 16:53:19 +00:00
curt
128a4a36ca Bernie Bright:
I've defined snprintf as _snprintf in compiler.h for MSVC and MINGW
targets and removed duplicate definitions from FG sources.
2002-05-17 14:38:03 +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
curt
786b1e3a30 Removed SG_STATIC_CONST define. 2002-05-16 02:44:35 +00:00
curt
d5f38a558e Minor tweaks. 2002-05-16 02:30:06 +00:00
curt
ce5d4b7db8 Erik Hofman:
Some small patches to make the code Irix/Muli platform compatible and
one small fix to make it plib-1.4.2 compatible also.
2002-05-15 19:21:54 +00:00
curt
8c0b36fe9e Added SG_COMPILER macro. This is a string that identifies the build
compiler and version.  It might be useful to display it during program
startup.
2002-05-14 18:59:03 +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
curt
761b7b9354 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.
2002-05-10 13:53:22 +00:00
curt
6a3d1895d9 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.
2002-05-10 13:32:44 +00:00
curt
d1178a26ce Updated MSVC project files. 2002-05-10 13:31:44 +00:00
curt
8ffdfa3cb1 Make the skydome interface a little more flexible so we can scale the dome
for other applications.
2002-04-27 03:19:45 +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
curt
c616568830 Make sure README.MSVC goes in the distribution. 2002-04-23 01:56:51 +00:00
curt
995d2c1ede Make sure zlib.dsp goes in the distribution. 2002-04-23 01:55:48 +00:00
curt
051a5e9a38 Updated am2dsp.cfg file for creating MSVC project files.
New README.MSVC.
New src-libs/zlib.dsp for building zlib.
2002-04-22 20:37:31 +00:00
curt
60d89097de Bump up version number, remove boost from src-libs/Makefile.am 2002-04-20 22:03:35 +00:00
curt
6c35255549 Updated for 0.0.18. 2002-04-20 21:06:05 +00:00
curt
c985d8846d tweak. 2002-04-20 20:53:54 +00:00