From 29d540901cd4212c24dc77811925d9eec36cdb9f Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 21 May 2001 20:44:59 +0000 Subject: [PATCH] Tile pager tweaks. MSVC++ tweaks. --- FlightGear.dsp | 15 --------------- src/FDM/LaRCsim/ls_interface.c | 6 ++++++ src/FDM/LaRCsim/ls_types.h | 6 +++++- src/Objects/obj.cxx | 10 +++++----- src/Scenery/FGTileLoader.cxx | 15 ++++++++++++++- src/Scenery/FGTileLoader.hxx | 7 +++++++ src/Scenery/tilemgr.cxx | 22 +++++++++++++++++++++- 7 files changed, 58 insertions(+), 23 deletions(-) diff --git a/FlightGear.dsp b/FlightGear.dsp index e31f80f9c..e5e370e37 100644 --- a/FlightGear.dsp +++ b/FlightGear.dsp @@ -2337,21 +2337,6 @@ SOURCE=.\src\FDM\LaRCsim\ls_sym.h # End 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 !IF "$(CFG)" == "FlightGear - Win32 Release" diff --git a/src/FDM/LaRCsim/ls_interface.c b/src/FDM/LaRCsim/ls_interface.c index ed2594474..fa38bc83d 100644 --- a/src/FDM/LaRCsim/ls_interface.c +++ b/src/FDM/LaRCsim/ls_interface.c @@ -572,12 +572,18 @@ int ls_ForceAltitude(double alt_feet) { Altitude = alt_feet; ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric); Radius_to_vehicle = Altitude + Sea_level_radius; + + return 0; } /* Flight Gear Modification 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 * SG-ified logstream. * diff --git a/src/FDM/LaRCsim/ls_types.h b/src/FDM/LaRCsim/ls_types.h index c778e1df7..a351e99f0 100644 --- a/src/FDM/LaRCsim/ls_types.h +++ b/src/FDM/LaRCsim/ls_types.h @@ -28,12 +28,16 @@ MODIFICATION HISTORY: DATE PURPOSE BY - + 19 MAY 2001 Reduce MSVC6 warnings Geoff R. McLane --------------------------------------------------------------------------*/ #ifndef _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 */ diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index d26edcd76..1f792db11 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -1068,7 +1068,7 @@ ssgBranch *gen_runway_sign( const string path, const string name ) { ssgBranch *object = new ssgBranch(); object->setName( (char *)name.c_str() ); - double offset = name.length() / 2.0; + double width = name.length() / 3.0; 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 tex_index; tex_index.clear(); - nodes.push_back( Point3D( -offset, 0, 0.25 ) ); - nodes.push_back( Point3D( offset + 1, 0, 0.25 ) ); - nodes.push_back( Point3D( -offset, 0, 1.25 ) ); - nodes.push_back( Point3D( offset + 1, 0, 1.25 ) ); + nodes.push_back( Point3D( -width, 0, 0.25 ) ); + nodes.push_back( Point3D( width + 1, 0, 0.25 ) ); + nodes.push_back( Point3D( -width, 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 ) ); diff --git a/src/Scenery/FGTileLoader.cxx b/src/Scenery/FGTileLoader.cxx index 661833e28..a27d79dd7 100644 --- a/src/Scenery/FGTileLoader.cxx +++ b/src/Scenery/FGTileLoader.cxx @@ -64,6 +64,17 @@ FGTileLoader::~FGTileLoader() #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(); tile_load_queue.pop(); 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() ) { cout << "freeing next tile ..." << endl; // free the next tile in the queue @@ -130,6 +142,7 @@ FGTileLoader::update() tile->free_tile(); delete tile; } +#endif #endif // ENABLE_THREADS } diff --git a/src/Scenery/FGTileLoader.hxx b/src/Scenery/FGTileLoader.hxx index f8d1ba03b..91ecb82df 100644 --- a/src/Scenery/FGTileLoader.hxx +++ b/src/Scenery/FGTileLoader.hxx @@ -54,6 +54,13 @@ public: */ ~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. * @param tile The tile to be loaded from disk. diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index db78a6dbf..777110498 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -74,7 +74,7 @@ SGLockedQueue FGTileMgr::attach_queue; SGLockedQueue FGTileMgr::model_queue; #else queue FGTileMgr::attach_queue; -queue FGTileMgr::model_queue; +queue FGTileMgr::model_queue; #endif // ENABLE_THREADS @@ -96,6 +96,25 @@ FGTileMgr::~FGTileMgr() { int FGTileMgr::init() { 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 ) { SG_LOG( SG_TERRAIN, SG_INFO, "... Reinitializing." ); @@ -105,6 +124,7 @@ int FGTileMgr::init() { "... First time through." ); tile_cache.init(); } +#endif hit_list.clear();