1
0
Fork 0

Tile pager tweaks.

MSVC++ tweaks.
This commit is contained in:
curt 2001-05-21 20:44:59 +00:00
parent 2afcbb4bc8
commit 29d540901c
7 changed files with 58 additions and 23 deletions

View file

@ -2337,21 +2337,6 @@ SOURCE=.\src\FDM\LaRCsim\ls_sym.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\FDM\LaRCsim\ls_trim.c
!IF "$(CFG)" == "FlightGear - Win32 Release"
# PROP Intermediate_Dir "Release\Lib_LaRCsim"
!ELSEIF "$(CFG)" == "FlightGear - Win32 Debug"
# PROP Intermediate_Dir "Debug\Lib_LaRCsim"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\src\FDM\LaRCsim\ls_types.h SOURCE=.\src\FDM\LaRCsim\ls_types.h
!IF "$(CFG)" == "FlightGear - Win32 Release" !IF "$(CFG)" == "FlightGear - Win32 Release"

View file

@ -572,12 +572,18 @@ int ls_ForceAltitude(double alt_feet) {
Altitude = alt_feet; Altitude = alt_feet;
ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric); ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric);
Radius_to_vehicle = Altitude + Sea_level_radius; Radius_to_vehicle = Altitude + Sea_level_radius;
return 0;
} }
/* Flight Gear Modification Log /* Flight Gear Modification Log
* *
* $Log$ * $Log$
* Revision 1.5 2001/05/21 18:44:59 curt
* Tile pager tweaks.
* MSVC++ tweaks.
*
* Revision 1.4 2001/03/24 05:03:12 curt * Revision 1.4 2001/03/24 05:03:12 curt
* SG-ified logstream. * SG-ified logstream.
* *

View file

@ -28,12 +28,16 @@
MODIFICATION HISTORY: MODIFICATION HISTORY:
DATE PURPOSE BY DATE PURPOSE BY
19 MAY 2001 Reduce MSVC6 warnings Geoff R. McLane
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
#ifndef _LS_TYPES_H #ifndef _LS_TYPES_H
#define _LS_TYPES_H #define _LS_TYPES_H
#ifdef _MSC_VER
#pragma warning(disable: 4244) // conversion from double to float
#pragma warning(disable: 4305) // truncation from const double to float
#endif /* _MSC_VER */
/* SCALAR type is used throughout equations of motion code - sets precision */ /* SCALAR type is used throughout equations of motion code - sets precision */

View file

@ -1068,7 +1068,7 @@ ssgBranch *gen_runway_sign( const string path, const string name ) {
ssgBranch *object = new ssgBranch(); ssgBranch *object = new ssgBranch();
object->setName( (char *)name.c_str() ); object->setName( (char *)name.c_str() );
double offset = name.length() / 2.0; double width = name.length() / 3.0;
string material = name + ".rgb"; string material = name + ".rgb";
@ -1078,10 +1078,10 @@ ssgBranch *gen_runway_sign( const string path, const string name ) {
int_list vertex_index; vertex_index.clear(); int_list vertex_index; vertex_index.clear();
int_list tex_index; tex_index.clear(); int_list tex_index; tex_index.clear();
nodes.push_back( Point3D( -offset, 0, 0.25 ) ); nodes.push_back( Point3D( -width, 0, 0.25 ) );
nodes.push_back( Point3D( offset + 1, 0, 0.25 ) ); nodes.push_back( Point3D( width + 1, 0, 0.25 ) );
nodes.push_back( Point3D( -offset, 0, 1.25 ) ); nodes.push_back( Point3D( -width, 0, 1.25 ) );
nodes.push_back( Point3D( offset + 1, 0, 1.25 ) ); nodes.push_back( Point3D( width + 1, 0, 1.25 ) );
normals.push_back( Point3D( 0, -1, 0 ) ); normals.push_back( Point3D( 0, -1, 0 ) );
normals.push_back( Point3D( 0, -1, 0 ) ); normals.push_back( Point3D( 0, -1, 0 ) );

View file

@ -64,6 +64,17 @@ FGTileLoader::~FGTileLoader()
#endif // ENABLE_THREADS #endif // ENABLE_THREADS
} }
/**
*
*/
void FGTileLoader::reinit() {
while ( !tile_load_queue.empty() ) {
tile_load_queue.pop();
}
}
/** /**
* *
*/ */
@ -119,9 +130,10 @@ FGTileLoader::update()
FGTileEntry* tile = tile_load_queue.front(); FGTileEntry* tile = tile_load_queue.front();
tile_load_queue.pop(); tile_load_queue.pop();
tile->load( tile_path, true ); tile->load( tile_path, true );
FGTileMgr::loaded( tile ); FGTileMgr::ready_to_attach( tile );
} }
#ifdef WISH_PLIB_WAS_THREADED // but it isn't
if ( !tile_free_queue.empty() ) { if ( !tile_free_queue.empty() ) {
cout << "freeing next tile ..." << endl; cout << "freeing next tile ..." << endl;
// free the next tile in the queue // free the next tile in the queue
@ -130,6 +142,7 @@ FGTileLoader::update()
tile->free_tile(); tile->free_tile();
delete tile; delete tile;
} }
#endif
#endif // ENABLE_THREADS #endif // ENABLE_THREADS
} }

View file

@ -54,6 +54,13 @@ public:
*/ */
~FGTileLoader(); ~FGTileLoader();
/**
* Flush anything in pending load queue without doing the work
* Leave the free queue intact since that's are only record of
* things we need to remove.
*/
void reinit();
/** /**
* Add a tile to the end of the load queue. * Add a tile to the end of the load queue.
* @param tile The tile to be loaded from disk. * @param tile The tile to be loaded from disk.

View file

@ -74,7 +74,7 @@ SGLockedQueue<FGTileEntry *> FGTileMgr::attach_queue;
SGLockedQueue<FGDeferredModel *> FGTileMgr::model_queue; SGLockedQueue<FGDeferredModel *> FGTileMgr::model_queue;
#else #else
queue<FGTileEntry *> FGTileMgr::attach_queue; queue<FGTileEntry *> FGTileMgr::attach_queue;
queue<FGTileDeferredModel *> FGTileMgr::model_queue; queue<FGDeferredModel *> FGTileMgr::model_queue;
#endif // ENABLE_THREADS #endif // ENABLE_THREADS
@ -96,6 +96,25 @@ FGTileMgr::~FGTileMgr() {
int FGTileMgr::init() { int FGTileMgr::init() {
SG_LOG( SG_TERRAIN, SG_INFO, "Initializing Tile Manager subsystem." ); SG_LOG( SG_TERRAIN, SG_INFO, "Initializing Tile Manager subsystem." );
tile_cache.init();
destroy_queue();
while ( ! attach_queue.empty() ) {
attach_queue.pop();
}
while ( ! model_queue.empty() ) {
#ifdef ENABLE_THREADS
FGDeferredModel* dm = model_queue.pop();
#else
FGDeferredModel* dm = model_queue.front();
model_queue.pop();
#endif
delete dm;
}
loader.reinit();
#if 0
if ( state != Start ) { if ( state != Start ) {
SG_LOG( SG_TERRAIN, SG_INFO, SG_LOG( SG_TERRAIN, SG_INFO,
"... Reinitializing." ); "... Reinitializing." );
@ -105,6 +124,7 @@ int FGTileMgr::init() {
"... First time through." ); "... First time through." );
tile_cache.init(); tile_cache.init();
} }
#endif
hit_list.clear(); hit_list.clear();