]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/moon.cxx
Activate the driver fog workaround again. It doesn't seem to be solved yet.
[simgear.git] / simgear / scene / sky / moon.cxx
index 7eed9c5c4e389499c37436274d675a6d88bda543..fdf1fc8750c959816a1269e510bce051eef598bb 100644 (file)
@@ -48,7 +48,7 @@ static int sgMoonOrbPreDraw( ssgEntity *e ) {
     ssgLeaf *f = (ssgLeaf *)e;
     if ( f -> hasState () ) f->getState()->apply() ;
 
-    glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT );
+    glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT );
     // cout << "push error = " << glGetError() << endl;
 
     glDisable( GL_DEPTH_TEST );
@@ -62,8 +62,6 @@ static int sgMoonOrbPreDraw( ssgEntity *e ) {
 static int sgMoonOrbPostDraw( ssgEntity *e ) {
     /* cout << endl << "Moon orb post draw" << endl << "----------------" 
         << endl << endl; */
-    // glEnable( GL_DEPTH_TEST );
-    // glEnable( GL_FOG );
 
     // Some drivers don't properly reset glBendFunc with a
     // glPopAttrib() so we reset it to the 'default' here.
@@ -72,14 +70,6 @@ static int sgMoonOrbPostDraw( ssgEntity *e ) {
     glPopAttrib();
     // cout << "pop error = " << glGetError() << endl;
     
-    /* test
-    glDisable( GL_LIGHTING );
-    glDisable( GL_CULL_FACE );
-    glEnable( GL_COLOR_MATERIAL );
-    glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
-    glEnable( GL_CULL_FACE );
-    glEnable( GL_LIGHTING ); */
-
     return true;
 }
 
@@ -105,9 +95,6 @@ static int sgMoonHaloPreDraw( ssgEntity *e ) {
 static int sgMoonHaloPostDraw( ssgEntity *e ) {
     /* cout << endl << "Moon halo post draw" << endl << "----------------" 
         << endl << endl; */
-    // glEnable( GL_DEPTH_TEST );
-    // glEnable( GL_FOG );
-    // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
     
     glPopAttrib();
     // cout << "pop error = " << glGetError() << endl;
@@ -118,7 +105,9 @@ static int sgMoonHaloPostDraw( ssgEntity *e ) {
 
 
 // Constructor
-SGMoon::SGMoon( void ) {
+SGMoon::SGMoon( void ) :
+    prev_moon_angle(-1)
+{
 }