StelToast.cpp   StelToast.cpp 
skipping to change at line 20 skipping to change at line 20
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include <QtOpenGL>
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelToast.hpp" #include "StelToast.hpp"
#include <QTimeLine>
ToastTile::ToastTile(ToastSurvey* survey, int level, int x, int y) ToastTile::ToastTile(ToastSurvey* survey, int level, int x, int y)
: survey(survey), level(level), x(x), y(y), empty(false), prepared(f alse), readyDraw(false), texFader(1000) : survey(survey), level(level), x(x), y(y), empty(false), prepared(f alse), readyDraw(false), texFader(1000)
{ {
Q_ASSERT(level <= getGrid()->getMaxLevel()); Q_ASSERT(level <= getGrid()->getMaxLevel());
// create the texture // create the texture
imagePath = survey->getTilePath(level, x, y); imagePath = survey->getTilePath(level, x, y);
if (level==0) if (level==0)
{ {
boundingCap.n=Vec3d(1,0,0); boundingCap.n=Vec3d(1,0,0);
skipping to change at line 167 skipping to change at line 168
if(!readyDraw) if(!readyDraw)
{ {
// Just finished loading all resources, start the fader // Just finished loading all resources, start the fader
texFader.start(); texFader.start();
readyDraw = true; readyDraw = true;
} }
if (texFader.state()==QTimeLine::Running) if (texFader.state()==QTimeLine::Running)
{ {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal sPainter->setBlending(true);
transparency mode
glEnable(GL_BLEND);
sPainter->setColor(1,1,1, texFader.currentValue()); sPainter->setColor(1,1,1, texFader.currentValue());
} }
else else
{ {
glDisable(GL_BLEND); sPainter->setBlending(false);
sPainter->setColor(1, 1, 1, 1); sPainter->setColor(1, 1, 1, 1);
} }
sPainter->enableTexture2d(true);
Q_ASSERT(vertexArray.size() == textureArray.size()); Q_ASSERT(vertexArray.size() == textureArray.size());
glEnable(GL_CULL_FACE); sPainter->setCullFace(true);
// sPainter.drawArrays(GL_TRIANGLES, vertexArray.size(), vertexArray .data(), textureArray.data(), NULL, NULL, indexArray.size(), indexArray.con stData()); // sPainter.drawArrays(GL_TRIANGLES, vertexArray.size(), vertexArray .data(), textureArray.data(), NULL, NULL, indexArray.size(), indexArray.con stData());
sPainter->setArrays(vertexArray.constData(), textureArray.constData( )); sPainter->setArrays(vertexArray.constData(), textureArray.constData( ));
sPainter->drawFromArray(StelPainter::Triangles, indexArray.size(), 0 , true, indexArray.constData()); sPainter->drawFromArray(StelPainter::Triangles, indexArray.size(), 0 , true, indexArray.constData());
glDisable(GL_CULL_FACE);
// SphericalConvexPolygon poly(getGrid()->getPolygon(level, x, y)); // SphericalConvexPolygon poly(getGrid()->getPolygon(level, x, y));
// sPainter->enableTexture2d(false); // sPainter->enableTexture2d(false);
// sPainter->drawSphericalRegion(&poly, StelPainter::SphericalPolygonDr awModeBoundary); // sPainter->drawSphericalRegion(&poly, StelPainter::SphericalPolygonDr awModeBoundary);
} }
void ToastTile::draw(StelPainter* sPainter, const SphericalCap& viewportSha pe, int maxVisibleLevel) void ToastTile::draw(StelPainter* sPainter, const SphericalCap& viewportSha pe, int maxVisibleLevel)
{ {
if (!isVisible(viewportShape, maxVisibleLevel)) if (!isVisible(viewportShape, maxVisibleLevel))
{ {
 End of changes. 7 change blocks. 
8 lines changed or deleted 5 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/