Supernova.cpp   Supernova.cpp 
skipping to change at line 21 skipping to change at line 21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "Supernova.hpp" #include "Supernova.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelPainter.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelTexture.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelRenderer.hpp"
#include <QTextStream> #include <QTextStream>
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>
#include <QtOpenGL>
#include <QVariantMap> #include <QVariantMap>
#include <QVariant> #include <QVariant>
#include <QList> #include <QList>
Supernova::Supernova(const QVariantMap& map) Supernova::Supernova(const QVariantMap& map)
: initialized(false) : initialized(false)
{ {
// return initialized if the mandatory fields are not present // return initialized if the mandatory fields are not present
if (!map.contains("designation")) if (!map.contains("designation"))
return; return;
skipping to change at line 205 skipping to change at line 203
double Supernova::getAngularSize(const StelCore*) const double Supernova::getAngularSize(const StelCore*) const
{ {
return 0.00001; return 0.00001;
} }
void Supernova::update(double deltaTime) void Supernova::update(double deltaTime)
{ {
labelsFader.update((int)(deltaTime*1000)); labelsFader.update((int)(deltaTime*1000));
} }
void Supernova::draw(StelCore* core, StelPainter& painter) void Supernova::draw(StelCore* core, StelRenderer* renderer, StelProjectorP projector)
{ {
StelSkyDrawer* sd = core->getSkyDrawer(); StelSkyDrawer* sd = core->getSkyDrawer();
Vec3f color = Vec3f(1.f,1.f,1.f); Vec3f color = Vec3f(1.f,1.f,1.f);
if (StelApp::getInstance().getVisionModeNight()) if (StelApp::getInstance().getVisionModeNight())
color = StelUtils::getNightColor(color); color = StelUtils::getNightColor(color);
float rcMag[2], size, shift; float rcMag[2], size, shift;
double mag; double mag;
StelUtils::spheToRect(snra, snde, XYZ); StelUtils::spheToRect(snra, snde, XYZ);
mag = getVMagnitude(core, true); mag = getVMagnitude(core, true);
sd->preDrawPointSource(&painter); sd->preDrawPointSource();
if (mag <= sd->getLimitMagnitude()) if (mag <= sd->getLimitMagnitude())
{ {
sd->computeRCMag(mag, rcMag); sd->computeRCMag(mag, rcMag);
// sd->drawPointSource(&painter, Vec3f(XYZ[0], XYZ[1], XYZ[2]), const Vec3f XYZf(XYZ[0], XYZ[1], XYZ[2]);
rcMag, color, false); Vec3f win;
sd->drawPointSource(&painter, XYZ, rcMag, color, false); if(sd->pointSourceVisible(&(*projector), XYZf, rcMag, false,
painter.setColor(color[0], color[1], color[2], 1); win))
size = getAngularSize(NULL)*M_PI/180.*painter.getProjector() {
->getPixelPerRadAtCenter(); sd->drawPointSource(win, rcMag, color);
}
renderer->setGlobalColor(color[0], color[1], color[2], 1);
size = getAngularSize(NULL)*M_PI/180.*projector->getPixelPer
RadAtCenter();
shift = 6.f + size/1.8f; shift = 6.f + size/1.8f;
if (labelsFader.getInterstate()<=0.f) if (labelsFader.getInterstate()<=0.f)
{ {
painter.drawText(XYZ, designation, 0, shift, shift, false); renderer->drawText(TextParams(XYZ, projector, design ation).shift(shift, shift).useGravity());
} }
} }
sd->postDrawPointSource(&painter); sd->postDrawPointSource(projector);
} }
 End of changes. 9 change blocks. 
13 lines changed or deleted 15 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/