Scenery3d.cpp   Scenery3d.cpp 
skipping to change at line 18 skipping to change at line 18
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include <QtGlobal> #include <QtGlobal>
#if !defined(Q_OS_WIN) #if !defined(Q_OS_WIN)
//exclude StelOpenGL here on windows because of conflicts with GLFuncs.hpp otherwise (uses QOpenGLFunctions_1_0 directly) //exclude StelOpenGL here on windows because of conflicts with GLFuncs.hpp otherwise (uses QOpenGLFunctions_1_0 directly)
#include "StelOpenGL.hpp" #include "StelOpenGL.hpp"
#endif #endif
//needs to be included before StelOpenGL on Windows //needs to be included before StelOpenGL on Windows
#include "GLFuncs.hpp" #include "GLFuncs.hpp"
skipping to change at line 392 skipping to change at line 392
StelUtils::rectToSphe(&az, &alt, viewDirectionAltAz); StelUtils::rectToSphe(&az, &alt, viewDirectionAltAz);
//if we were moving in the last update //if we were moving in the last update
bool wasMoving = moveVector.lengthSquared()>0.0; bool wasMoving = moveVector.lengthSquared()>0.0;
moveVector = Vec3d(( movement[0] * std::cos(az) + movement[1 ] * std::sin(az)), moveVector = Vec3d(( movement[0] * std::cos(az) + movement[1 ] * std::sin(az)),
( movement[0] * std::sin(az) - movement[1] * std::cos(az)), ( movement[0] * std::sin(az) - movement[1] * std::cos(az)),
movement[2]); movement[2]);
//get current time //get current time
double curTime = core->getJDay(); double curTime = core->getJD();
if(lazyDrawing) if(lazyDrawing)
{ {
needsMovementUpdate = false; needsMovementUpdate = false;
//check if cubemap requires redraw //check if cubemap requires redraw
if(qAbs(curTime-lastCubemapUpdate) > lazyInterval * StelCore::JD_SECOND || reinitCubemapping) if(qAbs(curTime-lastCubemapUpdate) > lazyInterval * StelCore::JD_SECOND || reinitCubemapping)
{ {
needsCubemapUpdate = true; needsCubemapUpdate = true;
needsMovementEndUpdate = false; needsMovementEndUpdate = false;
skipping to change at line 1537 skipping to change at line 1537
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
//reset viewport (see StelPainter::setProjector) //reset viewport (see StelPainter::setProjector)
const Vec4i& vp = altAzProjector->getViewport(); const Vec4i& vp = altAzProjector->getViewport();
glViewport(vp[0], vp[1], vp[2], vp[3]); glViewport(vp[0], vp[1], vp[2], vp[3]);
if(needsCubemapUpdate) if(needsCubemapUpdate)
{ {
lastCubemapUpdate = core->getJDay(); lastCubemapUpdate = core->getJD();
lastCubemapUpdateRealTime = QDateTime::currentMSecsSinceEpoc h(); lastCubemapUpdateRealTime = QDateTime::currentMSecsSinceEpoc h();
} }
} }
void Scenery3d::drawFromCubeMap() void Scenery3d::drawFromCubeMap()
{ {
QOpenGLShaderProgram* cubeShader; QOpenGLShaderProgram* cubeShader;
if(cubemappingMode>=S3DEnum::CM_CUBEMAP) if(cubemappingMode>=S3DEnum::CM_CUBEMAP)
cubeShader = shaderManager.getCubeShader(); cubeShader = shaderManager.getCubeShader();
skipping to change at line 1887 skipping to change at line 1887
painter.drawText(screen_x, screen_y, str); painter.drawText(screen_x, screen_y, str);
screen_y -= 15.0f; screen_y -= 15.0f;
str = QString("%1 %2 %3").arg(mainViewUp.v[0], 7, 'f', 2).arg(mainViewU p.v[1], 7, 'f', 2).arg(mainViewUp.v[2], 7, 'f', 2); str = QString("%1 %2 %3").arg(mainViewUp.v[0], 7, 'f', 2).arg(mainViewU p.v[1], 7, 'f', 2).arg(mainViewUp.v[2], 7, 'f', 2);
painter.drawText(screen_x, screen_y, str); painter.drawText(screen_x, screen_y, str);
if(requiresCubemap) if(requiresCubemap)
{ {
screen_y -= 15.0f; screen_y -= 15.0f;
str = QString("Last cubemap update: %1ms ago").arg(QDateTime::cu rrentMSecsSinceEpoch() - lastCubemapUpdateRealTime); str = QString("Last cubemap update: %1ms ago").arg(QDateTime::cu rrentMSecsSinceEpoch() - lastCubemapUpdateRealTime);
painter.drawText(screen_x, screen_y, str); painter.drawText(screen_x, screen_y, str);
screen_y -= 15.0f; screen_y -= 15.0f;
str = QString("Last cubemap update JDAY: %1").arg(qAbs(core->get JDay()-lastCubemapUpdate) * StelCore::ONE_OVER_JD_SECOND); str = QString("Last cubemap update JDAY: %1").arg(qAbs(core->get JD()-lastCubemapUpdate) * StelCore::ONE_OVER_JD_SECOND);
painter.drawText(screen_x, screen_y, str); painter.drawText(screen_x, screen_y, str);
} }
screen_y -= 30.0f; screen_y -= 30.0f;
str = QString("Venus: %1").arg(lightInfo.lightSource == Venus); str = QString("Venus: %1").arg(lightInfo.lightSource == Venus);
painter.drawText(screen_x, screen_y, str); painter.drawText(screen_x, screen_y, str);
} }
void Scenery3d::determineFeatureSupport() void Scenery3d::determineFeatureSupport()
{ {
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 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/