StelNavigator.cpp   StelNavigator.cpp 
skipping to change at line 179 skipping to change at line 179
void StelNavigator::addSiderealDays(double d) void StelNavigator::addSiderealDays(double d)
{ {
const Planet* home = position->getHomePlanet(); const Planet* home = position->getHomePlanet();
if (home->getEnglishName() != "Solar System StelObserver") if (home->getEnglishName() != "Solar System StelObserver")
d *= home->getSiderealDay(); d *= home->getSiderealDay();
setJDay(getJDay() + d); setJDay(getJDay() + d);
} }
void StelNavigator::moveObserverToSelected(void) void StelNavigator::moveObserverToSelected(void)
{ {
if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) StelObjectMgr* objmgr = GETSTELMODULE(StelObjectMgr);
Q_ASSERT(objmgr);
if (objmgr->getWasSelected())
{ {
Planet* pl = dynamic_cast<Planet*>(StelApp::getInstance().ge tStelObjectMgr().getSelectedObject()[0].get()); Planet* pl = dynamic_cast<Planet*>(objmgr->getSelectedObject ()[0].get());
if (pl) if (pl)
{ {
// We need to move to the selected planet. Try to ge nerate a location from the current one // We need to move to the selected planet. Try to ge nerate a location from the current one
StelLocation loc = getCurrentLocation(); StelLocation loc = getCurrentLocation();
loc.planetName = pl->getEnglishName(); loc.planetName = pl->getEnglishName();
loc.name = "-"; loc.name = "-";
loc.state = ""; loc.state = "";
moveObserverTo(loc); moveObserverTo(loc);
} }
} }
StelMovementMgr* mmgr = (StelMovementMgr*)GETSTELMODULE("StelMovemen tMgr"); StelMovementMgr* mmgr = GETSTELMODULE(StelMovementMgr);
Q_ASSERT(mmgr); Q_ASSERT(mmgr);
mmgr->setFlagTracking(false); mmgr->setFlagTracking(false);
} }
// Get the informations on the current location // Get the informations on the current location
const StelLocation& StelNavigator::getCurrentLocation() const const StelLocation& StelNavigator::getCurrentLocation() const
{ {
return position->getCurrentLocation(); return position->getCurrentLocation();
} }
skipping to change at line 295 skipping to change at line 297
{ {
JDay+=timeSpeed*deltaTime; JDay+=timeSpeed*deltaTime;
// Fix time limits to -100000 to +100000 to prevent bugs // Fix time limits to -100000 to +100000 to prevent bugs
if (JDay>38245309.499988) JDay = 38245309.499988; if (JDay>38245309.499988) JDay = 38245309.499988;
if (JDay<-34803211.500012) JDay = -34803211.500012; if (JDay<-34803211.500012) JDay = -34803211.500012;
if (position->isObserverLifeOver()) if (position->isObserverLifeOver())
{ {
// Unselect if the new home planet is the previously selecte d object // Unselect if the new home planet is the previously selecte d object
StelObjectMgr &objmgr(StelApp::getInstance().getStelObjectMg StelObjectMgr* objmgr = GETSTELMODULE(StelObjectMgr);
r()); Q_ASSERT(objmgr);
if (objmgr.getWasSelected() && objmgr.getSelectedObject()[0] if (objmgr->getWasSelected() && objmgr->getSelectedObject()[
.get()==position->getHomePlanet()) 0].get()==position->getHomePlanet())
{ {
objmgr.unSelect(); objmgr->unSelect();
} }
StelObserver* newObs = position->getNextObserver(); StelObserver* newObs = position->getNextObserver();
delete position; delete position;
position = newObs; position = newObs;
} }
position->update(deltaTime); position->update(deltaTime);
} }
/////////////////////////////////////////////////////////////////////////// ///// /////////////////////////////////////////////////////////////////////////// /////
// The non optimized (more clear version is available on the CVS : before d ate 25/07/2003) // The non optimized (more clear version is available on the CVS : before d ate 25/07/2003)
 End of changes. 5 change blocks. 
8 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/