I've made some changes to the Scenery handling. Basically just tidy ups.
The main difference is in tile.[ch]xx where I've changed list<fgFRAGMENT> to
vector<fgFRAGMENT>. Studying our usage patterns this seems reasonable.
Lists are good if you need to insert/delete elements randomly but we
don't do that. All access seems to be sequential. Two additional
benefits are smaller memory usage - each list element requires pointers
to the next and previous elements, and faster access - vector iterators
are smaller and faster than list iterators. This should also help
Charlie Hotchkiss' problem when compiling with Borland and STLport.
./Lib/Bucket/bucketutils.hxx
Convenience functions for fgBUCKET.
./Simulator/Scenery/tile.cxx
./Simulator/Scenery/tile.hxx
Changed fragment list to a vector.
Added some convenience member functions.
./Simulator/Scenery/tilecache.cxx
./Simulator/Scenery/tilecache.hxx
use const fgBUCKET& instead of fgBUCKET* where appropriate.
./Simulator/Scenery/tilemgr.cxx
./Simulator/Scenery/tilemgr.hxx
uses all the new convenience functions.
Nested fgFACE inside fgFRAGMENT since its not used anywhere else.
./Simulator/Objects/material.cxx
./Simulator/Objects/material.hxx
Made fgMATERIAL and fgMATERIAL_MGR bona fide classes with private
data members - that should keep the rabble happy :)
./Simulator/Scenery/tilemgr.cxx
In viewable() delay evaluation of eye[0] and eye[1] in until they're
actually needed.
Change to fgTileMgrRender() to call fgMATERIAL_MGR::render_fragments()
method.
./Include/fg_stl_config.h
./Include/auto_ptr.hxx
Added support for g++ 2.7.
Further changes to other files are forthcoming.
Brief summary of changes required for g++ 2.7.
operator->() not supported by iterators: use (*i).x instead of i->x
default template arguments not supported,
<functional> doesn't have mem_fun_ref() needed by callbacks.
some std include files have different names.
template member functions not supported.
- use strings for fg_root and airport_id and added methods to return
them as strings,
- inlined all access methods,
- made the parsing functions private methods,
- deleted some unused functions.
- propogated some of these changes out a bit further.
- 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)