SporadicMeteorMgr.cpp   SporadicMeteorMgr.cpp 
skipping to change at line 38 skipping to change at line 38
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include <QSettings> #include <QSettings>
SporadicMeteorMgr::SporadicMeteorMgr(int zhr, int maxv) SporadicMeteorMgr::SporadicMeteorMgr(int zhr, int maxv)
: m_zhr(zhr) : m_zhr(zhr)
, m_maxVelocity(maxv) , m_maxVelocity(maxv)
, m_flagShow(true) , m_flagShow(true)
{ {
setObjectName("SporadicMeteorMgr"); setObjectName("SporadicMeteorMgr");
qsrand(QDateTime::currentMSecsSinceEpoch());
} }
SporadicMeteorMgr::~SporadicMeteorMgr() SporadicMeteorMgr::~SporadicMeteorMgr()
{ {
qDeleteAll(activeMeteors); qDeleteAll(activeMeteors);
activeMeteors.clear(); activeMeteors.clear();
m_bolideTexture.clear(); m_bolideTexture.clear();
} }
void SporadicMeteorMgr::init() void SporadicMeteorMgr::init()
{ {
m_bolideTexture = StelApp::getInstance().getTextureManager().createT extureThread( m_bolideTexture = StelApp::getInstance().getTextureManager().createT extureThread(
StelFileMgr::getInstallationDir() + "/textur es/cometComa.png", StelFileMgr::getInstallationDir() + "/textur es/cometComa.png",
StelTexture::StelTextureParams(true, GL_LINE AR, GL_CLAMP_TO_EDGE)); StelTexture::StelTextureParams(true, GL_LINE AR, GL_CLAMP_TO_EDGE));
setZHR(StelApp::getInstance().getSettings()->value("astro/meteor_rat e", 10).toInt()); setZHR(StelApp::getInstance().getSettings()->value("astro/meteor_zhr ", 10).toInt());
} }
double SporadicMeteorMgr::getCallOrder(StelModuleActionName actionName) con st double SporadicMeteorMgr::getCallOrder(StelModuleActionName actionName) con st
{ {
if (actionName == StelModule::ActionDraw) if (actionName == StelModule::ActionDraw)
{ {
return GETSTELMODULE(SolarSystem)->getCallOrder(actionName) + 10.; return GETSTELMODULE(SolarSystem)->getCallOrder(actionName) + 10.;
} }
return 0; return 0;
} }
skipping to change at line 109 skipping to change at line 108
for (int i = 0; i < maxMpf; ++i) for (int i = 0; i < maxMpf; ++i)
{ {
float prob = (float) qrand() / (float) RAND_MAX; float prob = (float) qrand() / (float) RAND_MAX;
if (prob < rate) if (prob < rate)
{ {
SporadicMeteor* m = new SporadicMeteor(core, m_maxVe locity, m_bolideTexture); SporadicMeteor* m = new SporadicMeteor(core, m_maxVe locity, m_bolideTexture);
if (m->isAlive()) if (m->isAlive())
{ {
activeMeteors.append(m); activeMeteors.append(m);
} }
else
{
delete m;
}
} }
} }
} }
void SporadicMeteorMgr::draw(StelCore* core) void SporadicMeteorMgr::draw(StelCore* core)
{ {
if (!m_flagShow || !core->getSkyDrawer()->getFlagHasAtmosphere()) if (!m_flagShow || !core->getSkyDrawer()->getFlagHasAtmosphere())
{ {
return; return;
} }
skipping to change at line 136 skipping to change at line 139
// step through and draw all active meteors // step through and draw all active meteors
StelPainter sPainter(core->getProjection(StelCore::FrameAltAz)); StelPainter sPainter(core->getProjection(StelCore::FrameAltAz));
foreach (SporadicMeteor* m, activeMeteors) foreach (SporadicMeteor* m, activeMeteors)
{ {
m->draw(core, sPainter); m->draw(core, sPainter);
} }
} }
void SporadicMeteorMgr::setZHR(int zhr) void SporadicMeteorMgr::setZHR(int zhr)
{ {
m_zhr = zhr; if(zhr!=m_zhr)
emit zhrChanged(zhr); {
m_zhr = zhr;
emit zhrChanged(zhr);
}
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 10 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/