Commit Graph
83 Commits
Author SHA1 Message Date
James Turner c4b4c0ce59 Make SGPath cache stat() information, cheers Fred
* cache exists/isDir/isFile in SGPath, to avoid
  repeated calls.
2010-08-09 08:19:14 +01:00
James Turner 2a2e2716bd Removal of PLIB/SG from SimGear 2010-08-07 13:55:33 +01:00
James Turner e99c3d4705 Collapse SGGeoCoord into SGTimeZone, and switch timezone search to cartesian math. 2010-07-29 10:12:00 +01:00
fredb 3dcffc7df8 MINGW patch from Benoît Laniel 2010-01-25 14:35:45 +01:00
Tim Moore 7e7ce2f38e Merge branch 'maint' into next 2009-05-18 00:34:06 +02:00
mfranz 1ccaf3a0bd fix leaks 2009-05-16 16:17:39 +02:00
fredb c2c4cad753 Compile under windows 2009-03-18 07:53:50 +01:00
mfranz 1eade74e5a warning-- 2009-03-18 07:53:50 +01:00
frohlich f1f0fa0aa9 Make use of posix clocks if available.
Have a more general timestamp implementation.
Very useful for higher accuracy timings.

Modified Files:
	simgear/structure/subsystem_mgr.cxx
	simgear/structure/subsystem_mgr.hxx
	simgear/timing/testtimestamp.cxx simgear/timing/timestamp.cxx
	simgear/timing/timestamp.hxx
2009-03-18 07:53:49 +01:00
durk e3fc89890c For the first time (no pun intended) in almost ten years time (again no
pun intended) that I'm touching the time library.

 Brian Schack reported that the traffic scheduler messes up the timestamps
 of the atlas network output. As it turns out, the c library functions
 asctime, and gmtime use a static copy of the tm struct to do the internal
 formatting. Our linux port of the SGTime class, incidentally, also stored
 it's master time stamp in this very same struct. Thus, formatting an
 arbitrary time value, would have the unwanted side effect of time travel.
 Usually, this would go unnoticed, because the actual time parameters would
 be updated before any damage could be done. But unwanted side effects, as
 in Brian's example could occur.

 On the MSVC port this appears to not have been a problem. Since that port
 used a copy of the tm struct to store it's master time stamps. Since the
 MSVC code also compiles cleanly on linux, it seems to be the way to go to
 use that approach. In addition, it also removes some conditional compile
 directives.

 I've only run a short test, but didn't see any undesirable side effects.
2009-01-28 07:46:55 +01:00
fredb ff72b68731 Remove unneeded inclusions of windows.h, GL.h and GLU.H 2008-07-27 15:15:33 +00:00
ehofman 733e6fa14f Reduce compiler.h to almost nothing (but it's worth keeping around I think, for
the MSVC and MipsPro warning stuff).

As a result of this patch, simgear/sg_traits.h can be deleted. So can SGCMath.h,
but I'll do that separately.

