1
0
Fork 0
flightgear/Simulator/Scenery/tileentry.cxx
curt 2c6db0ec35 Created an FGTileMgr class to encapsulate the high level tile management
tasks.
Created a tile load queue.  When we init, or cross a tile boundary, we
  stuff the new tiles to be loaded on a load queue, and then only load
  one tile per frame.  This will need further refinement, but it is better
  than what we had.
1999-06-13 05:58:02 +00:00

71 lines
1.7 KiB
C++

// tile.cxx -- routines to handle a scenery tile
//
// Written by Curtis Olson, started May 1998.
//
// Copyright (C) 1998, 1999 Curtis L. Olson - curt@flightgear.org
//
// 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 the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
#include <Include/compiler.h>
#ifdef FG_MATH_EXCEPTION_CLASH
# include <math.h>
#endif
#include STL_FUNCTIONAL
#include STL_ALGORITHM
#include <Debug/logstream.hxx>
#include <Bucket/newbucket.hxx>
#include "tileentry.hxx"
FG_USING_STD(for_each);
FG_USING_STD(mem_fun_ref);
// Constructor
FGTileEntry::FGTileEntry ( void )
: ncount(0),
state(Unused)
{
nodes.clear();
}
// Destructor
FGTileEntry::~FGTileEntry ( void ) {
// cout << "nodes = " << nodes.size() << endl;;
// delete[] nodes;
}
// Step through the fragment list, deleting the display list, then
// the fragment, until the list is empty.
void
FGTileEntry::release_fragments()
{
FG_LOG( FG_TERRAIN, FG_DEBUG,
"FREEING TILE = (" << tile_bucket << ")" );
for_each( begin(), end(),
mem_fun_ref( &fgFRAGMENT::deleteDisplayList ));
fragment_list.erase( begin(), end() );
mark_unused();
}