1 // obj.hxx -- routines to handle WaveFront .obj-ish format files.
3 // Written by Curtis Olson, started October 1997.
5 // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 // (Log is kept at end of this file)
30 # error This library requires C++
46 #include <Scenery/tile.hxx>
49 // Load a .obj file and build the GL fragment list
50 int fgObjLoad(const string& path, fgTILE *tile);
57 // Revision 1.1 1999/04/05 21:32:49 curt
60 // Revision 1.3 1998/10/16 00:54:41 curt
61 // Converted to Point3D class.
63 // Revision 1.2 1998/09/01 19:03:10 curt
64 // Changes contributed by Bernie Bright <bbright@c031.aone.net.au>
65 // - The new classes in libmisc.tgz define a stream interface into zlib.
66 // I've put these in a new directory, Lib/Misc. Feel free to rename it
67 // to something more appropriate. However you'll have to change the
68 // include directives in all the other files. Additionally you'll have
69 // add the library to Lib/Makefile.am and Simulator/Main/Makefile.am.
71 // The StopWatch class in Lib/Misc requires a HAVE_GETRUSAGE autoconf
72 // test so I've included the required changes in config.tgz.
74 // There are a fair few changes to Simulator/Objects as I've moved
75 // things around. Loading tiles is quicker but thats not where the delay
76 // is. Tile loading takes a few tenths of a second per file on a P200
77 // but it seems to be the post-processing that leads to a noticeable
78 // blip in framerate. I suppose its time to start profiling to see where
81 // I've included a brief description of each archives contents.
86 // C++ stream interface into zlib.
87 // Taken from zlib-1.1.3/contrib/iostream/.
88 // Minor mods for STL compatibility.
89 // There's no copyright associated with these so I assume they're
94 // FlightGear input stream using gz_ifstream. Tries to open the
95 // given filename. If that fails then filename is examined and a
96 // ".gz" suffix is removed or appended and that file is opened.
99 // A simple timer for benchmarking. Not used in production code.
100 // Taken from the Blitz++ project. Covered by GPL.
104 // Some simple string manipulation routines.
106 // Simulator/Airports/
107 // Load airports database using fgstream.
108 // Changed fgAIRPORTS to use set<> instead of map<>.
109 // Added bool fgAIRPORTS::search() as a neater way doing the lookup.
110 // Returns true if found.
113 // Modified fgStarsInit() to load stars database using fgstream.
115 // Simulator/Objects/
116 // Modified fgObjLoad() to use fgstream.
117 // Modified fgMATERIAL_MGR::load_lib() to use fgstream.
118 // Many changes to fgMATERIAL.
119 // Some changes to fgFRAGMENT but I forget what!
121 // Revision 1.1 1998/08/25 16:51:26 curt
122 // Moved from ../Scenery
124 // Revision 1.4 1998/05/24 02:49:10 curt
125 // Implimented fragment level view frustum culling.
127 // Revision 1.3 1998/05/23 14:09:21 curt
128 // Added tile.cxx and tile.hxx.
129 // Working on rewriting the tile management system so a tile is just a list
130 // fragments, and the fragment record contains the display list for that
133 // Revision 1.2 1998/05/02 01:52:15 curt
134 // Playing around with texture coordinates.
136 // Revision 1.1 1998/04/30 12:35:29 curt
137 // Added a command line rendering option specify smooth/flat shading.
139 // Revision 1.11 1998/04/25 22:06:31 curt
140 // Edited cvs log messages in source files ... bad bad bad!
142 // Revision 1.10 1998/04/24 00:51:07 curt
143 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
144 // Tweaked the scenery file extentions to be "file.obj" (uncompressed)
145 // or "file.obz" (compressed.)
147 // Revision 1.9 1998/04/22 13:22:45 curt
148 // C++ - ifing the code a bit.
150 // Revision 1.8 1998/04/21 17:02:43 curt
151 // Prepairing for C++ integration.
153 // Revision 1.7 1998/04/03 22:11:37 curt
154 // Converting to Gnu autoconf system.
156 // Revision 1.6 1998/01/31 00:43:25 curt
157 // Added MetroWorks patches from Carmen Volpe.
159 // Revision 1.5 1998/01/27 00:48:03 curt
160 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
161 // system and commandline/config file processing code.
163 // Revision 1.4 1998/01/22 02:59:41 curt
164 // Changed #ifdef FILE_H to #ifdef _FILE_H
166 // Revision 1.3 1998/01/19 19:27:17 curt
167 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
168 // This should simplify things tremendously.
170 // Revision 1.2 1998/01/13 00:23:10 curt
171 // Initial changes to support loading and management of scenery tiles. Note,
172 // there's still a fair amount of work left to be done.
174 // Revision 1.1 1997/10/28 21:14:55 curt