From 02922aa5c026d74b5a33c22faf26be6a2c73af78 Mon Sep 17 00:00:00 2001 From: sigatrev Date: Sat, 16 Aug 2014 22:51:34 -0500 Subject: [PATCH] fix ActorFrame diffusing and glowing children When an ActorFrame's parent has a diffuse or glow, the ActorFrame uses the static tempState in Actor::PreDraw(); When the ActorFrame draw's it's children, those children also use tempState because their parent has a diffuse( making their internalDiffuse not 1,1,1,1 ). If any child is diffused it'll will change tempState, which will affect the internalDiffuse given to the next child, and so on. By determining the diffuse and glow to be passed to the children before drawing any of them, any changes to tempState will not affect the diffuse of subsequent children. --- src/ActorFrame.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ActorFrame.cpp b/src/ActorFrame.cpp index 0660ff79d3..a747ef73e4 100644 --- a/src/ActorFrame.cpp +++ b/src/ActorFrame.cpp @@ -248,6 +248,9 @@ void ActorFrame::DrawPrimitives() return; } + RageColor diffuse = m_pTempState->diffuse[0]; + RageColor glow = m_pTempState->glow; + // draw all sub-ActorFrames while we're in the ActorFrame's local coordinate space if( m_bDrawByZPosition ) { @@ -255,8 +258,8 @@ void ActorFrame::DrawPrimitives() ActorUtil::SortByZPosition( subs ); for( unsigned i=0; iSetInternalDiffuse(m_pTempState->diffuse[0]); - subs[i]->SetInternalGlow(m_pTempState->glow); + subs[i]->SetInternalDiffuse( diffuse ); + subs[i]->SetInternalGlow( glow ); subs[i]->Draw(); } } @@ -264,8 +267,8 @@ void ActorFrame::DrawPrimitives() { for( unsigned i=0; iSetInternalDiffuse(m_pTempState->diffuse[0]); - m_SubActors[i]->SetInternalGlow(m_pTempState->glow); + m_SubActors[i]->SetInternalDiffuse( diffuse ); + m_SubActors[i]->SetInternalGlow( glow ); m_SubActors[i]->Draw(); } }