MeteorMgr.cpp   MeteorMgr.cpp 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include <functional> #include <functional>
#include <cstdlib> #include <cstdlib>
#include <QSettings> #include <QSettings>
#include <QtOpenGL> #include <QtOpenGL>
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelNavigator.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "Meteor.hpp" #include "Meteor.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
MeteorMgr::MeteorMgr(int zhr, int maxv ) : flagShow(true) MeteorMgr::MeteorMgr(int zhr, int maxv ) : flagShow(true)
{ {
skipping to change at line 96 skipping to change at line 96
{ {
maxVelocity = maxv; maxVelocity = maxv;
} }
void MeteorMgr::update(double deltaTime) void MeteorMgr::update(double deltaTime)
{ {
if (!flagShow) if (!flagShow)
return; return;
deltaTime*=1000; deltaTime*=1000;
StelNavigator * nav = StelApp::getInstance().getCore()->getNavigator (); StelCore* core = StelApp::getInstance().getCore();
// step through and update all active meteors // step through and update 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)
{ {
if (!(*iter)->update(deltaTime)) if (!(*iter)->update(deltaTime))
{ {
// remove dead meteor // remove dead meteor
// qDebug("Meteor \tdied\n"); // qDebug("Meteor \tdied\n");
delete *iter; delete *iter;
active.erase(iter); active.erase(iter);
iter--; // important! iter--; // important!
} }
} }
// only makes sense given lifetimes of meteors to draw when timeSpee d is realtime // only makes sense given lifetimes of meteors to draw when timeSpee d is realtime
// otherwise high overhead of large numbers of meteors // otherwise high overhead of large numbers of meteors
double tspeed = nav->getTimeRate()*86400; // sky seconds per actual second double tspeed = core->getTimeRate()*86400; // sky seconds per actua l second
if (tspeed<=0 || fabs(tspeed)>1.) if (tspeed<=0 || fabs(tspeed)>1.)
{ {
// don't start any more meteors // don't start any more meteors
return; return;
} }
// if stellarium has been suspended, don't create huge number of met eors to // if stellarium has been suspended, don't create huge number of met eors to
// make up for lost time! // make up for lost time!
if (deltaTime > 500) if (deltaTime > 500)
{ {
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 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/