[Kstars-devel] kdeedu/kstars/kstars
Thomas Kabelmann
tk78 at gmx.de
Wed Apr 28 18:40:12 CEST 2004
CVS commit by kabelmann:
Changed behaviour of loading stars at startup. Now the minimum loaded magnitude is 6.5. This is needed to get correct coordinates for constellation lines. This fix doesn't change anything on the user settings. If you want a max. magnitude of 2.0 you just see all stars with this magnitude, but you can see the constellation lines right. Now I have 60 MB in memory after startup, but it's better to have all 140 MB (with magnitude 10.0) in memory :-)
CCMAIL: kstars-devel at kde.org
M +9 -3 kstarsdata.cpp 1.129
M +2 -0 kstarsdata.h 1.81
--- kdeedu/kstars/kstars/kstarsdata.cpp #1.128:1.129
@@ -1,3 +1,3 @@
-/***************************************************************************
+ /***************************************************************************
kstarsdata.cpp - K Desktop Planetarium
-------------------
@@ -585,4 +585,7 @@ bool KStarsData::readStarData( void ) {
bool ready = false;
+ float loadUntilMag = MINDRAWSTARMAG;
+ if (Options::magLimitDrawStar() > loadUntilMag) loadUntilMag = Options::magLimitDrawStar();
+
for (unsigned int i=1; i<NHIPFILES+1; ++i) {
emit progressText( i18n( "Loading Star Data (%1%)" ).arg( int(100.*float(i)/float(NHIPFILES)) ) );
@@ -597,5 +600,5 @@ bool KStarsData::readStarData( void ) {
// check star magnitude
mag = line.mid( 46,5 ).toFloat();
- if ( mag > Options::magLimitDrawStar() ) {
+ if ( mag > loadUntilMag ) {
ready = true;
break;
@@ -1860,6 +1863,9 @@ void KStarsData::updateTime( GeoLocation
//Stars
if ( Options::showStars() ) {
+ // use MINDRAWSTARMAG for calculating constellation lines right
+ float mag = Options::magLimitDrawStar();
+ if (mag < MINDRAWSTARMAG) mag = MINDRAWSTARMAG;
for ( StarObject *star = starList.first(); star; star = starList.next() ) {
- if ( star->mag() > Options::magLimitDrawStar() ) break;
+ if ( star->mag() > mag ) break;
if (needNewCoords) star->updateCoords( &num );
star->EquatorialToHorizontal( LST, geo->lat() );
--- kdeedu/kstars/kstars/kstarsdata.h #1.80:1.81
@@ -47,4 +47,6 @@
#define AU_KM 1.49605e8 //km in one AU
+#define MINDRAWSTARMAG 6.5 // min. magnitude to load all stars which are needed for constellation lines
+
class QDataPump;
class QFile;
More information about the Kstars-devel
mailing list