[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents

Akarsh Simha akarshsimha at gmail.com
Thu Nov 13 14:43:51 CET 2008


SVN commit 883746 by asimha:

Removing some irrelevant comments, debug code and implementing
byteswapping in one more place.

CCMAIL: kstars-devel at kde.org



 M  +3 -13     starcomponent.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #883745:883746
@@ -260,12 +260,10 @@
     //Loop for drawing star images
 
     MeshIterator region(m_skyMesh, DRAW_BUF);
-    // TODO: Debug code. May not be useful in production. Remove if required.
     magLim = maglim;
 
     m_StarBlockFactory->drawID = m_skyMesh->drawID();
 
-    QTime t;
     int nTrixels = 0;
 
     /*
@@ -277,7 +275,6 @@
 
     visibleStarCount = 0;
 
-    t.start();
     // Old formula:
     //    float sizeMagLim = ( 2.000 + 2.444 * Options::memUsage() / 10.0 ) * ( lgz - lgmin ) + 5.8;
 
@@ -436,11 +433,7 @@
     swapBytes = dataReader.getByteSwap();
 
     long int nstars = 0;
-    QTime t;
 
-    // TODO : Remove timing code when we are done with all possible optimizations
-    t.start();
-
     KDE_fseek(dataFile, dataReader.getDataOffset(), SEEK_SET);
 
     qint16 faintmag;
@@ -523,7 +516,6 @@
 
     dataReader.closeFile();
     nameReader.closeFile();
-    kDebug() << "Loaded " << nstars << " stars in " << t.elapsed() << " ms" << endl;
 
     starsLoaded = true;
     return true;
@@ -547,7 +539,6 @@
     return 0;
 }
 
-// TODO: Strongly consider including Deep Star Components inside StarComponent
 SkyObject *StarComponent::findByHDIndex( int HDnum ) {
     SkyObject *o;
     BinFileHelper hdidxReader;
@@ -568,18 +559,17 @@
         fread( &offset, 4, 1, hdidxFile );
         if( offset <= 0 )
             return 0;
-        // TODO: Implement byteswapping
         dataFile = m_DeepStarComponents.at( 1 )->getStarReader()->getFileHandle();
         KDE_fseek( dataFile, offset, SEEK_SET );
         fread( &stardata, sizeof( starData ), 1, dataFile );
-        // TODO: Implement byteswapping
-        // byteSwap( &stardata );
+        if( m_DeepStarComponents.at( 1 )->getStarReader()->getByteSwap() ) {
+            byteSwap( &stardata );
+        }
         m_starObject.init( &stardata );
         m_starObject.EquatorialToHorizontal( data()->lst(), data()->geo()->lat() );
         m_starObject.JITupdate( data() );
         focusStar = &m_starObject;
         hdidxReader.closeFile();
-        // TODO: Lots of trouble since we are returning a copy. Can we fix that?
         return focusStar;
     }
         


More information about the Kstars-devel mailing list