Compare commits

...

76 Commits

Author SHA1 Message Date
curt
3b6af2f0c2 Ready for 0.3.8 release. 2005-01-18 14:34:13 +00:00
curt
5bdff41641 Require plib-1.8.4 2005-01-17 21:48:05 +00:00
ehofman
67e9d105cb Use the double precission pow() function to get Solaris compiling. 2005-01-16 08:52:22 +00:00
ehofman
f1fc99f16f Solaris fix 2005-01-15 14:24:28 +00:00
ehofman
f89e359d53 Solaris fix. 2005-01-15 14:22:56 +00:00
ehofman
77ec170a50 MingW/MSYS fix 2005-01-15 14:18:30 +00:00
ehofman
34320f5f20 Eliminate some compiler warnings about converting float to int. 2005-01-15 11:57:34 +00:00
ehofman
a26271e46e Add a make_bumpmap and a make_maxcolorwindow function, modify the make_normalmap function to maximize the color window before proceding. 2005-01-15 10:48:40 +00:00
ehofman
e2e7466250 Add support for contrast. 2005-01-14 15:52:56 +00:00
ehofman
1e24cc4643 little endian fixes. 2005-01-14 14:27:57 +00:00
ehofman
dfc23c3528 Add a make_grayscale function and call it from make_normalmap automatically, removing the need to do it make_grayscale prior to calling make_normalmap. 2005-01-14 13:36:38 +00:00
ehofman
cd11a5dc27 Fix a mistake. 2005-01-14 13:12:44 +00:00
ehofman
899734296b Add a function to calculate the normalmap from a regular texture. 2005-01-14 13:08:57 +00:00
ehofman
7a3a81c152 RGBA textures can be made monochrome also 2005-01-14 10:12:00 +00:00
ehofman
e62a4a05ac Fix a few bugs and add a make_monochrome() function 2005-01-14 10:09:21 +00:00
ehofman
463ca207ce Some small updates to the saving code. 2005-01-13 18:35:56 +00:00
ehofman
da6e1b31ea Fix a crash situation. 2005-01-13 18:05:46 +00:00
ehofman
8c783b1680 Update the code a bit more, add a function to retreive the last error string and add a function to write SGI texture fils. 2005-01-13 14:47:31 +00:00
curt
efce88ff12 - Fix a couple oops's in cloud.cxx
- In sky.cxx blend low density cloud layers (few/scattered) into nothing (but
  don't touch visibility distance) as we approach them so we can fly through
  clean.
- For high density cloud layers (broken/overcast) we do not fade the layers
  out, but we fade visibility to nearly nothing as we approach the layer.
2005-01-11 16:02:39 +00:00
curt
01608b7e18 Add a method to SGCloudLayer to set overall cloud alpha. This gives us the
capability to slowly fade a cloud layer in or out.

We use this effect in combination with lowering visibility as we approach
a cloud layer to hide the fact that it is simply a 2d textured polygon being
drawn across the sky.
2005-01-11 15:21:58 +00:00
david
a5f0e0395a Do not reduce visibility when passing through a 'few' or 'scattered'
cloud layer (i.e. <50% coverage).  This is a quick hack rather than a
proper fix, but it will at least make it possible to get above a
scattered layer VFR.
2005-01-10 23:34:52 +00:00
ehofman
0b723174fd Add support for binding a thread to a specific CPU (IRIX only at this time). 2005-01-09 10:24:54 +00:00
ehofman
5d248bf0df Frederic Bouvier:
It comes to me that the bulk of all problem reports, especially from Windows users, have it's cause in an obsolete sound driver. These messages should direct them to the right solution before complaining.
2005-01-08 11:47:19 +00:00
curt
c039ccdeb0 Updates for 0.3.8-pre2 release. 2005-01-03 19:05:32 +00:00
ehofman
d88fb32a73 Melchior FRANZ:
My recent fix for the load/save fgfs.sav feature was a bit too ambitious.
While aliases lead to abortion before, I tried to copy them properly,
although this wasn't a requirement. Unfortunately, this seems to have
worked for absolute aliases only, not for relative ones, and hence broke
several panel instruments. The attached patch backs most of the previous
patch out again, and goes a simpler route: just ignore aliases.
2004-12-23 13:32:01 +00:00
ehofman
37ac409586 Melchior FRANZ:
fgLoadFlight() loads a property file ("fgfs.sav") to a new property tree,
and then copies that over to the main tree. copyProperties() didn't know
how to handle type SGPropertyNode::ALIAS and hence threw an exception that
made fgfs abort.

The attached patch adds support for ALIAS to copyProperties(): aliased
nodes are created in the target tree if necessary, and then linked like in
the source tree. It seemed useful to add an optional argument to
props.[ch]xx/getType() that would indeed return the property type "ALIAS"
for aliased nodes, and not the type of the node that it refers to. The patch
also fixes a bug in writeNode() that caused extra lines after alias entries.

If there's resistance to the change to getType() (David?) I can easily use
isAlias(). This just makes copyProperties() a tad uglier, but I can live with
it. It's useful for scanning a tree, though, if an alias node can be treated
exactly like all other nodes, without automatic redirection.
2004-12-19 10:19:14 +00:00
ehofman
7b24e94c66 gcc 4.0 fix. 2004-12-18 10:53:54 +00:00
ehofman
e12cd2a50c Initialize volume to inaudiable at startup. 2004-12-16 13:15:13 +00:00
curt
98b2ba4fc1 More prerelease updates. 2004-12-15 16:45:57 +00:00
curt
2f0afdccc1 Prerelease updates. 2004-12-15 16:34:14 +00:00
ehofman
79734df554 Threads detection code cleanup and FreeBSD fixes. 2004-12-13 20:31:44 +00:00
ehofman
c52657fa1a This was too quick, now pthreads isn't detected on IRIX (and other platforms?) anymore. This needs some more thought. 2004-12-08 15:12:11 +00:00
ehofman
9cac8409cd FreeBSD fix. 2004-12-08 15:00:45 +00:00
ehofman
18703ce02d AIX fix 2004-12-05 09:36:49 +00:00
curt
709a166bd6 Oops, 2nd try ... 2004-12-02 15:08:54 +00:00
curt
8048e6297c Martin Spott: Revised handling of missing isnan() on earlier versions of
FreeBSD.
2004-12-02 15:00:26 +00:00
curt
fb0dded103 Fix a typo for the Mac OSX platform. 2004-12-01 17:37:43 +00:00
curt
055e969e7a Fix a dumb bug. 2004-11-21 21:46:02 +00:00
curt
f10db8a30e Fix a dumb bug for FreeBSD. 2004-11-21 21:45:35 +00:00
ehofman
c19af3525e Melchior FRANZ:
At last I've found the reason why fgfs crashed routinely for me. When I still
used KDE's artsdsp (preloads lib with OSS replacement functions) I saw
this crash only occasionally. After letting OpenAl communicate with artsd
directly (by means of ~/.openalrc setting), I got the crash always when
I left fgfs.

This bug may also have crashed fgfs when running with sound daemons other than
aRts.
2004-11-21 17:05:42 +00:00
curt
7c60ccfc35 I don't understand why FreeBSD doesn't see isnan() after including math.h
but it doesn't.  Trying the apple approach to fixing isnan results in an
infinite loop (making me wonder what happens on OSX?)  This is an alternative
approach to checking isnan() on freebsd ...
2004-11-21 03:13:54 +00:00
curt
84cba33aab FreeBSD fix. 2004-11-20 19:11:08 +00:00
ehofman
a52b1ec64f MSVC fix. 2004-11-20 12:35:28 +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
54a7a0d534 Ooops, fix an unintentional line wrap. 2004-11-18 19:12:17 +00:00
curt
8d73160a75 Abstract out location of gl.h, glut.h, and glu.h includes so that we can
make the Mac platform happy since they put these in a different place compared
to the rest of the world.
2004-11-18 19:10:34 +00:00
andy
ff10602c65 Make sure that timer delay values are positive-definite, otherwise
user code that wants to use zero delay to mean "next frame" will get
stuck in an infinite loop.
2004-11-17 19:37:45 +00:00
ehofman
ca50fe386d Roy Vegard Ovesen:
I've added two new debug log types for the instrumentation and systems. They
used to use the autopilot debug log, because I couldn't figure out how to
make new log types. Well, now I have figured it out.  ;-)
2004-10-24 09:29:56 +00:00
ehofman
39f3c6e41d Frederic Bouvier:
This is a patch to make display list usage optional. They are on by default.
Use --prop:/sim/rendering/use-display-list=false to use immediate mode.
There is also a change in exception handling in main.cxx and bootstrap.cxx
2004-10-17 17:06:50 +00:00
ehofman
ba1b96e518 Roy Vegard Ovesen:
I'm working on a route manager in the GPS module. So I've added a name
parameter to the waypoint class in Simgear. I use the existing ID parameter
to store the ID, for example KLAX, and the name parameter to store the name,
San Francisco Intl.
2004-10-16 12:23:53 +00:00
ehofman
ef486b2cc6 Remove the refference to fgsg 2004-10-14 13:35:11 +00:00
curt
06f3cb4f8e Fix a couple bugs in openal detection. I should actually generate a new
configure and test it, rather than testing the old configure script.
2004-10-13 20:18:35 +00:00
curt
074f5ff996 Oops, missed a part of the previous change. 2004-10-13 19:52:13 +00:00
curt
8c26f32d5f Add a sanity check for the existance of OpenAL. If not there, bail from
the configure script with an appropriate/helpful message.
2004-10-13 19:51:38 +00:00
curt
9a2ee54389 Final 0.3.7 changes. 2004-10-12 14:35:42 +00:00
ehofman
ab69c03698 Fix a typo. 2004-10-11 07:56:08 +00:00
ehofman
fab1f4e7a0 Frederic: Ignore display lists when using the blend animation. 2004-10-11 07:37:42 +00:00
ehofman
41eed484c1 Adding the panel was a step too far for Linux, causing a segfault. 2004-10-10 19:38:46 +00:00
ehofman
7d18f9bdde Remove a phantom makeDList call (probably an old one from my code. 2004-10-10 19:16:25 +00:00
ehofman
3a48c3de7a Check for the plib version when using display lists, just to be sure. 2004-10-10 19:05:25 +00:00
ehofman
d769a9936b Frederic: Include FGPanelNode in the display list generation process. 2004-10-10 18:43:11 +00:00
ehofman
1697cb3b1a Frederic: Use display lists for 3d models also. 2004-10-10 17:49:27 +00:00
ehofman
62aa32a417 Reverse the declaration order. jpgRenderFrame (formerly known as trRenderFrame) is now declared as a NULL function pointer and assignment of the proper function is now done in FlightGear (jpgRenderFrame=FGRenderer::update). 2004-10-06 09:57:31 +00:00
ehofman
a0d0852838 David Luff:
The one-liner removes a lot of re-definition warnings on Cygwin.
2004-09-30 09:43:11 +00:00
ehofman
2f479cae69 Small update for future use. 2004-09-19 09:08:12 +00:00
curt
4820d57fa8 Expose the size() method for locked and blocking thread queues. 2004-09-15 15:28:58 +00:00
curt
04e3b0b3c1 Fix another case where the direction vector is not initialized which can
lead to openal "inrange" assertions, crashing FlightGear.
2004-09-15 15:28:14 +00:00
curt
a7f78b9f68 direction vector needs to be initialized, otherwise garbage data could cause
openal to generate an assertion, aborting the top level app.
2004-09-10 20:44:42 +00:00
curt
f3d8eb4665 Tweaks for 0.3.7-pre1 2004-09-10 18:16:06 +00:00
curt
090f79b951 Add support for parsing an xml stream from an in memory buffer, rather than
just from a specified file name.
2004-09-10 15:57:52 +00:00
ehofman
88c0dbf661 Add support for audio orientation: direction and cone definition. This currently only works for internal view and tower view because those set the listener position correctly. 2004-09-08 11:15:57 +00:00
ehofman
9e3822ceaf Remove a left over of ancient times. 2004-08-19 12:18:20 +00:00
ehofman
007b0a8fe6 this simple patch will enable the direct use of Point3D::get_n() instead of making duplications to call sgCartToGeod 2004-08-17 08:31:51 +00:00
ehofman
7f0ebf8871 this simple patch will prevent to have fog in Clear cload layers. 2004-08-17 08:28:35 +00:00
ehofman
5414e94a1a change the log level of the initialization of OpenAL. This prevent a console popup for no reason on Windows. 2004-08-15 09:24:12 +00:00
123 changed files with 1017 additions and 270 deletions

View File

@@ -22,7 +22,7 @@ PROJECT_NAME = SimGear
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.3.6
PROJECT_NUMBER = 0.3.8
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

View File

@@ -10,7 +10,7 @@ EXTRA_DIST = \
SUBDIRS = src-libs simgear
dist-hook:
(cd $(top_srcdir); $(HOME)/projects/FlightGear-0.9/admin/am2dsp.pl)
(cd $(top_srcdir); $(HOME)/Projects/FlightGear-0.9/admin/am2dsp.pl)
#
# Rule to build RPM distribution package

36
NEWS
View File

@@ -1,3 +1,39 @@
New in 0.3.8
* January 18, 2005
* Configure script does a sanity check for the existance of openal.
* Better pthreads detection for FreeBSD.
* Abstract out the location of gl.h, glu.h, and glut.h so we can more
easily support MacOS which puts these in an oddball location.
* Added two new debug output types for instrumentation and systems.
* Add a name parameter to the waypoint class for supporting a route
manager in the flightgear gps module.
* Make display list usage optional.
* Event manager: specifying a zero delay will force event execution in
the next frame rather than entering an infinite loop.
* gcc-4.0 fix.
* Fixes to property tree loading and saving.
* Make volume inaudible at startup.
* Solaris fixes.
* For low density cloud coverages, blend the layer to nothing as we pass
through instead of fully engulfing the aircraft in the cloud.
* Add several new capabilities to the texture management code for building
normal maps and doing some simple on-the-fly effects on textures.
* Better error message for sound problems.
* Add support for binding a thread to a specific CPU.
New in 0.3.7
* October 12, 2004
* Add support for parsing xml from an in memory buffer, not just a file.
* Don't reduce visibility for a "clear" cloud layer.
* Add support for audio orientation (direction and cone) for internal
view and tower view.
* Add support for drawing from display lists rather than in immediate mode.
This provides a big performance improvement on many systems.
New in 0.3.6
* July 29, 2004

12
README.OpenAL Normal file
View File

@@ -0,0 +1,12 @@
[This file is mirrored in both the FlightGear and SimGear packages.]
You *must* have the development components of OpenAL installed on your system
to build FlightGear!" You can get a copy here:
http://www.openal.org
Build notes:
The OpenAL developers do not make "versioned" releases so we recommend that
you pull the latest version via anonymous CVS (follow the instructions at
the OpenAL web site) and build/install that.

4
Thanks
View File

@@ -90,7 +90,7 @@ David Megginson <david@megginson.com>
SimGear property manager/registry
Curt Olson <curt@flightgear.org>
Curt Olson http://www.flightgear.org/~curt/
Curt is responsible for overall project and source code management.
He has his hands in many of the areas.
@@ -175,7 +175,7 @@ NOTE:
----
THIS DOCUMENT WAS INITIALLY WRITTEN BY
Curt L. Olson <curt@flightgear.org>
Curt L. Olson <http://www.flightgear.org/~curt>
05 Jul 2000 Removed non-SimGear entries (CLO)

View File

@@ -1,7 +1,5 @@
dnl Process this file with autoget.sh to produce a working configure
dnl script.
dnl
dnl $Id$
AC_INIT
AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx])
@@ -10,7 +8,7 @@ dnl Require at least automake 2.52
AC_PREREQ(2.52)
dnl Initialize the automake stuff
AM_INIT_AUTOMAKE(SimGear, 0.3.6)
AM_INIT_AUTOMAKE(SimGear, 0.3.8)
dnl Specify KAI C++ compiler and flags.
dnl Borrowed with slight modification from blitz distribution.
@@ -165,33 +163,18 @@ dnl Checks for libraries.
dnl Thread related checks
AC_CHECK_HEADER(pthread.h)
AC_CHECK_LIB(pthread, pthread_exit)
if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
AC_SEARCH_LIBS(pthread_exit, [pthread c_r])
if test "x$ac_cv_header_pthread_h" = "xyes"; then
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
CFLAGS="$CFLAGS -D_REENTRANT"
fi
if test "x$ac_cv_lib_pthread_pthread_exit" != "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
dnl FreeBSD: System has pthread.h, but -lpthread library check
dnl fails. See if we need -pthread instead of -lpthread and look
dnl for the functions in libc_r.
save_CXXFLAGS="$CXXFLAGS"
save_CFLAGS="$CFLAGS"
if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
CXXFLAGS="-pthread $CXXFLAGS"
CFLAGS="-pthread $FLAGS"
save_LIBS=$LIBS
AC_CHECK_LIB(c_r, pthread_exit)
if test "x$ac_cv_lib_c_r_pthread_exit" != "xyes"; then
CXXFLAGS=$save_CXXFLAGS
CFLAGS=$save_CFLAGS
else
dnl This is cheating a bit. pthread_exit comes with using -pthread, not
-lpthread
ac_cv_lib_pthread_pthread_exit="yes"
fi
LIBS=$save_LIBS
fi
fi
AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes")
AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_header_pthread_h" = "xyes")
thread_LIBS="$LIBS"
LIBS=""
@@ -271,6 +254,7 @@ opengl_LIBS="$LIBS"
LIBS="$base_LIBS"
dnl check for OpenAL libraries
OPENAL_OK="no"
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
dnl CygWin under Windoze.
@@ -278,23 +262,43 @@ case "${host}" in
AC_SEARCH_LIBS(alGenBuffers, openal32)
AC_SEARCH_LIBS(alutInit, [ openal32 ALut ] )
LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
openal_LIBS="$LIBS"
OPENAL_OK="$ac_cv_search_alGenBuffers"
;;
*-apple-darwin*)
dnl Mac OS X
LIBS="$LIBS -framework IOKit -framework OpenAL"
openal_LIBS="$LIBS"
# not sure how to test if OpenAL exists on MacOS (does it come by default?)
OPENAL_OK="yes"
;;
*)
dnl default unix style machines
save_LIBS=$LIBS
LIBS="$LIBS $thread_LIBS"
AC_SEARCH_LIBS(alGenBuffers, openal)
OPENAL_OK="$ac_cv_search_alGenBuffers"
openal_LIBS="$LIBS"
LIBS=$save_LIBS
;;
esac
openal_LIBS="$LIBS"
if test "$OPENAL_OK" == "no"; then
echo
echo "You *must* have the openal library installed on your system to build"
echo "SimGear!"
echo
echo "Please see README.OpenAL for more details."
echo
echo "configure aborted."
exit
fi
LIBS="$base_LIBS"
AC_SUBST(base_LIBS)
@@ -325,11 +329,11 @@ if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
exit
fi
AC_MSG_CHECKING([for plib 1.6.0 or newer])
AC_MSG_CHECKING([for plib 1.8.4 or newer])
AC_TRY_RUN([
#include <plib/ul.h>
#define MIN_PLIB_VERSION 160
#define MIN_PLIB_VERSION 184
int main() {
int major, minor, micro;
@@ -344,7 +348,7 @@ int main() {
],
AC_MSG_RESULT(yes),
[AC_MSG_RESULT(wrong version);
AC_MSG_ERROR([Install plib 1.6.0 or later first...])],
AC_MSG_ERROR([Install plib 1.8.4 or later first...])],
AC_MSG_RESULT(yes)
)
@@ -455,7 +459,7 @@ else
echo "Without JPEG Factory support"
fi
if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
if test "x$ac_cv_header_pthread_h" = "xyes"; then
echo "Threads: pthread lib found."
else
echo "Threads: no threads (pthread lib not found.)"

View File

@@ -3,7 +3,7 @@
*
* Written by Curtis L. Olson, started February 1999.
*
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
* Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View File

@@ -3,7 +3,7 @@
*
* Written by Curtis L. Olson, started February 1999.
*
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
* Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View File

@@ -121,7 +121,7 @@
# define STL_STRSTREAM <strstream>
# endif
# elif __GNUC__ == 3
# elif __GNUC__ >= 3
// g++-3.0.x
# define SG_EXPLICIT_FUNCTION_TMPL_ARGS
# define SG_NEED_AUTO_PTR
@@ -336,7 +336,9 @@
extern void *memmove(void *, const void *, size_t);
# endif // __cplusplus
# define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
# if !defined( __GNUC__ )
# define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
# endif
#endif // sun
@@ -364,6 +366,23 @@
#endif // __ICC
//
// Platform dependent gl.h and glut.h definitions
//
#ifdef __APPLE__
# define SG_GL_H <OpenGL/gl.h>
# define SG_GLU_H <OpenGL/glu.h>
# define SG_GLEXT_H <OpenGL/glext.h>
# define SG_GLUT_H <GLUT/glut.h>
#else
# define SG_GL_H <GL/gl.h>
# define SG_GLU_H <GL/glu.h>
# define SG_GLEXT_H <GL/glext.h>
# define SG_GLUT_H <GL/glut.h>
#endif
//
// No user modifiable definitions beyond here.
//

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started February 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt/
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -25,7 +25,9 @@ typedef enum {
SG_NETWORK = 0x00004000,
SG_ATC = 0x00008000,
SG_NASAL = 0x00010000,
SG_UNDEFD = 0x00020000, // For range checking
SG_INSTR = 0x00020000,
SG_SYSTEMS = 0x00040000,
SG_UNDEFD = 0x00080000, // For range checking
SG_ALL = 0xFFFFFFFF
} sgDebugClass;

View File

@@ -3,7 +3,7 @@
//
// Written by Curtis Olson, started March 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -7,7 +7,7 @@
// All the core code underneath this is written by Durk Talsma. See
// the headers of all the other individual files for details.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -48,7 +48,7 @@
/** Ephemeris class
*
* Written by Durk Talsma <d.talsma@direct.a2000.nl> and Curtis Olson
* <curt@flightgear.org>
* <http://www.flightgear.org/~curt>
*
* Introduction
*

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started March 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started March 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -4,7 +4,7 @@
// Shamelessly adapted from plib (plib.sourceforge.net) January 2001
//
// Original version Copyright (C) 2000 the plib team
// Local changes Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Local changes Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@@ -4,7 +4,7 @@
// Shamelessly adapted from plib January 2001
//
// Original version Copyright (C) 2000 the plib team
// Local changes Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Local changes Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started January 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started January 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -4,7 +4,7 @@
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -3,7 +3,7 @@
// Written by Curtis Olson, started November 1999.
// Modified by Bernie Bright <bbright@bigpond.net.au>, May 2002.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started November 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started November 2001.
//
// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started July 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started July 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -4,7 +4,7 @@
//
// Written by Curtis Olson, started April 1998.
//
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -6,7 +6,7 @@
// Written by Curtis Olson, started April 1998.
//
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started September 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started September 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started September 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -8,7 +8,7 @@
* Adapted from algebra3 by Jean-Francois Doue, started October 1998.
*/
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started June 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started June 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -108,7 +108,7 @@ static double seaLevelRadius(double r, double z)
// starts making very poor guesses as to latitude. As altitude
// approaches infinity, it should be guessing with geocentric
// coordinates, not "local geodetic up" ones.
void sgCartToGeod(double* xyz, double* lat, double* lon, double* alt)
void sgCartToGeod(const double* xyz, double* lat, double* lon, double* alt)
{
// The error is expressed as a radian angle, and we want accuracy
// to 1 part in 2^50 (an IEEE double has between 51 and 52

View File

@@ -42,7 +42,7 @@ void sgGeodToGeoc(double lat_geod, double alt,
* @param lon (out) Longitude, in radians
* @param alt (out) Altitude, in meters above the WGS84 ellipsoid
*/
void sgCartToGeod(double* xyz, double* lat, double* lon, double* alt);
void sgCartToGeod(const double* xyz, double* lat, double* lon, double* alt);
/**
* Convert a cartesian point to a geodetic lat/lon/altitude.

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started July 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started July 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started March 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started December 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started December 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -1,3 +0,0 @@
.deps
Makefile
Makefile.in

View File

@@ -3,7 +3,7 @@
//
// Written by Curtis L. Olson, started April 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -6,7 +6,7 @@
// Written by Curtis L. Olson, started April 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started March 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started March 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -561,7 +561,7 @@ public:
* Property value types.
*/
enum Type {
NONE,
NONE = 0,
ALIAS,
BOOL,
INT,

View File

@@ -322,6 +322,23 @@ readProperties (const string &file, SGPropertyNode * start_node)
}
/**
* Read properties from an in-memory buffer.
*
* @param buf A character buffer containing the xml data.
* @param size The size/length of the buffer in bytes
* @param start_node The root node for reading properties.
* @return true if the read succeeded, false otherwise.
*/
void readProperties (const char *buf, const int size,
SGPropertyNode * start_node)
{
PropsVisitor visitor(start_node, "");
readXML(buf, size, visitor);
if (visitor.hasException())
throw visitor.getException();
}
////////////////////////////////////////////////////////////////////////
// Property list writer.
@@ -466,7 +483,7 @@ writeNode (ostream &output, const SGPropertyNode * node,
}
// If there are children, write them next.
if (nChildren > 0 || node->isAlias()) {
if (nChildren > 0) {
doIndent(output, indent);
output << '<' << name;
writeAtts(output, node);
@@ -563,6 +580,8 @@ copyProperties (const SGPropertyNode *in, SGPropertyNode *out)
retval = false;
break;
default:
if (in->isAlias())
break;
string message = "Unknown internal SGPropertyNode type";
message += in->getType();
throw sg_error(message, "SimGear Property Reader");

View File

@@ -41,6 +41,13 @@ void readProperties (istream &input, SGPropertyNode * start_node,
void readProperties (const string &file, SGPropertyNode * start_node);
/**
* Read properties from an in-memory buffer.
*/
void readProperties (const char *buf, const int size,
SGPropertyNode * start_node);
/**
* Write properties to an XML output stream.
*/

View File

@@ -29,12 +29,13 @@
// Constructor
SGWayPoint::SGWayPoint( const double lon, const double lat, const double alt,
const modetype m, const string s ) {
const modetype m, const string s, const string n ) {
target_lon = lon;
target_lat = lat;
target_alt = alt;
mode = m;
id = s;
name = n;
}

View File

@@ -76,6 +76,7 @@ private:
double distance;
string id;
string name;
public:
@@ -86,10 +87,11 @@ public:
* @param alt target altitude
* @param mode type of coordinates/math to use
* @param s waypoint identifier
* @param n waypoint name
*/
SGWayPoint( const double lon = 0.0, const double lat = 0.0,
const double alt = 0.0, const modetype m = WGS84,
const string s = "" );
const string s = "", const string n = "" );
/** Destructor */
~SGWayPoint();
@@ -153,6 +155,9 @@ public:
/** @return waypoint id */
inline string get_id() const { return id; }
/** @return waypoint name */
inline string get_name() const { return name; }
};

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started May 1998.
//
// Copyright (C) 1998 - 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1998 - 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -4,7 +4,7 @@
// Written by Curtis Olson, started May 1998.
// Overhauled by David Megginson, December 2001
//
// Copyright (C) 1998 - 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1998 - 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started May 1998.
//
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -33,12 +33,12 @@
# include <windows.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/structure/exception.hxx>
#include SG_GL_H
#include <string.h>
#include STL_STRING

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started May 1998.
//
// Copyright (C) 1998 - 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1998 - 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by David Megginson, started May 1998.
//
// Copyright (C) 1998 - 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1998 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by David Megginson, December 2001
//
// Copyright (C) 1998 - 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1998 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -3,7 +3,7 @@
// Written by Jim Wilson, David Megginson, started April 2002.
// Based largely on code by Curtis Olson and Norman Vine.
//
// Copyright (C) 2002 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -12,6 +12,7 @@
#include <string.h> // for strcmp()
#include <vector>
#include <set>
#include <plib/sg.h>
#include <plib/ssg.h>
@@ -26,8 +27,9 @@
#include "model.hxx"
SG_USING_STD(vector);
SG_USING_STD(set);
bool sgUseDisplayList = true;
////////////////////////////////////////////////////////////////////////
// Global state
@@ -122,8 +124,10 @@ sgMakeAnimation( ssgBranch * model,
vector<SGPropertyNode_ptr> &name_nodes,
SGPropertyNode *prop_root,
SGPropertyNode_ptr node,
double sim_time_sec )
double sim_time_sec,
set<ssgBranch *> &ignore_branches )
{
bool ignore = false;
SGAnimation * animation = 0;
const char * type = node->getStringValue("type", "none");
if (!strcmp("none", type)) {
@@ -152,6 +156,7 @@ sgMakeAnimation( ssgBranch * model,
animation = new SGTexMultipleAnimation(prop_root, node);
} else if (!strcmp("blend", type)) {
animation = new SGBlendAnimation(prop_root, node);
ignore = true;
} else if (!strcmp("alpha-test", type)) {
animation = new SGAlphaTestAnimation(node);
} else if (!strcmp("flash", type)) {
@@ -204,10 +209,26 @@ sgMakeAnimation( ssgBranch * model,
branch->setUserData(animation);
branch->setTravCallback(SSG_CALLBACK_PRETRAV, animation_callback);
branch->setTravCallback(SSG_CALLBACK_POSTTRAV, restore_callback);
if ( ignore ) {
ignore_branches.insert( branch );
}
}
}
static void makeDList( ssgBranch *b, const set<ssgBranch *> &ignore )
{
int nb = b->getNumKids();
for (int i = 0; i<nb; i++) {
ssgEntity *e = b->getKid(i);
if (e->isAKindOf(ssgTypeLeaf())) {
((ssgLeaf*)e)->makeDList();
} else if (e->isAKindOf(ssgTypeBranch()) && ignore.find((ssgBranch *)e) == ignore.end()) {
makeDList( (ssgBranch*)e, ignore );
}
}
}
////////////////////////////////////////////////////////////////////////
@@ -257,7 +278,6 @@ sgLoad3DModel( const string &fg_root, const string &path,
if (model == 0)
throw sg_exception("Failed to load 3D model");
}
// Set up the alignment node
ssgTransform * alignmainmodel = new ssgTransform;
if ( load_panel == 0 )
@@ -275,18 +295,6 @@ sgLoad3DModel( const string &fg_root, const string &path,
unsigned int i;
if ( load_panel ) {
// Load panels
vector<SGPropertyNode_ptr> panel_nodes = props.getChildren("panel");
for (i = 0; i < panel_nodes.size(); i++) {
SG_LOG(SG_INPUT, SG_DEBUG, "Loading a panel");
ssgEntity * panel = load_panel(panel_nodes[i]);
if (panel_nodes[i]->hasValue("name"))
panel->setName((char *)panel_nodes[i]->getStringValue("name"));
model->addKid(panel);
}
}
// Load sub-models
vector<SGPropertyNode_ptr> model_nodes = props.getChildren("model");
for (i = 0; i < model_nodes.size(); i++) {
@@ -310,13 +318,32 @@ sgLoad3DModel( const string &fg_root, const string &path,
}
// Load animations
set<ssgBranch *> ignore_branches;
vector<SGPropertyNode_ptr> animation_nodes = props.getChildren("animation");
for (i = 0; i < animation_nodes.size(); i++) {
const char * name = animation_nodes[i]->getStringValue("name", 0);
vector<SGPropertyNode_ptr> name_nodes =
animation_nodes[i]->getChildren("object-name");
sgMakeAnimation( model, name, name_nodes, prop_root, animation_nodes[i],
sim_time_sec);
sim_time_sec, ignore_branches);
}
#if PLIB_VERSION > 183
if ( model != 0 && sgUseDisplayList ) {
makeDList( model, ignore_branches );
}
#endif
if ( load_panel ) {
// Load panels
vector<SGPropertyNode_ptr> panel_nodes = props.getChildren("panel");
for (i = 0; i < panel_nodes.size(); i++) {
SG_LOG(SG_INPUT, SG_DEBUG, "Loading a panel");
ssgEntity * panel = load_panel(panel_nodes[i]);
if (panel_nodes[i]->hasValue("name"))
panel->setName((char *)panel_nodes[i]->getStringValue("name"));
model->addKid(panel);
}
}
return alignmainmodel;

View File

@@ -11,8 +11,10 @@
#endif
#include <vector>
#include <set>
SG_USING_STD(vector);
SG_USING_STD(set);
#include <plib/sg.h>
#include <plib/ssg.h>
@@ -63,7 +65,8 @@ sgMakeAnimation( ssgBranch * model,
vector<SGPropertyNode_ptr> &name_nodes,
SGPropertyNode *prop_root,
SGPropertyNode_ptr node,
double sim_time_sec );
double sim_time_sec,
set<ssgBranch *> &ignore_branches );
/**
* Set the filter state on models
@@ -71,4 +74,9 @@ sgMakeAnimation( ssgBranch * model,
bool
sgSetModelFilter( bool filter );
/**
* Enable or disable Display list usage
*/
extern bool sgUseDisplayList;
#endif // __MODEL_HXX

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started June 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,15 +21,13 @@
// #include <stdio.h>
#include <math.h>
#if defined (__APPLE__)
#if defined (__APPLE__)
// any C++ header file undefines isinf and isnan
// so this should be included before <iostream>
inline int (isinf)(double r) { return isinf(r); }
inline int (isnan)(double r) { return isnan(r); }
#endif
// #include STL_IOSTREAM
#include <plib/sg.h>
#include <plib/ssg.h>
@@ -47,6 +45,14 @@ inline int (isnan)(double r) { return isnan(r); }
#define isnan(x) _isnan(x)
#endif
#if defined (__FreeBSD__)
# if __FreeBSD_version < 500000
extern "C" {
inline int isnan(double r) { return !(r <= 0 || r >= 0); }
}
# endif
#endif
static ssgStateSelector *layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
static bool state_initialized = false;
@@ -191,9 +197,12 @@ generateNormalizationCubeMap()
// Constructor
SGCloudLayer::SGCloudLayer( const string &tex_path ) :
vertices(0),
indices(0),
layer_root(new ssgRoot),
layer_transform(new ssgTransform),
state_sel(0),
cloud_alpha(1.0),
texture_path(tex_path),
layer_span(0.0),
layer_asl(0.0),
@@ -204,9 +213,7 @@ SGCloudLayer::SGCloudLayer( const string &tex_path ) :
speed(0.0),
direction(0.0),
last_lon(0.0),
last_lat(0.0),
vertices(0),
indices(0)
last_lat(0.0)
{
cl[0] = cl[1] = cl[2] = cl[3] = NULL;
vl[0] = vl[1] = vl[2] = vl[3] = NULL;
@@ -489,7 +496,7 @@ SGCloudLayer::rebuild()
cos( j * half_angle ),
-sin( j * half_angle ) );
sgVectorProductVec3( v1.normal, v1.tTangent, v1.sTangent );
sgSetVec4( v1.color, 1.0f, 1.0f, 1.0f, (i == 0) ? 0.0f : 0.15f );
sgSetVec4( v1.color, 1.0f, 1.0f, 1.0f, (i == 0) ? 0.0f : cloud_alpha * 0.15f );
}
}
/*
@@ -624,17 +631,33 @@ bool SGCloudLayer::repaint( sgVec3 fog_color ) {
float *color;
for ( int i = 0; i < 4; i++ ) {
for ( int j = 0; j < 10; ++j ) {
color = cl[i]->get( j );
color = cl[i]->get( 0 );
sgCopyVec3( color, fog_color );
color[3] = (i == 0) ? 0.0f : cloud_alpha * 0.15f;
for ( int j = 0; j < 4; ++j ) {
color = cl[i]->get( (2*j) + 1 );
sgCopyVec3( color, fog_color );
color[3] =
((j == 0) || (i == 3)) ?
((j == 0) && (i == 3)) ? 0.0f : cloud_alpha * 0.15f : cloud_alpha;
color = cl[i]->get( (2*j) + 2 );
sgCopyVec3( color, fog_color );
color[3] =
((j == 3) || (i == 0)) ?
((j == 3) && (i == 0)) ? 0.0f : cloud_alpha * 0.15f : cloud_alpha;
}
color = cl[i]->get( 9 );
sgCopyVec3( color, fog_color );
color[3] = (i == 3) ? 0.0f : cloud_alpha * 0.15f;
}
}
return true;
}
// reposition the cloud layer at the specified origin and orientation
// lon specifies a rotation about the Z axis
// lat specifies a rotation about the new Y axis

View File

@@ -5,7 +5,7 @@
// Written by Curtis Olson, started June 2000.
//
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -143,6 +143,18 @@ public:
/** get the cloud movement speed */
inline float getSpeed() { return speed; }
/**
* set the alpha component of the cloud base color. Normally this
* should be 1.0, but you can set it anywhere in the range of 0.0
* to 1.0 to fade a cloud layer in or out.
* @param alpha cloud alpha value (0.0 to 1.0)
*/
inline void setAlpha( float alpha ) {
if ( alpha < 0.0 ) { alpha = 0.0; }
if ( alpha > 1.0 ) { alpha = 1.0; }
cloud_alpha = alpha;
}
/** build the cloud object */
void rebuild();
@@ -191,6 +203,8 @@ private:
ssgLeaf *layer[4];
ssgStateSelector *state_sel;
float cloud_alpha; // 1.0 = drawn fully, 0.0 faded out completely
ssgColourArray *cl[4];
ssgVertexArray *vl[4];
ssgTexCoordArray *tl[4];

View File

@@ -33,9 +33,12 @@
# include <windows.h>
#endif
#include <GL/glu.h>
#include <plib/ul.h>
#include <simgear/compiler.h>
#include SG_GLU_H
#include "SkyCloud.hpp"
#include "SkyRenderableInstance.hpp"
#include "SkyContext.hpp"

View File

@@ -36,7 +36,9 @@
#include <map>
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include "SkyUtil.hpp"
#include "SkySingleton.hpp"

View File

@@ -28,7 +28,9 @@
# include <windows.h>
#endif
#include <GL/glu.h>
#include <simgear/compiler.h>
#include SG_GLU_H
#include "glut_shapes.h"

View File

@@ -33,7 +33,9 @@
# include <windows.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include "vec4f.hpp"
#include "SkyUtil.hpp"

View File

@@ -29,7 +29,9 @@
# include <windows.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include "SkyMinMaxBox.hpp"
#include "camutils.hpp"

View File

@@ -28,7 +28,9 @@
# include <windows.h>
#endif
#include <GL/glu.h>
#include <simgear/compiler.h>
#include SG_GLU_H
#include "SkyUtil.hpp"
#include "SkyCloud.hpp"

View File

@@ -30,7 +30,9 @@
# include <windows.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include "SkyRenderableInstanceGroup.hpp"
#include "SkySceneManager.hpp"

View File

@@ -33,7 +33,9 @@
# include <windows.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#define __glext_h_
#define __GLEXT_H_

View File

@@ -30,7 +30,9 @@
# include <windows.h>
#endif
#include <GL/glu.h>
#include <simgear/compiler.h>
#include SG_GLU_H
#include "SkyTextureManager.hpp"
#include "SkyContext.hpp"

View File

@@ -48,10 +48,13 @@ OpenGL(TM) is a trademark of Silicon Graphics, Inc.
# include <simgear_config.h>
#endif
#include <math.h>
#include <simgear/compiler.h>
#include "glut_shapes.h"
#include <math.h>
#include <GL/glu.h>
#include SG_GLU_H
/* Some <math.h> files do not define M_PI... */
@@ -509,7 +512,7 @@ static GLfloat idata[12][3] =
{-Z, -X, 0}
};
static int index[20][3] =
static int iindex[20][3] =
{
{0, 4, 1},
{0, 9, 4},
@@ -539,7 +542,7 @@ icosahedron(GLenum shadeType)
int i;
for (i = 19; i >= 0; i--) {
drawtriangle(i, idata, index, shadeType);
drawtriangle(i, idata, iindex, shadeType);
}
}

View File

@@ -14,7 +14,9 @@
# include <windows.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#ifdef __cplusplus
extern "C" {

View File

@@ -3,7 +3,7 @@
// Written by Curtis Olson, started December 1997.
// SSG-ified by Curtis Olson, February 2000.
//
// Copyright (C) 1997-2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1997-2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -33,7 +33,9 @@
#include <math.h>
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include <plib/sg.h>

View File

@@ -3,7 +3,7 @@
// Written by Curtis Olson, started December 1997.
// SSG-ified by Curtis Olson, February 2000.
//
// Copyright (C) 1997-2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1997-2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -3,7 +3,7 @@
// Written by Curtis Olson, started December 1997.
// SSG-ified by Curtis Olson, February 2000.
//
// Copyright (C) 1997-2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1997-2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -171,34 +171,34 @@ bool SGSky::reposition( SGSkyState &st, double dt )
void SGSky::preDraw( float alt, float fog_exp2_density ) {
ssgCullAndDraw( pre_root );
// if we are closer than this to a cloud layer, don't draw clouds
// if we are closer than this to a cloud layer, don't draw clouds
static const float slop = 5.0;
int i;
// check where we are relative to the cloud layers
in_cloud = -1;
for ( i = 0; i < (int)cloud_layers.size(); ++i ) {
float asl = cloud_layers[i]->getElevation_m();
float thickness = cloud_layers[i]->getThickness_m();
float asl = cloud_layers[i]->getElevation_m();
float thickness = cloud_layers[i]->getThickness_m();
if ( alt < asl - slop ) {
// below cloud layer
} else if ( alt < asl + thickness + slop ) {
// in cloud layer
if ( alt < asl - slop ) {
// below cloud layer
} else if ( alt < asl + thickness + slop ) {
// in cloud layer
// bail now and don't draw any clouds
in_cloud = i;
} else {
// above cloud layer
}
// bail now and don't draw any clouds
in_cloud = i;
} else {
// above cloud layer
}
}
// determine rendering order
cur_layer_pos = 0;
while ( cur_layer_pos < (int)cloud_layers.size() &&
alt > cloud_layers[cur_layer_pos]->getElevation_m())
alt > cloud_layers[cur_layer_pos]->getElevation_m() )
{
++cur_layer_pos;
++cur_layer_pos;
}
// FIXME: This should not be needed, but at this time (08/15/2003)
@@ -266,7 +266,10 @@ void SGSky::modify_vis( float alt, float time_factor ) {
double ratio = 1.0;
if ( alt < asl - transition ) {
if ( cloud_layers[i]->getCoverage() == SGCloudLayer::SG_CLOUD_CLEAR ) {
// less than 50% coverage -- assume we're in the clear for now
ratio = 1.0;
} else if ( alt < asl - transition ) {
// below cloud layer
ratio = 1.0;
} else if ( alt < asl ) {
@@ -283,9 +286,35 @@ void SGSky::modify_vis( float alt, float time_factor ) {
ratio = 1.0;
}
// accumulate effects from multiple cloud layers
effvis *= ratio;
if ( cloud_layers[i]->getCoverage() == SGCloudLayer::SG_CLOUD_CLEAR ) {
// do nothing, clear layers aren't drawn, don't affect
// visibility andn dont' need to be faded in or out.
} else if ( (cloud_layers[i]->getCoverage() ==
SGCloudLayer::SG_CLOUD_FEW)
|| (cloud_layers[i]->getCoverage() ==
SGCloudLayer::SG_CLOUD_SCATTERED) )
{
// set the alpha fade value for the cloud layer. For less
// dense cloud layers we fade the layer to nothing as we
// approach it because we stay clear visibility-wise as we
// pass through it.
float temp = ratio * 2.0;
if ( temp > 1.0 ) { temp = 1.0; }
cloud_layers[i]->setAlpha( temp );
// don't touch visibility
} else {
// maintain full alpha for denser cloud layer types.
// Let's set the value explicitly in case someone changed
// the layer type.
cloud_layers[i]->setAlpha( 1.0 );
// lower visibility as we approach the cloud layer.
// accumulate effects from multiple cloud layers
effvis *= ratio;
}
#if 0
if ( ratio < 1.0 ) {
if ( ! in_puff ) {
// calc chance of entering cloud puff
@@ -342,12 +371,14 @@ void SGSky::modify_vis( float alt, float time_factor ) {
in_puff = false;
}
}
// never let visibility drop below 25 meters
if ( effvis <= 25.0 ) {
effvis = 25.0;
}
}
#endif
// never let visibility drop below 25 meters
if ( effvis <= 25.0 ) {
effvis = 25.0;
}
} // for
effective_visibility = effvis;

View File

@@ -6,7 +6,7 @@
// Written by Curtis Olson, started December 1997.
// SSG-ified by Curtis Olson, February 2000.
//
// Copyright (C) 1997-2000 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1997-2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started July 2001.
//
// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started July 2001.
//
// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started October 1997.
//
// Copyright (C) 1997 - 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1997 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started October 1997.
//
// Copyright (C) 1997 - 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 1997 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -3,7 +3,7 @@
//
// Written by Curtis Olson, started October 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -177,7 +177,6 @@ bool sgGenTile( const string& path, SGBucket b,
new ssgVtxTable ( GL_TRIANGLE_FAN, vl, nl, tl, cl );
leaf->setState( state );
geometry->addKid( leaf );
return true;
@@ -448,7 +447,6 @@ bool sgBinObjLoad( const string& path, const bool is_base,
nodes, normals, texcoords,
tris_v[ind], tris_n[ind], tris_tc[ind],
is_base, ground_lights );
if ( use_random_objects ) {
SGMaterial *mat = matlib->find( tri_materials[ind] );
if ( mat == NULL ) {
@@ -467,7 +465,6 @@ bool sgBinObjLoad( const string& path, const bool is_base,
nodes, normals, texcoords,
strips_v[ind], strips_n[ind], strips_tc[ind],
is_base, ground_lights );
if ( use_random_objects ) {
SGMaterial *mat = matlib->find( strip_materials[ind] );
if ( mat == NULL ) {

View File

@@ -3,7 +3,7 @@
//
// Written by Curtis Olson, started October 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started March 2002.
//
// Copyright (C) 2002 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started March 2002.
//
// Copyright (C) 2002 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -3,7 +3,7 @@
//
// Written by David Megginson, started December 2001.
//
// Copyright (C) 2001 - 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2001 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -3,7 +3,7 @@
//
// Written by David Megginson, started December 2001.
//
// Copyright (C) 2001 - 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2001 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -2,7 +2,7 @@
//
// Written by Curtis Olson, started December 2003.
//
// Copyright (C) 2003 Curtis L. Olson - curt@flightgear.org
// Copyright (C) 2003 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as

View File

@@ -15,7 +15,9 @@
#include <limits.h>
#include <string.h> // memcpy()
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include "GLBitmaps.h"

View File

@@ -113,7 +113,11 @@ void *SGGetGLProcAddress(const char *func) {
if (libHandle != NULL) {
fptr = dlsym(libHandle, func);
#if defined (__FreeBSD__)
const char *error = dlerror();
#else
char *error = dlerror();
#endif
if (error)
SG_LOG(SG_GENERAL, SG_INFO, error);
}

View File

@@ -24,7 +24,7 @@
#ifndef __SG_EXTENSIONS_HXX
#define __SG_EXTENSIONS_HXX 1
#if defined(__CYGWIN__) /* && !defined(USING_X) */
#if defined(__CYGWIN__) && !defined(WIN32) /* && !defined(USING_X) */
#define WIN32
#endif
@@ -36,7 +36,9 @@
# include <dlfcn.h>
#endif
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#if defined(__cplusplus)

View File

@@ -57,8 +57,7 @@ typedef struct {
typedef my_destination_mgr * my_dest_ptr;
/* Where should this go <simgear/screen/tr.h> ?? */
extern void trRenderFrame( void );
void (*jpgRenderFrame)(void) = NULL;
trJpgFactory::trJpgFactory() {
imageWidth = imageHeight = 0;
@@ -233,7 +232,7 @@ int trJpgFactory::compress()
int trJpgFactory::render()
{
if( !tr ) {
if( !tr || !jpgRenderFrame ) {
printf("!! NO tr !!\n trJpgFactory::render()\n");
return 0;
}
@@ -253,7 +252,7 @@ int trJpgFactory::render()
// printf("\ttrBeginTile(tr)\n");
trBeginTile(tr);
trRenderFrame();
jpgRenderFrame();
trEndTile(tr);
/* just to be safe */

View File

@@ -36,6 +36,9 @@ extern "C" {
#include <simgear/screen/tr.h>
extern void (*jpgRenderFrame)(void);
/* should look at how VNC does this */
class trJpgFactory {
private:

View File

@@ -36,7 +36,9 @@
#include <stdlib.h>
#include <limits.h>
#include <GL/gl.h>
#include <simgear/compiler.h>
#include SG_GL_H
#include "screen-dump.hxx"

View File

@@ -22,8 +22,9 @@
//
// $Id$
#include <simgear/compiler.h>
#include <GL/gl.h>
#include SG_GL_H
/**
* Dump the screen buffer to a ppm file.

Some files were not shown because too many files have changed in this diff Show More