[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Jérôme Sonrier <jsid () emor3j ! fr ! eu ! org>
Date:       2011-02-09 23:58:19
Message-ID: 20110209235819.54D96AC8C0 () svn ! kde ! org
[Download RAW message or body]

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@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;
     


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic