ZoneArray.cpp   ZoneArray.cpp 
skipping to change at line 463 skipping to change at line 463
{ {
delete[] getZones(); delete[] getZones();
zones = NULL; zones = NULL;
} }
nr_of_zones = 0; nr_of_zones = 0;
nr_of_stars = 0; nr_of_stars = 0;
} }
template<class Star> template<class Star>
void SpecialZoneArray<Star>::draw(StelPainter* sPainter, int index, bool is InsideViewport, const RCMag* rcmag_table, void SpecialZoneArray<Star>::draw(StelPainter* sPainter, int index, bool is InsideViewport, const RCMag* rcmag_table,
int limitMagIndex, StelCore* core, int maxMagStarName, float names_b int limitMagIndex, StelCore* core, int max
rightness, const QVector<SphericalCap> &boundingCaps) const MagStarName, float names_brightness,
const QVector<SphericalCap> &boundingCaps)
const
{ {
StelSkyDrawer* drawer = core->getSkyDrawer(); StelSkyDrawer* drawer = core->getSkyDrawer();
Vec3f vf; Vec3f vf;
static const double d2000 = 2451545.0; static const double d2000 = 2451545.0;
const float movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDay const float movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJ
()-d2000)/365.25) / star_position_scale; Day()-d2000)/365.25) / star_position_scale;
// GZ, added for extinction // GZ, added for extinction
const Extinction& extinction=core->getSkyDrawer()->getExtinction(); const Extinction& extinction=core->getSkyDrawer()->getExtinction();
const bool withExtinction=drawer->getFlagHasAtmosphere() && extinction. const bool withExtinction=drawer->getFlagHasAtmosphere() && extincti
getExtinctionCoefficient()>=0.01f; on.getExtinctionCoefficient()>=0.01f;
const float k = 0.001f*mag_range/mag_steps; // from StarMgr.cpp line 65 const float k = 0.001f*mag_range/mag_steps; // from StarMgr.cpp line
4 654
// Allow artificial cutoff: // Allow artificial cutoff:
// find the (integer) mag at which is just bright enough to be drawn . // find the (integer) mag at which is just bright enough to be drawn .
int cutoffMagStep=limitMagIndex; int cutoffMagStep=limitMagIndex;
if (drawer->getFlagStarMagnitudeLimit()) if (drawer->getFlagStarMagnitudeLimit())
{ {
cutoffMagStep = ((int)(drawer->getCustomStarMagnitudeLimit() *1000.f) - mag_min)*mag_steps/mag_range; cutoffMagStep = ((int)(drawer->getCustomStarMagnitudeLimit() *1000.f) - mag_min)*mag_steps/mag_range;
if (cutoffMagStep>limitMagIndex) if (cutoffMagStep>limitMagIndex)
cutoffMagStep = limitMagIndex; cutoffMagStep = limitMagIndex;
} }
Q_ASSERT(cutoffMagStep<RCMAG_TABLE_SIZE); Q_ASSERT(cutoffMagStep<RCMAG_TABLE_SIZE);
// Go through all stars, which are sorted by magnitude (bright stars first) // Go through all stars, which are sorted by magnitude (bright stars first)
const SpecialZoneData<Star>* zoneToDraw = getZones() + index; const SpecialZoneData<Star>* zoneToDraw = getZones() + index;
const Star* lastStar = zoneToDraw->getStars() + zoneToDraw->size; const Star* lastStar = zoneToDraw->getStars() + zoneToDraw->size;
for (const Star* s=zoneToDraw->getStars();s<lastStar;++s) for (const Star* s=zoneToDraw->getStars();s<lastStar;++s)
{ {
// Artifical cutoff per magnitude // Artifical cutoff per magnitude
if (s->getMag() > cutoffMagStep) if (s->getMag() > cutoffMagStep)
break; break;
// Because of the test above, the star should always be visi ble from this point. // Because of the test above, the star should always be visi ble from this point.
// Array of 2 numbers containing radius and magnitude // Array of 2 numbers containing radius and magnitude
const RCMag* tmpRcmag = &rcmag_table[s->getMag()]; const RCMag* tmpRcmag = &rcmag_table[s->getMag()];
// Get the star position from the array // Get the star position from the array
skipping to change at line 542 skipping to change at line 543
tmpRcmag = &rcmag_table[extinctedMagIndex]; tmpRcmag = &rcmag_table[extinctedMagIndex];
} }
if (drawer->drawPointSource(sPainter, vf, *tmpRcmag, s->getB VIndex(), !isInsideViewport) && s->hasName() && extinctedMagIndex < maxMagS tarName && s->hasComponentID()<=1) if (drawer->drawPointSource(sPainter, vf, *tmpRcmag, s->getB VIndex(), !isInsideViewport) && s->hasName() && extinctedMagIndex < maxMagS tarName && s->hasComponentID()<=1)
{ {
const float offset = tmpRcmag->radius*0.7f; const float offset = tmpRcmag->radius*0.7f;
const Vec3f colorr = StelSkyDrawer::indexToColor(s-> getBVIndex())*0.75f; const Vec3f colorr = StelSkyDrawer::indexToColor(s-> getBVIndex())*0.75f;
sPainter->setColor(colorr[0], colorr[1], colorr[2],n ames_brightness); sPainter->setColor(colorr[0], colorr[1], colorr[2],n ames_brightness);
sPainter->drawText(Vec3d(vf[0], vf[1], vf[2]), s->ge tNameI18n(), 0, offset, offset, false); sPainter->drawText(Vec3d(vf[0], vf[1], vf[2]), s->ge tNameI18n(), 0, offset, offset, false);
} }
} }
} }
template<class Star> template<class Star>
void SpecialZoneArray<Star>::searchAround(const StelCore* core, int index, const Vec3d &v, double cosLimFov, void SpecialZoneArray<Star>::searchAround(const StelCore* core, int index, const Vec3d &v, double cosLimFov,
QList<StelObjectP > &result) QList<StelObjectP > &result)
{ {
static const double d2000 = 2451545.0; static const double d2000 = 2451545.0;
const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((core->g etJDay()-d2000)/365.25)/ star_position_scale; const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((core->g etJDay()-d2000)/365.25)/ star_position_scale;
const SpecialZoneData<Star> *const z = getZones()+index; const SpecialZoneData<Star> *const z = getZones()+index;
Vec3f tmp; Vec3f tmp;
 End of changes. 4 change blocks. 
17 lines changed or deleted 19 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/