- Fix bug with multi clouds layer in ssggraph

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6152 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: f34fe5e7ba7d2f76ccf642fccbd31ae107a651d0
Former-commit-id: 95aca9a20b0414c7d93c5870a7c872b7ae1566cb
This commit is contained in:
torcs-ng 2015-09-27 23:38:33 +00:00
parent 10017e7546
commit abd8aac33e
3 changed files with 13 additions and 0 deletions

View file

@ -1771,6 +1771,9 @@ void TDriver::Drive( tSituation* s )
m_LastAbsDriftAngle = m_AbsDriftAngle; m_LastAbsDriftAngle = m_AbsDriftAngle;
m_Strategy->update(car, s); m_Strategy->update(car, s);
/*if (!Qualification) // Don't use pit while
m_Strategy->CheckPitState(0.6f); // qualification*/
} }
// Pitstop callback. // Pitstop callback.

View file

@ -271,6 +271,10 @@ void cGrSky::postDraw( float alt )
float slop = 5.0; // if we are closer than this to a cloud layer, don't draw cloud float slop = 5.0; // if we are closer than this to a cloud layer, don't draw cloud
glDepthMask( GL_FALSE );
glStencilFunc( GL_EQUAL, 1, 1 );
glStencilOp( GL_KEEP, GL_KEEP, GL_KEEP );
for ( int i = 0; i < num; i++ ) for ( int i = 0; i < num; i++ )
{ {
cGrCloudLayer *cloud = clouds.get(index[i]); cGrCloudLayer *cloud = clouds.get(index[i]);
@ -283,6 +287,9 @@ void cGrSky::postDraw( float alt )
cloud->draw(); cloud->draw();
} }
glDepthMask( GL_TRUE );
glDisable( GL_STENCIL_TEST );
delete [] index; delete [] index;
} }
} }

View file

@ -858,6 +858,7 @@ grPreDrawSky(tSituation* s, float fogStart, float fogEnd)
{ {
static const double m_log01 = -log( 0.01 ); static const double m_log01 = -log( 0.01 );
static const double sqrt_m_log01 = sqrt( m_log01 ); static const double sqrt_m_log01 = sqrt( m_log01 );
GLbitfield clear_mask;
if (grSkyDomeDistance && grTrack->skyversion > 0) if (grSkyDomeDistance && grTrack->skyversion > 0)
{ {
@ -872,6 +873,8 @@ grPreDrawSky(tSituation* s, float fogStart, float fogEnd)
glHint(GL_FOG_HINT, GL_DONT_CARE); glHint(GL_FOG_HINT, GL_DONT_CARE);
ssgGetLight(0)->setColour(GL_DIFFUSE, White); ssgGetLight(0)->setColour(GL_DIFFUSE, White);
clear_mask |= GL_COLOR_BUFFER_BIT;
glClear( clear_mask );
TheSky->preDraw(); TheSky->preDraw();