fix ActorFrame ZTest propogation

This commit is contained in:
Chris Danford
2004-05-15 18:35:03 +00:00
parent 9ec4c6be91
commit e83bbc40da
12 changed files with 19 additions and 24 deletions
+2 -5
View File
@@ -729,7 +729,7 @@ void Actor::HandleCommand( const ParsedCommand &command )
else if( sName=="additiveblend" ) SetBlendMode( bParam(1) ? BLEND_ADD : BLEND_NORMAL ); else if( sName=="additiveblend" ) SetBlendMode( bParam(1) ? BLEND_ADD : BLEND_NORMAL );
else if( sName=="blend" ) SetBlendMode( sParam(1) ); else if( sName=="blend" ) SetBlendMode( sParam(1) );
else if( sName=="zbuffer" ) SetUseZBuffer( bParam(1) ); else if( sName=="zbuffer" ) SetUseZBuffer( bParam(1) );
else if( sName=="ztest" ) SetZTest( bParam(1) ); else if( sName=="ztest" ) SetZTestMode( bParam(1)?ZTEST_WRITE_ON_PASS:ZTEST_OFF );
else if( sName=="ztestmode" ) SetZTestMode( sParam(1) ); else if( sName=="ztestmode" ) SetZTestMode( sParam(1) );
else if( sName=="zwrite" ) SetZWrite( bParam(1) ); else if( sName=="zwrite" ) SetZWrite( bParam(1) );
else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) ); else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) );
@@ -890,10 +890,7 @@ void Actor::SetZTestMode( CString s )
s.MakeLower(); s.MakeLower();
// for metrics backward compatibility // for metrics backward compatibility
if (s=="1") SetZTestMode( ZTEST_WRITE_ON_PASS ); if(s=="off") SetZTestMode( ZTEST_OFF );
else if(s=="0") SetZTestMode( ZTEST_OFF );
else if(s=="off") SetZTestMode( ZTEST_OFF );
else if(s=="writeonpass") SetZTestMode( ZTEST_WRITE_ON_PASS ); else if(s=="writeonpass") SetZTestMode( ZTEST_WRITE_ON_PASS );
else if(s=="writeonfail") SetZTestMode( ZTEST_WRITE_ON_FAIL ); else if(s=="writeonfail") SetZTestMode( ZTEST_WRITE_ON_FAIL );
else ASSERT(0); else ASSERT(0);
-1
View File
@@ -300,7 +300,6 @@ public:
void SetUseZBuffer( bool b ) { SetZTestMode(b?ZTEST_WRITE_ON_PASS:ZTEST_OFF); SetZWrite(b); } void SetUseZBuffer( bool b ) { SetZTestMode(b?ZTEST_WRITE_ON_PASS:ZTEST_OFF); SetZWrite(b); }
virtual void SetZTestMode( ZTestMode mode ) { m_ZTestMode = mode; } virtual void SetZTestMode( ZTestMode mode ) { m_ZTestMode = mode; }
virtual void SetZTestMode( CString ); virtual void SetZTestMode( CString );
void SetZTest( bool b ) { SetZTestMode(b?ZTEST_WRITE_ON_PASS:ZTEST_OFF); }
virtual void SetZWrite( bool b ) { m_bZWrite = b; } virtual void SetZWrite( bool b ) { m_bZWrite = b; }
virtual void SetCullMode( CullMode mode ) { m_CullMode = mode; } virtual void SetCullMode( CullMode mode ) { m_CullMode = mode; }
virtual void SetCullMode( CString ); virtual void SetCullMode( CString );
+3 -3
View File
@@ -316,12 +316,12 @@ void MusicWheelItem::DrawPrimitives()
} }
void MusicWheelItem::SetZTest( bool b ) void MusicWheelItem::SetZTestMode( ZTestMode mode )
{ {
ActorFrame::SetZTest( b ); ActorFrame::SetZTestMode( mode );
// set all sub-Actors // set all sub-Actors
m_All.SetZTest( b ); m_All.SetZTestMode( mode );
} }
void MusicWheelItem::SetZWrite( bool b ) void MusicWheelItem::SetZWrite( bool b )
+1 -1
View File
@@ -30,7 +30,7 @@ public:
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
virtual void DrawPrimitives(); virtual void DrawPrimitives();
virtual void SetZTest( bool b ); virtual void SetZTestMode( ZTestMode mode );
virtual void SetZWrite( bool b ); virtual void SetZWrite( bool b );
void LoadFromWheelItemData( WheelItemData* pWID ); void LoadFromWheelItemData( WheelItemData* pWID );
+2 -1
View File
@@ -807,7 +807,8 @@ void NoteDisplay::DrawHold( const HoldNote& hn, bool bIsBeingHeld, bool bIsActiv
DISPLAY->SetTextureModeGlow(); DISPLAY->SetTextureModeGlow();
else else
DISPLAY->SetTextureModeModulate(); DISPLAY->SetTextureModeModulate();
DISPLAY->SetZBuffer( WavyPartsNeedZBuffer ); DISPLAY->SetZTestMode( WavyPartsNeedZBuffer?ZTEST_WRITE_ON_PASS:ZTEST_OFF );
DISPLAY->SetZWrite( WavyPartsNeedZBuffer );
if( !bFlipHeadAndTail ) if( !bFlipHeadAndTail )
DrawHoldBottomCap( hn, bIsBeingHeld, fYHead, fYTail, fYStep, iCol, fPercentFadeToFail, fColorScale, bDrawGlowOnly ); DrawHoldBottomCap( hn, bIsBeingHeld, fYHead, fYTail, fYStep, iCol, fPercentFadeToFail, fColorScale, bDrawGlowOnly );
+2 -1
View File
@@ -197,7 +197,8 @@ void RageDisplay::SetDefaultRenderStates()
{ {
SetLighting( false ); SetLighting( false );
SetCullMode( CULL_NONE ); SetCullMode( CULL_NONE );
SetZBuffer( false ); SetZWrite( false );
SetZTestMode( ZTEST_OFF );
SetAlphaTest( true ); SetAlphaTest( true );
SetBlendMode( BLEND_NORMAL ); SetBlendMode( BLEND_NORMAL );
SetTextureFiltering( true ); SetTextureFiltering( true );
-2
View File
@@ -195,10 +195,8 @@ public:
virtual bool IsZTestEnabled() const = 0; virtual bool IsZTestEnabled() const = 0;
virtual bool IsZWriteEnabled() const = 0; virtual bool IsZWriteEnabled() const = 0;
virtual void SetZWrite( bool b ) = 0; virtual void SetZWrite( bool b ) = 0;
void SetZTest( bool b ) { SetZTestMode(b?ZTEST_WRITE_ON_PASS:ZTEST_OFF); }
virtual void SetZTestMode( ZTestMode mode ) = 0; virtual void SetZTestMode( ZTestMode mode ) = 0;
virtual void ClearZBuffer() = 0; virtual void ClearZBuffer() = 0;
void SetZBuffer( bool b ) { SetZWrite(b); SetZTest(b); } // shortcut
virtual void SetCullMode( CullMode mode ) = 0; virtual void SetCullMode( CullMode mode ) = 0;
+1
View File
@@ -1056,6 +1056,7 @@ void RageDisplay_D3D::SetZTestMode( ZTestMode mode )
case ZTEST_WRITE_ON_FAIL: dw = D3DCMP_GREATER; break; case ZTEST_WRITE_ON_FAIL: dw = D3DCMP_GREATER; break;
default: ASSERT( 0 ); default: ASSERT( 0 );
} }
g_pd3dDevice->SetRenderState( D3DRS_ZFUNC, dw );
} }
void RageDisplay_D3D::ClearZBuffer() void RageDisplay_D3D::ClearZBuffer()
-1
View File
@@ -53,7 +53,6 @@ public:
bool IsZWriteEnabled() const; bool IsZWriteEnabled() const;
bool IsZTestEnabled() const; bool IsZTestEnabled() const;
void SetZWrite( bool b ); void SetZWrite( bool b );
void SetZTest( bool b );
void SetZTestMode( ZTestMode mode ); void SetZTestMode( ZTestMode mode );
void ClearZBuffer(); void ClearZBuffer();
void SetCullMode( CullMode mode ); void SetCullMode( CullMode mode );
-1
View File
@@ -42,7 +42,6 @@ public:
bool IsZWriteEnabled() const; bool IsZWriteEnabled() const;
bool IsZTestEnabled() const; bool IsZTestEnabled() const;
void SetZWrite( bool b ); void SetZWrite( bool b );
void SetZTest( bool b );
void SetZTestMode( ZTestMode mode ); void SetZTestMode( ZTestMode mode );
void ClearZBuffer(); void ClearZBuffer();
void SetCullMode( CullMode mode ); void SetCullMode( CullMode mode );
+1 -1
View File
@@ -131,7 +131,7 @@ ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : ScreenWithMenuEleme
// this is loaded SetSong and TweenToSong // this is loaded SetSong and TweenToSong
m_Banner.SetName( "Banner" ); m_Banner.SetName( "Banner" );
m_Banner.SetZTest( true ); // do have to pass the z test m_Banner.SetZTestMode( ZTEST_WRITE_ON_PASS ); // do have to pass the z test
m_Banner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT ); m_Banner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
SET_XY( m_Banner ); SET_XY( m_Banner );
this->AddChild( &m_Banner ); this->AddChild( &m_Banner );
+3 -3
View File
@@ -515,7 +515,7 @@ void ScrollingList::DrawPrimitives()
if(!m_iBouncingState) if(!m_iBouncingState)
m_apCSprites[iIndexToDraw1]->SetZoom( 1.0f - (ZOOM_OFFSET * i) ); m_apCSprites[iIndexToDraw1]->SetZoom( 1.0f - (ZOOM_OFFSET * i) );
m_apCSprites[iIndexToDraw1]->SetDiffuse( COLOR_SELECTED + RageColor(0,0,0,(1.0f - (FADE_OFFSET * i))) ); m_apCSprites[iIndexToDraw1]->SetDiffuse( COLOR_SELECTED + RageColor(0,0,0,(1.0f - (FADE_OFFSET * i))) );
m_apCSprites[iIndexToDraw1]->SetZTest( true ); // do have to pass the z test m_apCSprites[iIndexToDraw1]->SetZTestMode( ZTEST_WRITE_ON_PASS ); // do have to pass the z test
m_sprBannerMask.SetXY(m_apCSprites[iIndexToDraw1]->GetX(), m_apCSprites[iIndexToDraw1]->GetY()); m_sprBannerMask.SetXY(m_apCSprites[iIndexToDraw1]->GetX(), m_apCSprites[iIndexToDraw1]->GetY());
m_sprBannerMask.SetZoom( m_apCSprites[iIndexToDraw1]->GetZoom()); m_sprBannerMask.SetZoom( m_apCSprites[iIndexToDraw1]->GetZoom());
m_sprBannerMask.Draw(); m_sprBannerMask.Draw();
@@ -548,12 +548,12 @@ void ScrollingList::DrawPrimitives()
m_apCSprites[iIndexToDraw2]->SetZoom( 1.0f - (ZOOM_OFFSET * i) ); m_apCSprites[iIndexToDraw2]->SetZoom( 1.0f - (ZOOM_OFFSET * i) );
m_apCSprites[iIndexToDraw1]->SetDiffuse( COLOR_NOT_SELECTED + RageColor(0,0,0,(- (FADE_OFFSET * i))) ); m_apCSprites[iIndexToDraw1]->SetDiffuse( COLOR_NOT_SELECTED + RageColor(0,0,0,(- (FADE_OFFSET * i))) );
m_apCSprites[iIndexToDraw2]->SetDiffuse( COLOR_NOT_SELECTED + RageColor(0,0,0,(- (FADE_OFFSET * i))) ); m_apCSprites[iIndexToDraw2]->SetDiffuse( COLOR_NOT_SELECTED + RageColor(0,0,0,(- (FADE_OFFSET * i))) );
m_apCSprites[iIndexToDraw1]->SetZTest( true ); // do have to pass the z test m_apCSprites[iIndexToDraw1]->SetZTestMode( ZTEST_WRITE_ON_PASS ); // do have to pass the z test
m_sprBannerMask.SetXY(m_apCSprites[iIndexToDraw1]->GetX(), m_apCSprites[iIndexToDraw1]->GetY()); m_sprBannerMask.SetXY(m_apCSprites[iIndexToDraw1]->GetX(), m_apCSprites[iIndexToDraw1]->GetY());
m_sprBannerMask.SetZoom( m_apCSprites[iIndexToDraw1]->GetZoom()); m_sprBannerMask.SetZoom( m_apCSprites[iIndexToDraw1]->GetZoom());
m_sprBannerMask.Draw(); m_sprBannerMask.Draw();
m_apCSprites[iIndexToDraw1]->Draw(); m_apCSprites[iIndexToDraw1]->Draw();
m_apCSprites[iIndexToDraw2]->SetZTest( true ); // do have to pass the z test m_apCSprites[iIndexToDraw2]->SetZTestMode( ZTEST_WRITE_ON_PASS ); // do have to pass the z test
m_sprBannerMask.SetXY(m_apCSprites[iIndexToDraw2]->GetX(), m_apCSprites[iIndexToDraw1]->GetY()); m_sprBannerMask.SetXY(m_apCSprites[iIndexToDraw2]->GetX(), m_apCSprites[iIndexToDraw1]->GetY());
m_sprBannerMask.SetZoom( m_apCSprites[iIndexToDraw2]->GetZoom()); m_sprBannerMask.SetZoom( m_apCSprites[iIndexToDraw2]->GetZoom());
m_sprBannerMask.Draw(); m_sprBannerMask.Draw();