]> git.mxchange.org Git - flightgear.git/commitdiff
Tile pager tweaks.
authorcurt <curt>
Mon, 21 May 2001 20:44:59 +0000 (20:44 +0000)
committercurt <curt>
Mon, 21 May 2001 20:44:59 +0000 (20:44 +0000)
MSVC++ tweaks.

FlightGear.dsp
src/FDM/LaRCsim/ls_interface.c
src/FDM/LaRCsim/ls_types.h
src/Objects/obj.cxx
src/Scenery/FGTileLoader.cxx
src/Scenery/FGTileLoader.hxx
src/Scenery/tilemgr.cxx

index e31f80f9c952165204afb6747edd1763e24fd8c8..e5e370e37dc7c0de69a743c2d7136e3801c26921 100644 (file)
@@ -2337,21 +2337,6 @@ SOURCE=.\src\FDM\LaRCsim\ls_sym.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\src\FDM\LaRCsim\ls_trim.c\r
-\r
-!IF  "$(CFG)" == "FlightGear - Win32 Release"\r
-\r
-# PROP Intermediate_Dir "Release\Lib_LaRCsim"\r
-\r
-!ELSEIF  "$(CFG)" == "FlightGear - Win32 Debug"\r
-\r
-# PROP Intermediate_Dir "Debug\Lib_LaRCsim"\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\src\FDM\LaRCsim\ls_types.h\r
 \r
 !IF  "$(CFG)" == "FlightGear - Win32 Release"\r
index ed259447416aefb074006aaee4c2524e78c88c6c..fa38bc83d52ee92f9860cbb78ee5d9eb75d31f1f 100644 (file)
@@ -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.
  *
index c778e1df7940482a8171ef4a443770f1ad5daa16..a351e99f064c3f1adba86fb02345db865da177f2 100644 (file)
        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 */
 
index d26edcd7693cadc3e46cb9b9e5ca4b311b945430..1f792db11ae508c4531f2421863634287e94fcdb 100644 (file)
@@ -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 ) );
index 661833e2824e7ee17477908d57a56a68801113a0..a27d79dd769781a496b52115bb77c0e882eee7f4 100644 (file)
@@ -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
 }
index f8d1ba03ba420eae160a98dd9545d66eecd23a98..91ecb82df74b4913d4d97664399491665f5e5bbd 100644 (file)
@@ -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.
index db78a6dbfd7c86047ce5388e2693055067cdd1e9..7771104981449a3727bec0c72e2b7d481bca2abb 100644 (file)
@@ -74,7 +74,7 @@ SGLockedQueue<FGTileEntry *> FGTileMgr::attach_queue;
 SGLockedQueue<FGDeferredModel *> FGTileMgr::model_queue;
 #else
 queue<FGTileEntry *> FGTileMgr::attach_queue;
-queue<FGTileDeferredModel *> FGTileMgr::model_queue;
+queue<FGDeferredModel *> 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();