[Kstars-devel] KDE/kdeedu/kstars/kstars

Jérôme Sonrier jsid at emor3j.fr.eu.org
Thu Feb 10 00:58:19 CET 2011


SVN commit 1219649 by jsonrier:

Fix horizon color in GL mode.

We can now call SkyGLPainter::drawPolygon() without flushing buffers. This is only used in SkyGLPainter::drawHorizon(), so horizon is painted with color defined in options and not with color of the last object drawed by  drawBuffer().


CCMAIL: kstars-devel at kde.org



 M  +6 -2      skyglpainter.cpp  
 M  +1 -1      skyglpainter.h  


--- trunk/KDE/kdeedu/kstars/kstars/skyglpainter.cpp #1219648:1219649
@@ -341,12 +341,14 @@
     }
 }
 
-void SkyGLPainter::drawPolygon(const QVector<Vector2f>& polygon, bool convex)
+void SkyGLPainter::drawPolygon(const QVector<Vector2f>& polygon, bool convex, bool flush_buffers)
 {
     //Flush all buffers
+    if( flush_buffers ) {
     for(int i = 0; i < NUMTYPES; ++i) {
         drawBuffer(i);
     }
+    }
     glDisable(GL_TEXTURE_2D);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     if( !convex ) {
@@ -385,9 +387,11 @@
 void SkyGLPainter::drawHorizon(bool filled, SkyPoint* labelPoint, bool* drawLabel)
 {
     QVector<Vector2f> ground = m_proj->groundPoly(labelPoint, drawLabel);
+
     if( ground.size() ) {
         if(filled) {
-            drawPolygon(ground,false);
+            glDisableClientState( GL_COLOR_ARRAY );
+            drawPolygon( ground, false, false );
         } else {
             glDisable(GL_TEXTURE_2D);
             glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
--- trunk/KDE/kdeedu/kstars/kstars/skyglpainter.h #1219648:1219649
@@ -51,7 +51,7 @@
 private:
     bool addItem(SkyPoint* p, int type, float width, char sp = 'a');
     void drawBuffer(int type);
-    void drawPolygon(const QVector< Vector2f >& poly, bool convex = true);
+    void drawPolygon(const QVector< Vector2f >& poly, bool convex = true, bool flush_buffers = true);
 
     const Projector *m_proj;
     


More information about the Kstars-devel mailing list