MeteorMgr.cpp   MeteorMgr.cpp 
skipping to change at line 23 skipping to change at line 23
* 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 <functional> #include <functional>
#include <cstdlib> #include <cstdlib>
#include <QSettings> #include <QSettings>
#include <QtOpenGL>
#include "StelProjector.hpp"
#include "LandscapeMgr.hpp"
#include "Meteor.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "renderer/StelRenderer.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "Meteor.hpp"
#include "LandscapeMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelPainter.hpp" #include "StelProjector.hpp"
MeteorMgr::MeteorMgr(int zhr, int maxv ) : flagShow(true) MeteorMgr::MeteorMgr(int zhr, int maxv ) : flagShow(true)
{ {
setObjectName("MeteorMgr"); setObjectName("MeteorMgr");
ZHR = zhr; ZHR = zhr;
maxVelocity = maxv; maxVelocity = maxv;
// calculate factor for meteor creation rate per second since visibl e area ZHR is for // calculate factor for meteor creation rate per second since visibl e area ZHR is for
// estimated visible radius of 458km // estimated visible radius of 458km
skipping to change at line 149 skipping to change at line 147
if (ZHR>0 && prob<((double)ZHR*zhrToWsr*deltaTime/1000.0/(do uble)mpf) ) if (ZHR>0 && prob<((double)ZHR*zhrToWsr*deltaTime/1000.0/(do uble)mpf) )
{ {
Meteor *m = new Meteor(StelApp::getInstance().getCor e(), maxVelocity); Meteor *m = new Meteor(StelApp::getInstance().getCor e(), maxVelocity);
active.push_back(m); active.push_back(m);
mlaunch++; mlaunch++;
} }
} }
// qDebug("mpf: %d\tm launched: %d\t(mps: %f)\t%d\n", mpf, mlaunch, ZHR*zhrToWsr, deltaTime); // qDebug("mpf: %d\tm launched: %d\t(mps: %f)\t%d\n", mpf, mlaunch, ZHR*zhrToWsr, deltaTime);
} }
void MeteorMgr::draw(StelCore* core) void MeteorMgr::draw(StelCore* core, StelRenderer* renderer)
{ {
if (!flagShow) if (!flagShow)
return; return;
LandscapeMgr* landmgr = (LandscapeMgr*)StelApp::getInstance().getMod uleMgr().getModule("LandscapeMgr"); LandscapeMgr* landmgr = (LandscapeMgr*)StelApp::getInstance().getMod uleMgr().getModule("LandscapeMgr");
if (landmgr->getFlagAtmosphere() && landmgr->getLuminance()>5) if (landmgr->getFlagAtmosphere() && landmgr->getLuminance()>5)
return; return;
StelPainter sPainter(core->getProjection(StelCore::FrameAltAz)); renderer->setBlendMode(BlendMode_Alpha);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
sPainter.setShadeModel(StelPainter::ShadeModelSmooth);
// step through and draw all active meteors // step through and draw all active meteors
for (std::vector<Meteor*>::iterator iter = active.begin(); iter != a ctive.end(); ++iter) for (std::vector<Meteor*>::iterator iter = active.begin(); iter != a ctive.end(); ++iter)
{ {
(*iter)->draw(core, sPainter); (*iter)->draw(core, core->getProjection(StelCore::FrameAltAz ), renderer);
} }
} }
 End of changes. 8 change blocks. 
12 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/