]> git.mxchange.org Git - flightgear.git/blob - src/Scenery/tileentry.cxx
Fear the penguin ...
[flightgear.git] / src / Scenery / tileentry.cxx
1 // tile.cxx -- routines to handle a scenery tile
2 //
3 // Written by Curtis Olson, started May 1998.
4 //
5 // Copyright (C) 1998, 1999  Curtis L. Olson  - curt@flightgear.org
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22
23
24 #include <Include/compiler.h>
25
26 #ifdef FG_MATH_EXCEPTION_CLASH
27 #  include <math.h>
28 #endif
29
30 #include STL_FUNCTIONAL
31 #include STL_ALGORITHM
32
33 #include <Debug/logstream.hxx>
34 #include <Bucket/newbucket.hxx>
35
36 #include "tileentry.hxx"
37
38 FG_USING_STD(for_each);
39 FG_USING_STD(mem_fun_ref);
40
41
42 // Constructor
43 FGTileEntry::FGTileEntry ( void )
44     : ncount(0),
45       state(Unused)
46 {
47     nodes.clear();
48 }
49
50
51 // Destructor
52 FGTileEntry::~FGTileEntry ( void ) {
53     // cout << "nodes = " << nodes.size() << endl;;
54     // delete[] nodes;
55 }
56
57
58 // Step through the fragment list, deleting the display list, then
59 // the fragment, until the list is empty.
60 void
61 FGTileEntry::release_fragments()
62 {
63     FG_LOG( FG_TERRAIN, FG_DEBUG,
64             "FREEING TILE = (" << tile_bucket << ")" );
65     for_each( begin(), end(),
66               mem_fun_ref( &fgFRAGMENT::deleteDisplayList ));
67     fragment_list.erase( begin(), end() );
68     mark_unused();
69 }
70
71