// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
-// (Log is kept at end of this file)
#ifdef HAVE_CONFIG_H
}
-// $Log$
-// Revision 1.15 1999/03/31 13:25:58 curt
-// Removed some debugging output.
-//
-// Revision 1.14 1999/03/30 23:48:24 curt
-// modifications to obj loader to handle tri fans.
-//
-// Revision 1.13 1999/03/27 05:36:03 curt
-// Alas, I have made non-backwardsly compatible changes to the scenery file
-// format. Thus I have had to make the corresponding changes here in the
-// file loader.
-// Things that do not correspond the the .obj format are placed in comments.
-//
-// Revision 1.12 1999/03/02 01:03:25 curt
-// Tweaks for building with native SGI compilers.
-//
-// Revision 1.11 1999/02/26 22:09:59 curt
-// Added initial support for native SGI compilers.
-//
-// Revision 1.10 1998/11/06 21:18:18 curt
-// Converted to new logstream debugging facility. This allows release
-// builds with no messages at all (and no performance impact) by using
-// the -DFG_NDEBUG flag.
-//
-// Revision 1.9 1998/11/06 14:47:06 curt
-// Changes to track Bernie's updates to fgstream.
-//
-// Revision 1.8 1998/10/20 18:33:55 curt
-// Tweaked texture coordinates, but we still have some problems. :-(
-//
-// Revision 1.7 1998/10/20 15:48:44 curt
-// Removed an extraneous output message.
-//
-// Revision 1.6 1998/10/18 01:17:21 curt
-// Point3D tweaks.
-//
-// Revision 1.5 1998/10/16 00:54:39 curt
-// Converted to Point3D class.
-//
-// Revision 1.4 1998/09/15 01:35:07 curt
-// cleaned up my fragment.num_faces hack :-) to use the STL (no need in
-// duplicating work.)
-// Tweaked fgTileMgrRender() do not calc tile matrix unless necessary.
-// removed some unneeded stuff from fgTileMgrCurElev()
-//
-// Revision 1.3 1998/09/03 21:27:03 curt
-// Fixed a serious bug caused by not-quite-correct comment/white space eating
-// which resulted in mismatched glBegin() glEnd() pairs, incorrect display lists,
-// and ugly display artifacts.
-//
-// Revision 1.2 1998/09/01 19:03:09 curt
-// Changes contributed by Bernie Bright <bbright@c031.aone.net.au>
-// - The new classes in libmisc.tgz define a stream interface into zlib.
-// I've put these in a new directory, Lib/Misc. Feel free to rename it
-// to something more appropriate. However you'll have to change the
-// include directives in all the other files. Additionally you'll have
-// add the library to Lib/Makefile.am and Simulator/Main/Makefile.am.
-//
-// The StopWatch class in Lib/Misc requires a HAVE_GETRUSAGE autoconf
-// test so I've included the required changes in config.tgz.
-//
-// There are a fair few changes to Simulator/Objects as I've moved
-// things around. Loading tiles is quicker but thats not where the delay
-// is. Tile loading takes a few tenths of a second per file on a P200
-// but it seems to be the post-processing that leads to a noticeable
-// blip in framerate. I suppose its time to start profiling to see where
-// the delays are.
-//
-// I've included a brief description of each archives contents.
-//
-// Lib/Misc/
-// zfstream.cxx
-// zfstream.hxx
-// C++ stream interface into zlib.
-// Taken from zlib-1.1.3/contrib/iostream/.
-// Minor mods for STL compatibility.
-// There's no copyright associated with these so I assume they're
-// covered by zlib's.
-//
-// fgstream.cxx
-// fgstream.hxx
-// FlightGear input stream using gz_ifstream. Tries to open the
-// given filename. If that fails then filename is examined and a
-// ".gz" suffix is removed or appended and that file is opened.
-//
-// stopwatch.hxx
-// A simple timer for benchmarking. Not used in production code.
-// Taken from the Blitz++ project. Covered by GPL.
-//
-// strutils.cxx
-// strutils.hxx
-// Some simple string manipulation routines.
-//
-// Simulator/Airports/
-// Load airports database using fgstream.
-// Changed fgAIRPORTS to use set<> instead of map<>.
-// Added bool fgAIRPORTS::search() as a neater way doing the lookup.
-// Returns true if found.
-//
-// Simulator/Astro/
-// Modified fgStarsInit() to load stars database using fgstream.
-//
-// Simulator/Objects/
-// Modified fgObjLoad() to use fgstream.
-// Modified fgMATERIAL_MGR::load_lib() to use fgstream.
-// Many changes to fgMATERIAL.
-// Some changes to fgFRAGMENT but I forget what!
-//
-// Revision 1.1 1998/08/25 16:51:25 curt
-// Moved from ../Scenery
-//
-// Revision 1.23 1998/08/20 15:16:43 curt
-// obj.cxx: use more explicit parenthases.
-// texload.[ch]: use const in function definitions where appropriate.
-//
-// Revision 1.22 1998/08/20 15:12:03 curt
-// Used a forward declaration of classes fgTILE and fgMATERIAL to eliminate
-// the need for "void" pointers and casts.
-// Quick hack to count the number of scenery polygons that are being drawn.
-//
-// Revision 1.21 1998/08/12 21:13:04 curt
-// material.cxx: don't load textures if they are disabled
-// obj.cxx: optimizations from Norman Vine
-// tile.cxx: minor tweaks
-// tile.hxx: addition of num_faces
-// tilemgr.cxx: minor tweaks
-//
-// Revision 1.20 1998/07/24 21:42:07 curt
-// material.cxx: whups, double method declaration with no definition.
-// obj.cxx: tweaks to avoid errors in SGI's CC.
-// tile.cxx: optimizations by Norman Vine.
-// tilemgr.cxx: optimizations by Norman Vine.
-//
-// Revision 1.19 1998/07/13 21:01:58 curt
-// Wrote access functions for current fgOPTIONS.
-//
-// Revision 1.18 1998/07/12 03:18:27 curt
-// Added ground collision detection. This involved:
-// - saving the entire vertex list for each tile with the tile records.
-// - saving the face list for each fragment with the fragment records.
-// - code to intersect the current vertical line with the proper face in
-// an efficient manner as possible.
-// Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
-//
-// Revision 1.17 1998/07/08 14:47:21 curt
-// Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen.
-// polare3d.h renamed to polar3d.hxx
-// fg{Cartesian,Polar}Point3d consolodated.
-// Added some initial support for calculating local current ground elevation.
-//
-// Revision 1.16 1998/07/06 21:34:33 curt
-// Added using namespace std for compilers that support this.
-//
-// Revision 1.15 1998/07/04 00:54:28 curt
-// Added automatic mipmap generation.
-//
-// When rendering fragments, use saved model view matrix from associated tile
-// rather than recalculating it with push() translate() pop().
-//
-// Revision 1.14 1998/06/17 21:36:40 curt
-// Load and manage multiple textures defined in the Materials library.
-// Boost max material fagments for each material property to 800.
-// Multiple texture support when rendering.
-//
-// Revision 1.13 1998/06/12 00:58:05 curt
-// Build only static libraries.
-// Declare memmove/memset for Sloaris.
-//
-// Revision 1.12 1998/06/08 17:57:54 curt
-// Working first pass at material proporty sorting.
-//
-// Revision 1.11 1998/06/06 01:09:31 curt
-// I goofed on the log message in the last commit ... now fixed.
-//
-// Revision 1.10 1998/06/06 01:07:17 curt
-// Increased per material fragment list size from 100 to 400.
-// Now correctly draw viewable fragments in per material order.
-//
-// Revision 1.9 1998/06/05 22:39:54 curt
-// Working on sorting by, and rendering by material properties.
-//
-// Revision 1.8 1998/06/05 18:19:18 curt
-// Recognize file, file.gz, and file.obj as scenery object files.
-//
-// Revision 1.7 1998/05/24 02:49:09 curt
-// Implimented fragment level view frustum culling.
-//
-// Revision 1.6 1998/05/23 14:09:20 curt
-// Added tile.cxx and tile.hxx.
-// Working on rewriting the tile management system so a tile is just a list
-// fragments, and the fragment record contains the display list for that
-// fragment.
-//
-// Revision 1.5 1998/05/20 20:53:53 curt
-// Moved global ref point and radius (bounding sphere info, and offset) to
-// data file rather than calculating it on the fly.
-// Fixed polygon winding problem in scenery generation stage rather than
-// compensating for it on the fly.
-// Made a fgTILECACHE class.
-//
-// Revision 1.4 1998/05/16 13:09:57 curt
-// Beginning to add support for view frustum culling.
-// Added some temporary code to calculate bouding radius, until the
-// scenery generation tools and scenery can be updated.
-//
-// Revision 1.3 1998/05/03 00:48:01 curt
-// Updated texture coordinate fmod() parameter.
-//
-// Revision 1.2 1998/05/02 01:52:14 curt
-// Playing around with texture coordinates.
-//
-// Revision 1.1 1998/04/30 12:35:28 curt
-// Added a command line rendering option specify smooth/flat shading.
-//
-// Revision 1.35 1998/04/28 21:43:26 curt
-// Wrapped zlib calls up so we can conditionally comment out zlib support.
-//
-// Revision 1.34 1998/04/28 01:21:42 curt
-// Tweaked texture parameter calculations to keep the number smaller. This
-// avoids the "swimming" problem.
-// Type-ified fgTIME and fgVIEW.
-//
-// Revision 1.33 1998/04/27 15:58:15 curt
-// Screwing around with texture coordinate generation ... still needs work.
-//
-// Revision 1.32 1998/04/27 03:30:13 curt
-// Minor transformation adjustments to try to keep scenery tiles closer to
-// (0, 0, 0) GLfloats run out of precision at the distances we need to model
-// the earth, but we can do a bunch of pre-transformations using double math
-// and then cast to GLfloat once everything is close in where we have less
-// precision problems.
-//
-// Revision 1.31 1998/04/25 15:09:57 curt
-// Changed "r" to "rb" in gzopen() options. This fixes bad behavior in win32.
-//
-// Revision 1.30 1998/04/24 14:21:08 curt
-// Added "file.obj.gz" support.
-//
-// Revision 1.29 1998/04/24 00:51:07 curt
-// Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
-// Tweaked the scenery file extentions to be "file.obj" (uncompressed)
-// or "file.obz" (compressed.)
-//
-// Revision 1.28 1998/04/22 13:22:44 curt
-// C++ - ifing the code a bit.
-//
-// Revision 1.27 1998/04/18 04:13:17 curt
-// Added zlib on the fly decompression support for loading scenery objects.
-//
-// Revision 1.26 1998/04/03 22:11:36 curt
-// Converting to Gnu autoconf system.
-//
-// Revision 1.25 1998/03/14 00:30:50 curt
-// Beginning initial terrain texturing experiments.
-//
-// Revision 1.24 1998/02/09 21:30:18 curt
-// Fixed a nagging problem with terrain tiles not "quite" matching up perfectly.
-//
-// Revision 1.23 1998/02/09 15:07:52 curt
-// Minor tweaks.
-//
-// Revision 1.22 1998/02/01 03:39:54 curt
-// Minor tweaks.
-//
-// Revision 1.21 1998/01/31 00:43:25 curt
-// Added MetroWorks patches from Carmen Volpe.
-//
-// Revision 1.20 1998/01/29 00:51:39 curt
-// First pass at tile cache, dynamic tile loading and tile unloading now works.
-//
-// Revision 1.19 1998/01/27 03:26:42 curt
-// Playing with new fgPrintf command.
-//
-// Revision 1.18 1998/01/19 19:27:16 curt
-// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-// This should simplify things tremendously.
-//
-// Revision 1.17 1998/01/13 00:23:10 curt
-// Initial changes to support loading and management of scenery tiles. Note,
-// there's still a fair amount of work left to be done.
-//
-// Revision 1.16 1997/12/30 23:09:40 curt
-// Worked on winding problem without luck, so back to calling glFrontFace()
-// 3 times for each scenery area.
-//
-// Revision 1.15 1997/12/30 20:47:51 curt
-// Integrated new event manager with subsystem initializations.
-//
-// Revision 1.14 1997/12/30 01:38:46 curt
-// Switched back to per vertex normals and smooth shading for terrain.
-//
-// Revision 1.13 1997/12/18 23:32:36 curt
-// First stab at sky dome actually starting to look reasonable. :-)
-//
-// Revision 1.12 1997/12/17 23:13:47 curt
-// Began working on rendering the sky.
-//
-// Revision 1.11 1997/12/15 23:55:01 curt
-// Add xgl wrappers for debugging.
-// Generate terrain normals on the fly.
-//
-// Revision 1.10 1997/12/12 21:41:28 curt
-// More light/material property tweaking ... still a ways off.
-//
-// Revision 1.9 1997/12/12 19:52:57 curt
-// Working on lightling and material properties.
-//
-// Revision 1.8 1997/12/10 01:19:51 curt
-// Tweaks for verion 0.15 release.
-//
-// Revision 1.7 1997/12/08 22:51:17 curt
-// Enhanced to handle ccw and cw tri-stripe winding. This is a temporary
-// admission of defeat. I will eventually go back and get all the stripes
-// wound the same way (ccw).
-//
-// Revision 1.6 1997/11/25 19:25:35 curt
-// Changes to integrate Durk's moon/sun code updates + clean up.
-//
-// Revision 1.5 1997/11/15 18:16:39 curt
-// minor tweaks.
-//
-// Revision 1.4 1997/11/14 00:26:49 curt
-// Transform scenery coordinates earlier in pipeline when scenery is being
-// created, not when it is being loaded. Precalculate normals for each node
-// as average of the normals of each containing polygon so Garoude shading is
-// now supportable.
-//
-// Revision 1.3 1997/10/31 04:49:12 curt
-// Tweaking vertex orders.
-//
-// Revision 1.2 1997/10/30 12:38:45 curt
-// Working on new scenery subsystem.
-//
-// Revision 1.1 1997/10/28 21:14:54 curt
-// Initial revision.
-
-