CustomObject.cpp   CustomObject.cpp 
skipping to change at line 32 skipping to change at line 32
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
const QString CustomObject::CUSTOMOBJECT_TYPE = QStringLiteral("CustomObjec t");
Vec3f CustomObject::markerColor = Vec3f(0.1f,1.0f,0.1f); Vec3f CustomObject::markerColor = Vec3f(0.1f,1.0f,0.1f);
float CustomObject::markerSize = 1.f; float CustomObject::markerSize = 1.f;
CustomObject::CustomObject(const QString& codesignation, const Vec3d& coord inates, const bool isVisible) CustomObject::CustomObject(const QString& codesignation, const Vec3d& coord inates, const bool isVisible)
: initialized(false) : initialized(false)
, XYZ(coordinates) , XYZ(coordinates)
, markerTexture(NULL) , markerTexture(Q_NULLPTR)
, designation(codesignation) , designation(codesignation)
, isMarker(isVisible) , isMarker(isVisible)
{ {
markerTexture = StelApp::getInstance().getTextureManager().createTex ture(StelFileMgr::getInstallationDir()+"/textures/cross.png"); markerTexture = StelApp::getInstance().getTextureManager().createTex ture(StelFileMgr::getInstallationDir()+"/textures/cross.png");
initialized = true; initialized = true;
} }
CustomObject::~CustomObject() CustomObject::~CustomObject()
{ {
markerTexture.clear(); markerTexture.clear();
skipping to change at line 116 skipping to change at line 117
} }
void CustomObject::update(double deltaTime) void CustomObject::update(double deltaTime)
{ {
labelsFader.update((int)(deltaTime*1000)); labelsFader.update((int)(deltaTime*1000));
} }
void CustomObject::draw(StelCore* core, StelPainter *painter) void CustomObject::draw(StelCore* core, StelPainter *painter)
{ {
Q_UNUSED(core); Q_UNUSED(core);
Vec3d win; Vec3d pos;
// Check visibility of custom object // Check visibility of custom object
if (!(painter->getProjector()->projectCheck(XYZ, win))) if (!(painter->getProjector()->projectCheck(XYZ, pos)))
return; return;
painter->setBlending(true, GL_ONE, GL_ONE); painter->setBlending(true, GL_ONE, GL_ONE);
painter->setColor(markerColor[0], markerColor[1], markerColor[2], 1. f); painter->setColor(markerColor[0], markerColor[1], markerColor[2], 1. f);
if (isMarker) if (isMarker)
{ {
markerTexture->bind(); markerTexture->bind();
float size = getAngularSize(NULL)*M_PI/180.*painter->getProj ector()->getPixelPerRadAtCenter(); float size = getAngularSize(Q_NULLPTR)*M_PI/180.*painter->ge tProjector()->getPixelPerRadAtCenter();
float shift = markerSize + size/1.6f; float shift = markerSize + size/1.6f;
painter->drawSprite2dMode(XYZ, markerSize); painter->drawSprite2dMode(pos[0], pos[1], markerSize);
if (labelsFader.getInterstate()<=0.f) if (labelsFader.getInterstate()<=0.f)
{ {
painter->drawText(XYZ, getNameI18n(), 0, shift, shif t, false); painter->drawText(pos[0], pos[1], getNameI18n(), 0, shift, shift, false);
} }
} }
} }
 End of changes. 7 change blocks. 
6 lines changed or deleted 7 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/