There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another mechnica
l change, replacing <math.h> with <cmath> and so on *everywhere*, but one step a
t a time)
2008-07-25 18:35:40 +00:00
ehofman d613e0a488 Patch to remove macintosh and MWERKS from Simgear. 2008-07-24 19:16:50 +00:00
mfranz 2dfc057135 replace exit() by throw sg_exception(). Of course, we have to be aware
that interdependencies between sg libs are generally unwelcome, but
sg_exception is a rather basic part, and it's already used by xml, props,
scene, sound and, of course, structure. Since props and xml are core
libs, we can assume that sg_exceptions are available.  (OK'ed by Curt)
2007-07-02 15:42:19 +00:00
frohlich 1a85dcd890 Modified Files:
simgear/timing/timestamp.hxx: Remove reimplemented default
	implementations
2006-10-31 05:33:48 +00:00
fredb 0dc9de81ae Add a simple program to benchmark SGTimeStamp::stamp() 2006-09-02 11:21:22 +00:00
fredb 5b8f42ce5e Make the SGTimeStamp behave under Windows just like for other environments 2006-08-31 18:26:45 +00:00
fredb b3262fcb80 Compile again on Win32 platforms 2006-06-16 10:03:38 +00:00
frohlich c5d677ac7b Small cleanups to the SGGeo[dc] classes, provide more hooks to use them directly 2006-06-15 08:27:31 +00:00
mfranz f96f083bb5 close zone.tab file after having read all entries 2006-03-14 12:58:28 +00:00
mfranz dcb95d131b - new FSF addresses
- coplied license headers from h(xx) files to respective c(xx) files
- removed trailing spaces
- fixe $Id$
- fixed typos
2006-03-08 18:16:08 +00:00
curt 61984730ac Add a small accessor function to expose local timezone offset. 2005-11-17 15:30:07 +00:00
curt f196d3bab8 Fix a small spelling mistake. 2005-11-15 21:43:34 +00:00
ehofman 37b4005d3e Alex Romosan:
* Use "const string&" rather than "string" in function calls when appropriate.
* Use "const Point3D&" instead of "Pint3D" in function calls when appropriate.
* Improved course calculation in calc_gc_course_dist()
* Safer thread handling code.

Vassilii Khachaturov:

Dont use "const Point3D&" for return types unless you're absolutely sure.

Erik Hofman:

* Use SGD_(2)PI(_[24]) as defined in simgear/constants.h rather than
  calculating it by hand every time.
2005-10-25 13:48:58 +00:00
ehofman 0035ef9194 Martin Spott: Use standardized Sun directive. 2005-10-06 11:06:27 +00:00
ehofman 3583c13339 Vivian Meazza:
After much trial and tribulation, Harald came up with a fix for the bug
which has been plaguing Cygwin for a couple of weeks now.

It's only a couple of lines. I've tested it exhaustively, and it seems to
cure the problem of Cygwin failing to start.
2005-09-05 13:30:38 +00:00
ehofman 19623cac21 Cygwin fix. 2005-08-10 08:04:39 +00:00
curt f30c4720ae Update a few more instances of my email address. 2004-11-19 21:47:05 +00:00
curt 7fc8c02688 My old email address is no longer valid ... point to my web page. 2004-11-19 21:44:16 +00:00
curt f8201e6478 Make sky dome scaling values sensible (i.e. the sky dome will now fill up
the dimensions provided.)  We draw the sky dome before everything else
  and draw it with depth buffer off so it really doesn't matter, but it just
  makes a little more sense this way.
Updated a few doxygen comments.
2003-06-09 20:19:52 +00:00
curt 51ef4568dd Various documentation tweaks and additions. 2003-06-03 18:32:51 +00:00
ehofman 8be760b594 Convert char* to string to prevent stdup/malloc/free 2003-05-19 15:40:11 +00:00
david 7379d8a54d Patches from Erik Hofman (for Irix? I've lost the original message). 2003-03-02 14:52:05 +00:00
curt a885314a39 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.
2002-08-25 17:31:47 +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
curt c985d8846d tweak. 2002-04-20 20:53:54 +00:00
curt b751188e56 string == "" -> string.empty() conversion. 2002-04-03 02:34:20 +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 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
curt 7a65a990ba Decouple sg_time code from the current time(NULL), i.e. you can run the
time calculations for an alternate calendar time (i.e. if the application
is being driven from an external source of data.)

Fix a bug in sg_binobj.cxx which disrupted the 'broken down time' globally
for the entire application.
2002-02-11 22:27:27 +00:00
curt 8c41081a5c This code had been written to assume current clock time. Added options
to allow specifying an alternate clock time.
2002-02-10 03:16:03 +00:00
curt b1c4d34eef Fix for FreeBSD. 2002-02-06 01:04:38 +00:00
curt 15399bfe95 Various mingwin patches contributed by Norman Vine. 2002-02-04 22:38:23 +00:00
curt 45d3e19c38 Small tweaks to class initialization. 2001-12-28 23:37:34 +00:00
curt 5bab565cfe Updates to build system to better support automake-1.5
- automake-1.4 sets default values for INCLUDES which we can't
  overwrite.
- automake-1.5 renames this to DEFAULT_INCLUDES and leaves INCLUDES
  open for the developer to use.

Thus for automake-1.4 we are forced to 'append' to INCLUDES and in
automake-1.5 we can just set the value to whatever we like.
Unfortunately, the behaviors of the two versions are mutually
incompatible.

The solution I am committing now works for both versions but
automake-1.5 generates a lot of spurious warning messages that are
annoying, but not fatal.
2001-12-28 21:27:19 +00:00
david 6f1bfa202e -Added .cvsignore files to clean up CVS messages 2001-12-12 02:44:37 +00:00
curt d100ca485f Doh! fixed a typo ... 2001-12-10 00:24:51 +00:00
curt 35ab6900ee [Hopefully] fix a line ending problem that surfaces in MSVC. 2001-12-09 03:54:46 +00:00
curt 74f10486bc In certain degenerate situations on the FlightGear side when the flight
model math blows up, the lat/lon could be nan.  Thus updateLocal() could
potentially called with nan arguments if FlightGear is reiniting from a
blown up state.  This is a bug in FlightGear, but I've added a simple
check to catch this so updateLocal() is robust if called under these
circumstances.
2001-12-05 22:31:03 +00:00
curt eca2afb982 Various changes for MingWin32 support. 2001-08-02 22:56:33 +00:00