added TransitionBGAnimation
This commit is contained in:
@@ -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) );
|
||||
|
||||
@@ -37,10 +37,11 @@ public:
|
||||
|
||||
virtual void SetDiffuse( const RageColor &c );
|
||||
|
||||
|
||||
void GainingFocus();
|
||||
void LosingFocus();
|
||||
|
||||
float GetLengthSeconds() { return m_fLengthSeconds; }
|
||||
|
||||
protected:
|
||||
vector<BGAnimationLayer*> m_Layers;
|
||||
float m_fLengthSeconds;
|
||||
|
||||
@@ -673,7 +673,6 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
|
||||
for( int x=0; x<m_iNumTilesWide; x++ )
|
||||
{
|
||||
printf( "fY: " );
|
||||
for( int y=0; y<m_iNumTilesHigh; y++ )
|
||||
{
|
||||
int i = y*m_iNumTilesWide + x;
|
||||
@@ -693,12 +692,9 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
fX -= m_fTilesSpacingX/2;
|
||||
fY -= m_fTilesSpacingY/2;
|
||||
|
||||
printf( "%f, ", fY );
|
||||
|
||||
m_Sprites[i].SetX( fX );
|
||||
m_Sprites[i].SetY( fY );
|
||||
}
|
||||
printf( "\n" );
|
||||
}
|
||||
/*
|
||||
for( i=0; i<m_iNumSprites; i++ )
|
||||
|
||||
@@ -36,14 +36,18 @@ ScreenCaution::ScreenCaution()
|
||||
return;
|
||||
}
|
||||
|
||||
m_Background.LoadFromAniDir( THEME->GetPathTo("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") );
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -328,7 +328,7 @@ void ScreenSelectMaxType2::MenuStart( PlayerNumber pn )
|
||||
|
||||
|
||||
// check to see if everyone has chosen
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false )
|
||||
return;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -946,6 +946,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
<File
|
||||
RelativePath=".\Transition.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="TransitionBGAnimation.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="TransitionBGAnimation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="TransitionBackWipe.cpp">
|
||||
</File>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user