diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index e8774088d5..82034ec6db 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -585,9 +585,15 @@ void Actor::Command( CString sCommandString ) else if( sName=="xoffset" ) SetX( GetX()+fParam(0) ); else if( sName=="yoffset" ) SetY( GetY()+fParam(0) ); else if( sName=="zoom" ) SetZoom( fParam(0) ); - else if( sName=="zoomx" ) SetZoomY( fParam(0) ); + else if( sName=="zoomx" ) SetZoomX( fParam(0) ); else if( sName=="zoomy" ) SetZoomY( fParam(0) ); + else if( sName=="zoomtowidth" ) ZoomToWidth( fParam(0) ); + else if( sName=="zoomtoheight" ) ZoomToHeight( fParam(0) ); else if( sName=="diffuse" ) SetDiffuse( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); + else if( sName=="diffuseleftedge" ) SetDiffuseLeftEdge( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); + else if( sName=="diffuserightedge" ) SetDiffuseRightEdge( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); + else if( sName=="diffusetopedge" ) SetDiffuseTopEdge( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); + else if( sName=="diffusebottomedge" ) SetDiffuseBottomEdge( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); else if( sName=="glow" ) SetGlow( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); else if( sName=="rotationx" ) SetRotationX( fParam(0) ); else if( sName=="rotationy" ) SetRotationY( fParam(0) ); diff --git a/stepmania/src/BGAnimation.h b/stepmania/src/BGAnimation.h index 6fae54b8d3..7ef95af3f5 100644 --- a/stepmania/src/BGAnimation.h +++ b/stepmania/src/BGAnimation.h @@ -37,10 +37,11 @@ public: virtual void SetDiffuse( const RageColor &c ); - void GainingFocus(); void LosingFocus(); + float GetLengthSeconds() { return m_fLengthSeconds; } + protected: vector m_Layers; float m_fLengthSeconds; diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index f2b341d7e1..39c079f1f0 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -673,7 +673,6 @@ void BGAnimationLayer::Update( float fDeltaTime ) for( int x=0; xGetPathTo("BGAnimations","caution") ); + m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","caution background") ); this->AddChild( &m_Background ); - m_Wipe.OpenWipingRight( SM_DoneOpening ); - this->AddChild( &m_Wipe ); + m_In.Load( THEME->GetPathTo("BGAnimations","caution in") ); + m_In.StartTransitioning( SM_DoneOpening ); + this->AddChild( &m_In ); - m_FadeWipe.SetOpened(); - this->AddChild( &m_FadeWipe ); + m_Out.Load( THEME->GetPathTo("BGAnimations","caution out") ); + this->AddChild( &m_Out ); + + m_Back.Load( THEME->GetPathTo("BGAnimations","menu back") ); + this->AddChild( &m_Back ); this->SendScreenMessage( SM_StartClosing, 3 ); @@ -53,7 +57,16 @@ ScreenCaution::ScreenCaution() void ScreenCaution::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { - if( m_Wipe.IsClosing() ) + PlayerNumber pn = MenuI.player; + if( MenuI.IsValid() && pn!=PLAYER_INVALID && !GAMESTATE->m_bSideIsJoined[pn] ) + { + GAMESTATE->m_bSideIsJoined[pn] = true; + SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu start") ); + SCREENMAN->RefreshCreditsMessages(); + return; // don't fall though + } + + if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Back.IsTransitioning() ) return; Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); @@ -65,8 +78,8 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM ) switch( SM ) { case SM_StartClosing: - if( !m_Wipe.IsClosing() ) - m_Wipe.CloseWipingRight( SM_GoToNextScreen ); + if( !m_Out.IsTransitioning() ) + m_Out.StartTransitioning( SM_GoToNextScreen ); break; case SM_DoneOpening: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("caution") ); @@ -82,24 +95,15 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM ) void ScreenCaution::MenuStart( PlayerNumber pn ) { - if( pn != PLAYER_INVALID && !GAMESTATE->m_bSideIsJoined[pn] ) - { - GAMESTATE->m_bSideIsJoined[pn] = true; - SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu start") ); - SCREENMAN->RefreshCreditsMessages(); - return; // don't fall though - } - - if( !m_Wipe.IsOpening() && !m_Wipe.IsClosing() ) - m_Wipe.CloseWipingRight( SM_GoToNextScreen ); + m_Out.StartTransitioning( SM_GoToNextScreen ); } void ScreenCaution::MenuBack( PlayerNumber pn ) { - if(m_FadeWipe.IsClosing()) + if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) return; this->ClearMessageQueue(); - m_FadeWipe.CloseWipingLeft( SM_GoToPrevScreen ); + m_Back.StartTransitioning( SM_GoToPrevScreen ); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu back") ); } diff --git a/stepmania/src/ScreenCaution.h b/stepmania/src/ScreenCaution.h index 01ebeb0caa..63c922e28b 100644 --- a/stepmania/src/ScreenCaution.h +++ b/stepmania/src/ScreenCaution.h @@ -18,6 +18,7 @@ #include "TransitionFadeWipe.h" #include "RandomSample.h" #include "BGAnimation.h" +#include "TransitionBGAnimation.h" class ScreenCaution : public Screen @@ -32,8 +33,9 @@ protected: void MenuStart( PlayerNumber pn ); void MenuBack( PlayerNumber pn ); BGAnimation m_Background; - TransitionFade m_Wipe; - TransitionFadeWipe m_FadeWipe; + TransitionBGAnimation m_In; + TransitionBGAnimation m_Out; + TransitionBGAnimation m_Back; }; #endif diff --git a/stepmania/src/ScreenSelectMaxType2.cpp b/stepmania/src/ScreenSelectMaxType2.cpp index ae8c0371a4..7f104510d0 100644 --- a/stepmania/src/ScreenSelectMaxType2.cpp +++ b/stepmania/src/ScreenSelectMaxType2.cpp @@ -328,7 +328,7 @@ void ScreenSelectMaxType2::MenuStart( PlayerNumber pn ) // check to see if everyone has chosen - for( int p=0; pIsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false ) return; diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 8f8f4062f1..f1b4e104da 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -255,7 +255,11 @@ void Sprite::DrawPrimitives() /* Draw if we're not fully transparent or the zbuffer is enabled (which ignores * alpha). */ - if( m_temp.diffuse[0].a != 0 || DISPLAY->ZBufferEnabled()) + if( m_temp.diffuse[0].a > 0 || + m_temp.diffuse[1].a > 0 || + m_temp.diffuse[2].a > 0 || + m_temp.diffuse[3].a > 0 || + DISPLAY->ZBufferEnabled() ) { ////////////////////// // render the shadow diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 7dff78a5d8..b4922fec31 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -60,7 +60,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -95,7 +95,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -864,6 +864,14 @@ SOURCE=.\Transition.h # End Source File # Begin Source File +SOURCE=.\TransitionBGAnimation.cpp +# End Source File +# Begin Source File + +SOURCE=.\TransitionBGAnimation.h +# End Source File +# Begin Source File + SOURCE=.\TransitionFade.cpp # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 0c82878e81..bf39411e41 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -946,6 +946,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ + + + + diff --git a/stepmania/src/TransitionBGAnimation.cpp b/stepmania/src/TransitionBGAnimation.cpp new file mode 100644 index 0000000000..27598c5028 --- /dev/null +++ b/stepmania/src/TransitionBGAnimation.cpp @@ -0,0 +1,61 @@ +#include "global.h" +/* +----------------------------------------------------------------------------- + Class: TransitionBGAnimation + + Desc: See header + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "TransitionBGAnimation.h" +#include "RageUtil.h" +#include "ScreenManager.h" + + +TransitionBGAnimation::TransitionBGAnimation() +{ + m_State = waiting, + m_fSecsIntoTransition = 0.0f; +} + +void TransitionBGAnimation::Load( CString sBGAniDir ) +{ + m_BGAnimation.LoadFromAniDir( sBGAniDir ); +} + + +void TransitionBGAnimation::Update( float fDeltaTime ) +{ + Actor::Update( fDeltaTime ); + + if( m_State == transitioning ) + { + m_BGAnimation.Update( fDeltaTime ); + if( m_fSecsIntoTransition > m_BGAnimation.GetLengthSeconds() ) // over + { + m_fSecsIntoTransition = 0.0; + m_State = finished; + SCREENMAN->SendMessageToTopScreen( m_MessageToSendWhenDone, 0 ); + } + + m_fSecsIntoTransition += fDeltaTime; + } +} + +void TransitionBGAnimation::DrawPrimitives() +{ + if( m_State == transitioning ) + m_BGAnimation.Draw(); +} + +void TransitionBGAnimation::StartTransitioning( ScreenMessage send_when_done ) +{ + ASSERT( m_State == waiting ); // can't call this more than once + m_MessageToSendWhenDone = send_when_done; + m_State = transitioning; + m_fSecsIntoTransition = 0.0; +} + diff --git a/stepmania/src/TransitionBGAnimation.h b/stepmania/src/TransitionBGAnimation.h new file mode 100644 index 0000000000..08e92b6aaa --- /dev/null +++ b/stepmania/src/TransitionBGAnimation.h @@ -0,0 +1,49 @@ +#ifndef TransitionBGAnimation_H +#define TransitionBGAnimation_H +/* +----------------------------------------------------------------------------- + Class: TransitionBGAnimation + + Desc: TransitionBGAnimation that draws BGAnimation. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "Actor.h" +#include "BGAnimation.h" +#include "ScreenMessage.h" + + +class TransitionBGAnimation : public Actor +{ +public: + TransitionBGAnimation(); + + void Load( CString sBGAniDir ); + + virtual void Update( float fDeltaTime ); + virtual void DrawPrimitives(); + + virtual void StartTransitioning( ScreenMessage send_when_done ); + + bool IsTransitioning() { return m_State == transitioning; }; + +protected: + + enum State { + waiting, + transitioning, + finished + } m_State; + float m_fSecsIntoTransition; + + + BGAnimation m_BGAnimation; + + ScreenMessage m_MessageToSendWhenDone; +}; + + +#endif