diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index c716eb5486..8c8d48650a 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -46,9 +46,9 @@ void Actor::Draw() // set the world matrix and calculate actor properties, the case glowing: break; case wagging: - rotation.z = m_fWagRadians * (float)sin( + rotation.z = m_fWagRadians * sinf( (m_fWagTimer / m_fWagPeriod) // percent through wag - * 2.0 * D3DX_PI ); + * 2.0f * D3DX_PI ); break; case spinning: // nothing special needed @@ -61,13 +61,13 @@ void Actor::Draw() // set the world matrix and calculate actor properties, the break; case bouncing: float fPercentThroughBounce = m_fTimeIntoBounce / m_fBouncePeriod; - float fPercentOffset = sin( fPercentThroughBounce*D3DX_PI ); + float fPercentOffset = sinf( fPercentThroughBounce*D3DX_PI ); pos += m_vectBounce * fPercentOffset; break; } - SCREEN->Translate( pos.x-0.5f, pos.y-0.5f, pos.z ); // offset so that pixels are aligned to texels + SCREEN->Translate( pos.x, pos.y, pos.z ); // offset so that pixels are aligned to texels SCREEN->Scale( scale.x, scale.y, 1 ); // super slow! @@ -255,8 +255,8 @@ void Actor::SetTweenAddColor( D3DXCOLOR c ) { GetLatestTween().m_end_colorAdd void Actor::ScaleTo( LPRECT pRect, StretchType st ) { // width and height of rectangle - float rect_width = RECTWIDTH(*pRect); - float rect_height = RECTHEIGHT(*pRect); + float rect_width = (float)RECTWIDTH(*pRect); + float rect_height = (float)RECTHEIGHT(*pRect); if( rect_width < 0 ) SetRotationY( D3DX_PI ); if( rect_height < 0 ) SetRotationX( D3DX_PI ); @@ -266,8 +266,8 @@ void Actor::ScaleTo( LPRECT pRect, StretchType st ) float rect_cy = pRect->top + rect_height/2; // zoom fActor needed to scale the Actor to fill the rectangle - float fNewZoomX = (float)fabs(rect_width / m_size.x); - float fNewZoomY = (float)fabs(rect_height / m_size.y); + float fNewZoomX = fabsf(rect_width / m_size.x); + float fNewZoomY = fabsf(rect_height / m_size.y); float fNewZoom; switch( st ) diff --git a/stepmania/src/BPMDisplay.h b/stepmania/src/BPMDisplay.h index 64f8cbf21f..fe7546313a 100644 --- a/stepmania/src/BPMDisplay.h +++ b/stepmania/src/BPMDisplay.h @@ -24,7 +24,7 @@ class BPMDisplay : public ActorFrame { public: BPMDisplay(); - void Update( float fDeltaTime ); + virtual void Update( float fDeltaTime ); void SetBPMRange( float fLowBPM, float fHighBPM ); protected: diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 348a632e72..cb5c679860 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -29,7 +29,7 @@ Background::Background() m_sprDanger.SetXY( CENTER_X, CENTER_Y ); m_sprDangerBackground.Load( THEME->GetPathTo(GRAPHIC_DANGER_BACKGROUND) ); - m_sprDangerBackground.StretchTo( CRect(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) ); + m_sprDangerBackground.StretchTo( CRect((int)SCREEN_LEFT, (int)SCREEN_TOP, (int)SCREEN_RIGHT, (int)SCREEN_BOTTOM) ); } bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations ) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 42425f4bf4..97bfd47118 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -96,7 +96,7 @@ bool BitmapText::Load( CString sFontFilePath ) if( sCharacters != "" ) // the creator supplied characters { // sanity check - if( sCharacters.GetLength() != Sprite::GetNumStates() ) + if( sCharacters.GetLength() != (int)Sprite::GetNumStates() ) RageError( ssprintf("The characters in '%s' does not match the number of frames in the texture.", m_sFontFilePath) ); // set the char to frameno map @@ -123,20 +123,20 @@ bool BitmapText::Load( CString sFontFilePath ) CStringArray arrayCharWidths; split( sWidthsValue, ",", arrayCharWidths ); - if( arrayCharWidths.GetSize() != Sprite::GetNumStates() ) + if( arrayCharWidths.GetSize() != (int)Sprite::GetNumStates() ) RageError( ssprintf("The number of widths specified in '%s' (%d) do not match the number of frames in the texture (%u).", m_sFontFilePath, arrayCharWidths.GetSize(), Sprite::GetNumStates()) ); for( int i=0; iGetSourceFrameWidth(); + m_fFrameNoToWidth[i] = (float)m_pTexture->GetSourceFrameWidth(); } } @@ -144,7 +144,7 @@ bool BitmapText::Load( CString sFontFilePath ) if( bFirstTimeBeingLoaded ) { // tweak the textures frame rectangles so we don't draw extra to the left and right of the character - for( int i=0; iGetTextureCoordRect( i ); diff --git a/stepmania/src/Combo.cpp b/stepmania/src/Combo.cpp new file mode 100644 index 0000000000..7690f88995 --- /dev/null +++ b/stepmania/src/Combo.cpp @@ -0,0 +1,85 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + File: Combo.h + + Desc: A graphic displayed in the Combo during Dancing. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#include "Combo.h" +#include "ThemeManager.h" + +const float COMBO_TWEEN_TIME = 0.5f; + + +Combo::Combo() +{ + m_iCurCombo = 0; + m_iMaxCombo = 0; + + m_sprCombo.Load( THEME->GetPathTo(GRAPHIC_COMBO) ); + m_sprCombo.StopAnimating(); + m_sprCombo.SetX( 40 ); + m_sprCombo.SetZoom( 1.0f ); + + m_textComboNumber.Load( THEME->GetPathTo(FONT_COMBO_NUMBERS) ); + m_textComboNumber.SetX( -40 ); + + m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible + m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible + + + this->AddActor( &m_textComboNumber ); + this->AddActor( &m_sprCombo ); +} + + +void Combo::ContinueCombo() +{ + m_iCurCombo++; + + // new max combo + if( m_iCurCombo > m_iMaxCombo ) + m_iMaxCombo = m_iCurCombo; + + if( m_iCurCombo <= 4 ) + { + m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible + m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible + } + else + { + m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible + m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible + + m_textComboNumber.SetText( ssprintf("%d", m_iCurCombo) ); + float fNewZoom = 0.5f + m_iCurCombo/800.0f; + m_textComboNumber.SetZoom( fNewZoom ); + m_textComboNumber.SetX( -40 - (fNewZoom-1)*30 ); + + //m_textComboNumber.BeginTweening( COMBO_TWEEN_TIME ); + //m_textComboNumber.SetTweenZoom( 1 ); + } +} + +void Combo::EndCombo() +{ + m_iCurCombo = 0; + + m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible + m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible + +} + +int Combo::GetCurrentCombo() +{ + return m_iCurCombo; +} + +int Combo::GetMaxCombo() +{ + return m_iMaxCombo; +} \ No newline at end of file diff --git a/stepmania/src/Combo.h b/stepmania/src/Combo.h new file mode 100644 index 0000000000..ebc01855ed --- /dev/null +++ b/stepmania/src/Combo.h @@ -0,0 +1,42 @@ +/* +----------------------------------------------------------------------------- + File: Combo.h + + Desc: A graphic displayed in the Combo during Dancing. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + + +#ifndef _Combo_H_ +#define _Combo_H_ + + +#include "ActorFrame.h" +#include "Sprite.h" +#include "ScoreDisplayRolling.h" + + + +class Combo : public ActorFrame +{ +public: + Combo(); + + void ContinueCombo(); + void EndCombo(); + + int GetCurrentCombo(); + int GetMaxCombo(); + +protected: + int m_iCurCombo; + int m_iMaxCombo; + + bool m_bComboVisible; + Sprite m_sprCombo; + BitmapText m_textComboNumber; +}; + +#endif \ No newline at end of file diff --git a/stepmania/src/GhostArrow.cpp b/stepmania/src/GhostArrow.cpp index 01c3c827f2..5d68536197 100644 --- a/stepmania/src/GhostArrow.cpp +++ b/stepmania/src/GhostArrow.cpp @@ -17,25 +17,29 @@ const float GRAY_ARROW_TWEEN_TIME = 0.5f; GhostArrow::GhostArrow() { Load( THEME->GetPathTo(GRAPHIC_GHOST_ARROW) ); - SetState( 1 ); SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); TurnShadowOff(); } +void GhostArrow::Update( float fDeltaTime ) +{ + Sprite::Update( fDeltaTime ); +} + void GhostArrow::SetBeat( const float fSongBeat ) { //SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 ); } -void GhostArrow::Step( StepScore score ) +void GhostArrow::Step( TapStepScore score ) { switch( score ) { - case perfect: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.7f) ); break; // yellow - case great: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.7f) ); break; // green - case good: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.7f) ); break; - case boo: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.7f) ); break; - case miss: ASSERT( false ); break; + case TSS_PERFECT: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.6f) ); break; // yellow + case TSS_GREAT: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.6f) ); break; // green + case TSS_GOOD: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.6f) ); break; + case TSS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.6f) ); break; + case TSS_MISS: ASSERT( false ); break; } SetZoom( 1.0f ); BeginTweening( 0.3f ); diff --git a/stepmania/src/GhostArrow.h b/stepmania/src/GhostArrow.h index 6fab93bef0..f5fb7889ed 100644 --- a/stepmania/src/GhostArrow.h +++ b/stepmania/src/GhostArrow.h @@ -24,8 +24,10 @@ class GhostArrow : public Sprite public: GhostArrow(); + virtual void Update( float fDeltaTime ); + void SetBeat( const float fSongBeat ); - void Step( StepScore score ); + void Step( TapStepScore score ); float m_fVisibilityCountdown; }; diff --git a/stepmania/src/GhostArrowBright.cpp b/stepmania/src/GhostArrowBright.cpp index a9f1f08eef..3964ce6df3 100644 --- a/stepmania/src/GhostArrowBright.cpp +++ b/stepmania/src/GhostArrowBright.cpp @@ -17,7 +17,7 @@ const float GRAY_ARROW_TWEEN_TIME = 0.5f; GhostArrowBright::GhostArrowBright() { - Load( THEME->GetPathTo(GRAPHIC_GHOST_ARROW) ); + Load( THEME->GetPathTo(GRAPHIC_BRIGHT_GHOST_ARROW) ); SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); TurnShadowOff(); } @@ -27,19 +27,19 @@ void GhostArrowBright::SetBeat( const float fSongBeat ) //SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 ); } -void GhostArrowBright::Step( StepScore score ) +void GhostArrowBright::Step( TapStepScore score ) { switch( score ) { - case perfect: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.9f) ); break; // yellow - case great: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.9f) ); break; // green - case good: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.9f) ); break; - case boo: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.9f) ); break; - case miss: ASSERT( false ); break; + case TSS_PERFECT: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,1.0f) ); break; // yellow + case TSS_GREAT: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,1.0f) ); break; // green + case TSS_GOOD: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,1.0f) ); break; + case TSS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,1.0f) ); break; + case TSS_MISS: ASSERT( false ); break; } SetState( 0 ); SetZoom( 1.2f ); - BeginTweening( 0.3f ); + BeginTweening( 0.35f ); SetTweenZoom( 2.5f ); D3DXCOLOR colorTween = GetDiffuseColor(); colorTween.a = 0; diff --git a/stepmania/src/GhostArrowBright.h b/stepmania/src/GhostArrowBright.h index ce38735e99..53dd750862 100644 --- a/stepmania/src/GhostArrowBright.h +++ b/stepmania/src/GhostArrowBright.h @@ -25,7 +25,7 @@ public: GhostArrowBright(); void SetBeat( const float fSongBeat ); - void Step( StepScore score ); + void Step( TapStepScore score ); float m_fVisibilityCountdown; }; diff --git a/stepmania/src/GrayArrow.cpp b/stepmania/src/GrayArrow.cpp index f25431172b..dc84cc5fff 100644 --- a/stepmania/src/GrayArrow.cpp +++ b/stepmania/src/GrayArrow.cpp @@ -25,7 +25,7 @@ void GrayArrow::SetBeat( const float fSongBeat ) SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 ); } -void GrayArrow::Step( StepScore score ) +void GrayArrow::Step() { SetZoom( 0.50 ); BeginTweening( GRAY_ARROW_POP_UP_TIME ); diff --git a/stepmania/src/GrayArrow.h b/stepmania/src/GrayArrow.h index a757c8b00c..cc0afea77e 100644 --- a/stepmania/src/GrayArrow.h +++ b/stepmania/src/GrayArrow.h @@ -22,7 +22,7 @@ public: GrayArrow(); virtual void SetBeat( const float fSongBeat ); - void Step( StepScore score ); + void Step(); }; #endif diff --git a/stepmania/src/HoldGhostArrow.cpp b/stepmania/src/HoldGhostArrow.cpp index 0fdfeaf7cc..4e506514c4 100644 --- a/stepmania/src/HoldGhostArrow.cpp +++ b/stepmania/src/HoldGhostArrow.cpp @@ -42,7 +42,7 @@ void HoldGhostArrow::Update( float fDeltaTime ) m_fHeatLevel = 0; } - int iStateNum = min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 ); + int iStateNum = (int)min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 ); SetState( iStateNum ); if( m_fHeatLevel == 1 ) diff --git a/stepmania/src/HoldGhostArrow.h b/stepmania/src/HoldGhostArrow.h index 0b8548a613..820b3dffeb 100644 --- a/stepmania/src/HoldGhostArrow.h +++ b/stepmania/src/HoldGhostArrow.h @@ -24,7 +24,7 @@ class HoldGhostArrow : public Sprite public: HoldGhostArrow(); - void Update( float fDeltaTime ); + virtual void Update( float fDeltaTime ); void SetBeat( const float fSongBeat ); void Step(); diff --git a/stepmania/src/HoldJudgement.cpp b/stepmania/src/HoldJudgement.cpp new file mode 100644 index 0000000000..b8314a6d2d --- /dev/null +++ b/stepmania/src/HoldJudgement.cpp @@ -0,0 +1,75 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + File: HoldJudgement.h + + Desc: A graphic displayed in the HoldJudgement during Dancing. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#include "HoldJudgement.h" +#include "RageUtil.h" +#include "ScreenDimensions.h" +#include "ThemeManager.h" + + +const float JUDGEMENT_DISPLAY_TIME = 0.6f; + + +HoldJudgement::HoldJudgement() +{ + m_fDisplayCountdown = 0; + m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_JUDGEMENT) ); + m_sprJudgement.StopAnimating(); + this->AddActor( &m_sprJudgement ); +} + +void HoldJudgement::Update( float fDeltaTime ) +{ + ActorFrame::Update( fDeltaTime ); + + m_fDisplayCountdown -= fDeltaTime; + if( m_fDisplayCountdown < 0 ) + m_fDisplayCountdown = 0; +} + +void HoldJudgement::RenderPrimitives() +{ + if( m_fDisplayCountdown > 0 ) + { + ActorFrame::RenderPrimitives(); + } +} + +void HoldJudgement::SetHoldJudgement( HoldStepResult result ) +{ + //RageLog( "Judgement::SetJudgement()" ); + + switch( result ) + { + case HSR_NONE: m_sprJudgement.SetState( 0 ); break; + case HSR_OK: m_sprJudgement.SetState( 7 ); break; + case HSR_NG: m_sprJudgement.SetState( 8 ); break; + default: ASSERT( false ); + } + + m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME; + + if( result == HSR_NG ) + { + // falling down + m_sprJudgement.SetY( -10 ); + m_sprJudgement.SetZoom( 1.0f ); + m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME ); + m_sprJudgement.SetTweenY( 10 ); + } + else if( result == HSR_OK ) + { + // zooming out + m_sprJudgement.SetZoom( 1.5f ); + m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0f ); + m_sprJudgement.SetTweenZoom( 1.0f ); + } +} \ No newline at end of file diff --git a/stepmania/src/HoldJudgement.h b/stepmania/src/HoldJudgement.h new file mode 100644 index 0000000000..3a4f36d26c --- /dev/null +++ b/stepmania/src/HoldJudgement.h @@ -0,0 +1,36 @@ +/* +----------------------------------------------------------------------------- + File: HoldJudgement.h + + Desc: A graphic displayed in the HoldJudgement during Dancing. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + + +#ifndef _HoldJudgement_H_ +#define _HoldJudgement_H_ + + +#include "Sprite.h" +#include "ActorFrame.h" +#include "Song.h" +#include "BitmapText.h" +#include "ThemeManager.h" + + +class HoldJudgement : public ActorFrame +{ +public: + HoldJudgement(); + void SetHoldJudgement( HoldStepResult result ); + virtual void Update( float fDeltaTime ); + virtual void RenderPrimitives(); + +protected: + Sprite m_sprJudgement; + float m_fDisplayCountdown; +}; + +#endif \ No newline at end of file diff --git a/stepmania/src/Judgement.cpp b/stepmania/src/Judgement.cpp new file mode 100644 index 0000000000..a81d65c7fa --- /dev/null +++ b/stepmania/src/Judgement.cpp @@ -0,0 +1,78 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + File: Judgement.h + + Desc: A graphic displayed in the Judgement during Dancing. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#include "Judgement.h" +#include "RageUtil.h" +#include "ScreenDimensions.h" +#include "ThemeManager.h" + + +const float JUDGEMENT_DISPLAY_TIME = 0.6f; + + +Judgement::Judgement() +{ + m_fDisplayCountdown = 0; + m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_JUDGEMENT) ); + m_sprJudgement.StopAnimating(); + this->AddActor( &m_sprJudgement ); +} + +void Judgement::Update( float fDeltaTime ) +{ + ActorFrame::Update( fDeltaTime ); + + m_fDisplayCountdown -= fDeltaTime; + if( m_fDisplayCountdown < 0 ) + m_fDisplayCountdown = 0; +} + +void Judgement::RenderPrimitives() +{ + if( m_fDisplayCountdown > 0 ) + { + ActorFrame::RenderPrimitives(); + } +} + + +void Judgement::SetJudgement( TapStepScore score ) +{ + //RageLog( "Judgement::SetJudgement()" ); + + switch( score ) + { + case TSS_PERFECT: m_sprJudgement.SetState( 0 ); break; + case TSS_GREAT: m_sprJudgement.SetState( 1 ); break; + case TSS_GOOD: m_sprJudgement.SetState( 2 ); break; + case TSS_BOO: m_sprJudgement.SetState( 3 ); break; + case TSS_MISS: m_sprJudgement.SetState( 4 ); break; + default: ASSERT( false ); + } + + m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME; + + if( score == TSS_MISS ) + { + // falling down + m_sprJudgement.SetY( -30 ); + m_sprJudgement.SetZoom( 1.0f ); + m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME ); + m_sprJudgement.SetTweenY( 30 ); + } + else + { + // zooming out + m_sprJudgement.SetZoom( 1.35f ); + m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/5.0f ); + m_sprJudgement.SetTweenZoom( 1.0f ); + } +} \ No newline at end of file diff --git a/stepmania/src/Judgement.h b/stepmania/src/Judgement.h new file mode 100644 index 0000000000..491995c306 --- /dev/null +++ b/stepmania/src/Judgement.h @@ -0,0 +1,36 @@ +/* +----------------------------------------------------------------------------- + File: Judgement.h + + Desc: A graphic displayed in the Judgement during Dancing. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + + +#ifndef _Judgement_H_ +#define _Judgement_H_ + + +#include "Sprite.h" +#include "ActorFrame.h" +#include "Song.h" +#include "BitmapText.h" +#include "ThemeManager.h" + + +class Judgement : public ActorFrame +{ +public: + Judgement(); + void SetJudgement( TapStepScore score ); + virtual void Update( float fDeltaTime ); + virtual void RenderPrimitives(); + +protected: + Sprite m_sprJudgement; + float m_fDisplayCountdown; +}; + +#endif \ No newline at end of file diff --git a/stepmania/src/MusicSortDisplay.cpp b/stepmania/src/MusicSortDisplay.cpp index 91a8004328..cb62ffe442 100644 --- a/stepmania/src/MusicSortDisplay.cpp +++ b/stepmania/src/MusicSortDisplay.cpp @@ -42,14 +42,8 @@ void MusicSortDisplay::Set( SongSortOrder so ) case SORT_BPM: SetState( 2 ); break; - case SORT_ARTIST: - SetState( 3 ); - break; case SORT_MOST_PLAYED: - SetState( 4 ); - break; - case NUM_SORT_ORDERS: - SetState( 5 ); + SetState( 3 ); break; default: ASSERT( false ); // unimplemented MusicSortOrder diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 81222e607d..aa3b036765 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -256,6 +256,14 @@ MusicWheel::MusicWheel() BuildWheelItemDatas( m_WheelItemDatas[so], SongSortOrder(so) ); + if( GAMEINFO->m_pCurSong == NULL // if there is no currently selected song + && GAMEINFO->m_pSongs[0] ) // and there is at least one song + { + GAMEINFO->m_pCurSong = GAMEINFO->m_pSongs[0]; // select the first song + } + + + // find the previously selected song (if any) for( i=0; i &arr case SORT_BPM: SortSongPointerArrayByBPM( arraySongs ); break; - case SORT_ARTIST: - SortSongPointerArrayByArtist( arraySongs ); - break; +// case SORT_ARTIST: +// SortSongPointerArrayByArtist( arraySongs ); +// break; case SORT_MOST_PLAYED: SortSongPointerArrayByMostPlayed( arraySongs ); break; @@ -330,7 +339,6 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr // ...and load new ones switch( so ) { - case SORT_GROUP: case SORT_MOST_PLAYED: case SORT_BPM: // make WheelItems without sections @@ -346,8 +354,9 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr } } break; + case SORT_GROUP: case SORT_TITLE: - case SORT_ARTIST: +// case SORT_ARTIST: { // make WheelItemDatas with sections @@ -425,7 +434,7 @@ float MusicWheel::GetBannerY( float fPosOffsetsFromMiddle ) float MusicWheel::GetBannerBrightness( float fPosOffsetsFromMiddle ) { - return 1 - fabs(fPosOffsetsFromMiddle)*0.11f; + return 1 - fabsf(fPosOffsetsFromMiddle)*0.11f; } float MusicWheel::GetBannerAlpha( float fPosOffsetsFromMiddle ) @@ -452,25 +461,25 @@ float MusicWheel::GetBannerAlpha( float fPosOffsetsFromMiddle ) float MusicWheel::GetBannerX( float fPosOffsetsFromMiddle ) { - float fX = (1-cos((fPosOffsetsFromMiddle)/3))*95.0f; + float fX = (1-cosf((fPosOffsetsFromMiddle)/3))*95.0f; if( m_WheelState == STATE_FLYING_OFF_BEFORE_NEXT_SORT || m_WheelState == STATE_TWEENING_OFF_SCREEN ) { - float fDistFromCenter = fabs( fPosOffsetsFromMiddle ); + float fDistFromCenter = fabsf( fPosOffsetsFromMiddle ); float fPercentOffScreen = 1- (m_fTimeLeftInState / FADE_TIME); float fXLogicalOffset = max( 0, fPercentOffScreen - 1 + (fDistFromCenter+3)/6 ); - fXLogicalOffset = pow( fXLogicalOffset, 1.7 ); // accelerate + fXLogicalOffset = powf( fXLogicalOffset, 1.7f ); // accelerate float fXPixelOffset = fXLogicalOffset * 600; fX += fXPixelOffset; } else if( m_WheelState == STATE_FLYING_ON_AFTER_NEXT_SORT || m_WheelState == STATE_TWEENING_ON_SCREEN ) { - float fDistFromCenter = fabs( fPosOffsetsFromMiddle ); + float fDistFromCenter = fabsf( fPosOffsetsFromMiddle ); float fPercentOffScreen = m_fTimeLeftInState / FADE_TIME; float fXLogicalOffset = max( 0, fPercentOffScreen - 1 + (fDistFromCenter+3)/6 ); - fXLogicalOffset = pow( fXLogicalOffset, 1.7 ); // accelerate + fXLogicalOffset = powf( fXLogicalOffset, 1.7f ); // accelerate float fXPixelOffset = fXLogicalOffset * 600; fX += fXPixelOffset; } @@ -585,6 +594,7 @@ void MusicWheel::Update( float fDeltaTime ) m_fTimeLeftInState = FADE_TIME; Song* pPrevSelectedSong = GetCurWheelItemDatas()[m_iSelection].m_pSong; + CString sPrevSelectedSection = GetCurWheelItemDatas()[m_iSelection].m_sSectionName; // change the sort order m_SortOrder = SongSortOrder(m_SortOrder+1); @@ -598,11 +608,31 @@ void MusicWheel::Update( float fDeltaTime ) m_MusicSortDisplay.SetTweenXY( SORT_ICON_ON_SCREEN_X, SORT_ICON_ON_SCREEN_Y ); - // find the previously selected song, and select it - for( i=0; iGetGroupName(); - sTemp.MakeUpper(); - sTemp = (sTemp.GetLength() > 0) ? sTemp : ""; - if( IsAnInt(sTemp) ) - sTemp = "NUM"; - return sTemp; - case SORT_ARTIST: - sTemp = pSong->GetArtist(); - sTemp.MakeUpper(); - sTemp = (sTemp.GetLength() > 0) ? sTemp.Left(1) : ""; - if( IsAnInt(sTemp) ) - sTemp = "NUM"; return sTemp; +// case SORT_ARTIST: +// sTemp = pSong->GetArtist(); +// sTemp.MakeUpper(); +// sTemp = (sTemp.GetLength() > 0) ? sTemp.Left(1) : ""; +// if( IsAnInt(sTemp) ) +// sTemp = "NUM"; +// return sTemp; case SORT_TITLE: sTemp = pSong->GetTitle(); sTemp.MakeUpper(); diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index ddc05d25da..2f0f317b41 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -17,625 +17,259 @@ #include "ThemeManager.h" - -const float LIFE_PERFECT = 0.010f; -const float LIFE_GREAT = 0.005f; -const float LIFE_GOOD = 0.000f; -const float LIFE_BOO = -0.010f; -const float LIFE_MISS = -0.020f; - -const int ARROW_SIZE = 64; - -const float ARROW_X_OFFSET[6] = { - ARROW_SIZE*-2.5, - ARROW_SIZE*-1.5, - ARROW_SIZE*-0.5, - ARROW_SIZE* 0.5, - ARROW_SIZE* 1.5, - ARROW_SIZE* 2.5 -}; - -const float GRAY_ARROW_Y = ARROW_SIZE * 1.5; -const float ARROW_GAP = 70; -const int NUM_FRAMES_IN_COLOR_ARROW_SPRITE = 12; - - -const float JUDGEMENT_DISPLAY_TIME = 0.6f; -const float JUDGEMENT_Y_OFFSET = 20; - -const float HOLD_JUDGEMENT_Y = GRAY_ARROW_Y + 80; - - - -const float COMBO_TWEEN_TIME = 0.5f; -const float COMBO_Y = (CENTER_Y+60); - - -const int LIEFMETER_NUM_PILLS = 17; -const float LIFEMETER_Y = 30; -const float LIFEMETER_PILLS_Y = LIFEMETER_Y; -const float PILL_OFFSET_Y[LIEFMETER_NUM_PILLS] = { - 0.3f, 0.7f, 1.0f, 0.7f, 0.3f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f // kind of a sin wave -}; - -const float SCORE_Y = SCREEN_HEIGHT - 40; +const float JUDGEMENT_Y = CENTER_Y; +const float ARROWS_Y = SCREEN_TOP + ARROW_SIZE * 1.5f; +const float HOLD_JUDGEMENT_Y = ARROWS_Y + 80; +const float LIFEMETER_Y = SCREEN_TOP + 30; +const float COMBO_Y = CENTER_Y + 60; +const float SCORE_Y = SCREEN_HEIGHT - 40; const float HOLD_ARROW_NG_TIME = 0.27f; + Player::Player() { - m_iCurCombo = 0; - m_iMaxCombo = 0; - m_fLifePercentage = 0.50f; - m_fScore = 0; + + m_fSongBeat = 0; + m_PlayerNumber = PLAYER_NONE; // init step elements - for( int i=0; i mapStepToRotation; // arrow facing left is rotation 0 - mapStepToRotation[STEP_PAD1_LEFT] = 0; - mapStepToRotation[STEP_PAD1_UPLEFT] = D3DX_PI/4.0f; - mapStepToRotation[STEP_PAD1_DOWN] = -D3DX_PI/2.0f; - mapStepToRotation[STEP_PAD1_UP] = D3DX_PI/2.0f; - mapStepToRotation[STEP_PAD1_UPRIGHT]= D3DX_PI*3.0f/4.0f; - mapStepToRotation[STEP_PAD1_RIGHT] = D3DX_PI; - mapStepToRotation[STEP_PAD2_LEFT] = mapStepToRotation[STEP_PAD1_LEFT]; - mapStepToRotation[STEP_PAD2_UPLEFT] = mapStepToRotation[STEP_PAD1_UPLEFT]; - mapStepToRotation[STEP_PAD2_DOWN] = mapStepToRotation[STEP_PAD1_DOWN]; - mapStepToRotation[STEP_PAD2_UP] = mapStepToRotation[STEP_PAD1_UP]; - mapStepToRotation[STEP_PAD2_UPRIGHT]= mapStepToRotation[STEP_PAD1_UPRIGHT]; - mapStepToRotation[STEP_PAD2_RIGHT] = mapStepToRotation[STEP_PAD1_RIGHT]; - - - - switch( GAMEINFO->m_GameMode ) - { - case MODE_SINGLE: - case MODE_VERSUS: - case MODE_COUPLE: - m_iNumColumns = 4; // LEFT, DOWN, UP, RIGHT - m_StepToColumnNumber[STEP_PAD1_LEFT] = 0; - m_StepToColumnNumber[STEP_PAD1_DOWN] = 1; - m_StepToColumnNumber[STEP_PAD1_UP] = 2; - m_StepToColumnNumber[STEP_PAD1_RIGHT] = 3; - m_ColumnNumberToStep[0] = STEP_PAD1_LEFT; - m_ColumnNumberToStep[1] = STEP_PAD1_DOWN; - m_ColumnNumberToStep[2] = STEP_PAD1_UP; - m_ColumnNumberToStep[3] = STEP_PAD1_RIGHT; - m_ColumnToRotation[0] = mapStepToRotation[STEP_PAD1_LEFT]; - m_ColumnToRotation[1] = mapStepToRotation[STEP_PAD1_DOWN]; - m_ColumnToRotation[2] = mapStepToRotation[STEP_PAD1_UP]; - m_ColumnToRotation[3] = mapStepToRotation[STEP_PAD1_RIGHT]; - break; - case MODE_SOLO: - m_iNumColumns = 6; // LEFT, UP+LEFT, DOWN, UP, UP+RIGHT, RIGHT - m_StepToColumnNumber[STEP_PAD1_LEFT] = 0; - m_StepToColumnNumber[STEP_PAD1_UPLEFT] = 1; - m_StepToColumnNumber[STEP_PAD1_DOWN] = 2; - m_StepToColumnNumber[STEP_PAD1_UP] = 3; - m_StepToColumnNumber[STEP_PAD1_UPRIGHT] = 4; - m_StepToColumnNumber[STEP_PAD1_RIGHT] = 5; - m_ColumnNumberToStep[0] = STEP_PAD1_LEFT; - m_ColumnNumberToStep[1] = STEP_PAD1_UPLEFT; - m_ColumnNumberToStep[2] = STEP_PAD1_DOWN; - m_ColumnNumberToStep[3] = STEP_PAD1_UP; - m_ColumnNumberToStep[4] = STEP_PAD1_UPRIGHT; - m_ColumnNumberToStep[5] = STEP_PAD1_RIGHT; - m_ColumnToRotation[0] = mapStepToRotation[STEP_PAD1_LEFT]; - m_ColumnToRotation[1] = mapStepToRotation[STEP_PAD1_UPLEFT]; - m_ColumnToRotation[2] = mapStepToRotation[STEP_PAD1_DOWN]; - m_ColumnToRotation[3] = mapStepToRotation[STEP_PAD1_UP]; - m_ColumnToRotation[4] = mapStepToRotation[STEP_PAD1_UPRIGHT]; - m_ColumnToRotation[5] = mapStepToRotation[STEP_PAD1_RIGHT]; - break; - case MODE_DOUBLE: - m_iNumColumns = 8; // 1_LEFT, 1_DOWN, 1_UP, 1_RIGHT, 2_LEFT, 2_DOWN, 2_UP, 2_RIGHT - m_StepToColumnNumber[STEP_PAD1_LEFT] = 0; - m_StepToColumnNumber[STEP_PAD1_DOWN] = 1; - m_StepToColumnNumber[STEP_PAD1_UP] = 2; - m_StepToColumnNumber[STEP_PAD1_RIGHT] = 3; - m_StepToColumnNumber[STEP_PAD2_LEFT] = 4; - m_StepToColumnNumber[STEP_PAD2_DOWN] = 5; - m_StepToColumnNumber[STEP_PAD2_UP] = 6; - m_StepToColumnNumber[STEP_PAD2_RIGHT] = 7; - m_ColumnNumberToStep[0] = STEP_PAD1_LEFT; - m_ColumnNumberToStep[1] = STEP_PAD1_DOWN; - m_ColumnNumberToStep[2] = STEP_PAD1_UP; - m_ColumnNumberToStep[3] = STEP_PAD1_RIGHT; - m_ColumnNumberToStep[4] = STEP_PAD2_LEFT; - m_ColumnNumberToStep[5] = STEP_PAD2_DOWN; - m_ColumnNumberToStep[6] = STEP_PAD2_UP; - m_ColumnNumberToStep[7] = STEP_PAD2_RIGHT; - m_ColumnToRotation[0] = mapStepToRotation[STEP_PAD1_LEFT]; - m_ColumnToRotation[1] = mapStepToRotation[STEP_PAD1_DOWN]; - m_ColumnToRotation[2] = mapStepToRotation[STEP_PAD1_UP]; - m_ColumnToRotation[3] = mapStepToRotation[STEP_PAD1_RIGHT]; - m_ColumnToRotation[4] = mapStepToRotation[STEP_PAD2_LEFT]; - m_ColumnToRotation[5] = mapStepToRotation[STEP_PAD2_DOWN]; - m_ColumnToRotation[6] = mapStepToRotation[STEP_PAD2_UP]; - m_ColumnToRotation[7] = mapStepToRotation[STEP_PAD2_RIGHT]; - break; - default: - ASSERT( false ); // invalid GameMode - } - - - // init arrow rotations - for( int c=0; c < MAX_NUM_COLUMNS; c++ ) { - m_GrayArrow[c].SetRotation( m_ColumnToRotation[c] ); - m_GhostArrow[c].SetRotation( m_ColumnToRotation[c] ); - m_GhostArrowBright[c].SetRotation( m_ColumnToRotation[c] ); - m_HoldGhostArrow[c].SetRotation( m_ColumnToRotation[c] ); - m_ColorArrow[c].SetRotation( m_ColumnToRotation[c] ); - } - - - // holder for judgement and combo displays - m_frameJudgementAndCombo.AddActor( &m_sprJudgement ); - m_frameJudgementAndCombo.AddActor( &m_sprCombo ); - m_frameJudgementAndCombo.AddActor( &m_textComboNumber ); - m_frameJudgementAndCombo.SetXY( CENTER_X, CENTER_Y ); - - // judgement - m_fJudgementDisplayCountdown = 0; - m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_JUDGEMENT) ); - m_sprJudgement.StopAnimating(); - m_sprJudgement.SetXY( 0, m_PlayerOptions.m_bReverseScroll ? JUDGEMENT_Y_OFFSET : -JUDGEMENT_Y_OFFSET ); - - // combo - m_sprCombo.Load( THEME->GetPathTo(GRAPHIC_COMBO) ); - m_sprCombo.StopAnimating(); - m_sprCombo.SetXY( 40, m_PlayerOptions.m_bReverseScroll ? -JUDGEMENT_Y_OFFSET : JUDGEMENT_Y_OFFSET+2 ); - m_sprCombo.SetZoom( 1.0f ); - - m_textComboNumber.Load( THEME->GetPathTo(FONT_COMBO_NUMBERS) ); - m_textComboNumber.SetXY( -40, m_PlayerOptions.m_bReverseScroll ? -JUDGEMENT_Y_OFFSET : JUDGEMENT_Y_OFFSET ); - - m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible - m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible - - - // hold judgement - for( c=0; cGetPathTo(GRAPHIC_JUDGEMENT) ); - m_sprHoldJudgement[c].StopAnimating(); - } - - // life meter - m_sprLifeMeterFrame.Load( THEME->GetPathTo(GRAPHIC_LIFEMETER_FRAME) ); - m_sprLifeMeterFrame.StopAnimating(); - m_sprLifeMeterPills.Load( THEME->GetPathTo(GRAPHIC_LIFEMETER_PILLS) ); - m_sprLifeMeterPills.StopAnimating(); - - // score - m_sprScoreFrame.Load( THEME->GetPathTo(GRAPHIC_SCORE_FRAME) ); - m_ScoreDisplay.SetScore( 0 ); - - - SetX( CENTER_X ); + this->AddActor( &m_GrayArrows ); + this->AddActor( &m_ColorArrowField ); + this->AddActor( &m_GhostArrows ); + this->AddActor( &m_Judgement ); + for( int c=0; cAddActor( &m_HoldJudgement[c] ); + this->AddActor( &m_Combo ); + this->AddActor( &m_LifeMeter ); + this->AddActor( &m_Score ); // assist m_soundAssistTick.Load( THEME->GetPathTo(SOUND_ASSIST) ); - } -void Player::SetPlayerOptions( PlayerOptions po, PlayerNumber pn ) +void Player::Load( const Style& style, PlayerNumber player_no, const Steps& steps, const PlayerOptions& po ) { - m_PlayerOptions = po; - m_PlayerNumber = pn; -} + //RageLog( "Player::Load()", ); + m_Style = style; + m_PlayerNumber = player_no; -void Player::SetX( float fX ) -{ - m_fArrowsCenterX = fX; - int fXInt = (int)m_fArrowsCenterX; + Steps steps2 = steps; - SetGrayArrowsX(fXInt); - SetGhostArrowsX(fXInt); - SetColorArrowsX(fXInt); - SetJudgementX(fXInt); - SetComboX(fXInt); - SetScoreX(fXInt); - SetLifeMeterX(fXInt); + if( !po.m_bAllowFreezeArrows ) + steps2.RemoveHoldSteps(); - m_frameJudgementAndCombo.SetX(fX); -} + steps2.Turn( po.m_TurnType ); + if( po.m_bLittle ) + steps2.MakeLittle(); -void Player::SetSteps( Steps* pNewSteps, bool bLoadOnlyLeftSide, bool bLoadOnlyRightSide ) -{ - Step tempSteps[MAX_STEP_ELEMENTS]; - CArray tempHoldSteps; + m_ColorArrowField.Load( style, steps2, po, 2, 10 ); + m_GrayArrows.Load( style ); + m_GhostArrows.Load( style ); - // copy the steps into our tempSteps where we will transform them - for( int i=0; im_Steps[i]; + m_TapStepsOriginal[i] = steps.m_TapSteps[i]; + m_TapStepsRemaining[i] = steps.m_TapSteps[i]; + } + for( i=0; im_HoldSteps.GetSize(); i++ ) - { - HoldStep &hs = pNewSteps->m_HoldSteps[i]; - - if( bLoadOnlyLeftSide ) - { - if( hs.m_Step & (STEP_PAD1_LEFT | STEP_PAD1_UPLEFT | STEP_PAD1_DOWN | STEP_PAD1_UP | STEP_PAD1_UPRIGHT | STEP_PAD1_RIGHT) ) - tempHoldSteps.Add( hs ); - } - else if( bLoadOnlyRightSide ) - { - if( hs.m_Step & (STEP_PAD2_LEFT | STEP_PAD2_UPLEFT | STEP_PAD2_DOWN | STEP_PAD2_UP | STEP_PAD2_UPRIGHT | STEP_PAD2_RIGHT) ) - tempHoldSteps.Add( hs ); - } - else // load both sides - { - tempHoldSteps.Add( hs ); - } - } - } - - - // transform the steps - Step oldStepToNewStep [12][2]; // 0 is old Step, 1 is new Step mapping - oldStepToNewStep[0][0] = STEP_PAD1_LEFT; oldStepToNewStep[0][1] = STEP_PAD1_LEFT; - oldStepToNewStep[1][0] = STEP_PAD1_UPLEFT; oldStepToNewStep[1][1] = STEP_PAD1_UPLEFT; - oldStepToNewStep[2][0] = STEP_PAD1_DOWN; oldStepToNewStep[2][1] = STEP_PAD1_DOWN; - oldStepToNewStep[3][0] = STEP_PAD1_UP; oldStepToNewStep[3][1] = STEP_PAD1_UP; - oldStepToNewStep[4][0] = STEP_PAD1_UPRIGHT; oldStepToNewStep[4][1] = STEP_PAD1_UPRIGHT; - oldStepToNewStep[5][0] = STEP_PAD1_RIGHT; oldStepToNewStep[5][1] = STEP_PAD1_RIGHT; - oldStepToNewStep[6][0] = STEP_PAD2_LEFT; oldStepToNewStep[6][1] = STEP_PAD2_LEFT; - oldStepToNewStep[7][0] = STEP_PAD2_UPLEFT; oldStepToNewStep[7][1] = STEP_PAD2_UPLEFT; - oldStepToNewStep[8][0] = STEP_PAD2_DOWN; oldStepToNewStep[8][1] = STEP_PAD2_DOWN; - oldStepToNewStep[9][0] = STEP_PAD2_UP; oldStepToNewStep[9][1] = STEP_PAD2_UP; - oldStepToNewStep[10][0]= STEP_PAD2_UPRIGHT; oldStepToNewStep[10][1]= STEP_PAD2_UPRIGHT; - oldStepToNewStep[11][0]= STEP_PAD2_RIGHT; oldStepToNewStep[11][1]= STEP_PAD2_RIGHT; - - - switch( m_PlayerOptions.m_TurnType ) - { - case PlayerOptions::TURN_NONE: - break; - case PlayerOptions::TURN_MIRROR: - oldStepToNewStep[0][1] = STEP_PAD1_RIGHT; - oldStepToNewStep[2][1] = STEP_PAD1_UP; - oldStepToNewStep[3][1] = STEP_PAD1_DOWN; - oldStepToNewStep[5][1] = STEP_PAD1_LEFT; - oldStepToNewStep[6][1] = STEP_PAD2_RIGHT; - oldStepToNewStep[8][1] = STEP_PAD2_UP; - oldStepToNewStep[9][1] = STEP_PAD2_DOWN; - oldStepToNewStep[11][1]= STEP_PAD2_LEFT; - break; - case PlayerOptions::TURN_LEFT: - oldStepToNewStep[0][1] = STEP_PAD1_DOWN; - oldStepToNewStep[2][1] = STEP_PAD1_RIGHT; - oldStepToNewStep[3][1] = STEP_PAD1_LEFT; - oldStepToNewStep[5][1] = STEP_PAD1_UP; - oldStepToNewStep[6][1] = STEP_PAD2_DOWN; - oldStepToNewStep[8][1] = STEP_PAD2_RIGHT; - oldStepToNewStep[9][1] = STEP_PAD2_LEFT; - oldStepToNewStep[11][1]= STEP_PAD2_UP; - break; - case PlayerOptions::TURN_RIGHT: - oldStepToNewStep[0][1] = STEP_PAD1_UP; - oldStepToNewStep[2][1] = STEP_PAD1_LEFT; - oldStepToNewStep[3][1] = STEP_PAD1_RIGHT; - oldStepToNewStep[5][1] = STEP_PAD1_DOWN; - oldStepToNewStep[6][1] = STEP_PAD2_UP; - oldStepToNewStep[8][1] = STEP_PAD2_LEFT; - oldStepToNewStep[9][1] = STEP_PAD2_RIGHT; - oldStepToNewStep[11][1]= STEP_PAD2_DOWN; - break; - case PlayerOptions::TURN_SHUFFLE: - bool bAlreadyMapped[12]; - for( int i=0; i<12; i++ ) - bAlreadyMapped[i] = false; - - // hack: don't shuffle the Up+... Steps - bAlreadyMapped[1] = true; - bAlreadyMapped[4] = true; - bAlreadyMapped[7] = true; - bAlreadyMapped[10] = true; - - // shuffle left side - for( i=0; i<6; i++ ) - { - if( i == 1 || i == 4 ) - continue; - - int iMapsTo; - do { - iMapsTo = rand()%6; - } while( bAlreadyMapped[iMapsTo] ); - bAlreadyMapped[iMapsTo] = true; - - oldStepToNewStep[i][1] = oldStepToNewStep[iMapsTo][0]; - } - // shuffle right side - for( i=6; i<12; i++ ) - { - if( i == 7 || i == 10 ) - continue; - - int iMapsTo; - do { - iMapsTo = rand()%6+6; - } while( bAlreadyMapped[iMapsTo] ); - bAlreadyMapped[iMapsTo] = true; - - oldStepToNewStep[i][1] = oldStepToNewStep[iMapsTo][0]; - } - break; - } - - // transform tempSteps and store them in the Player's structures - for( i=0; i 0 ) { - SetJudgement( miss ); - EndCombo(); + m_Judgement.SetJudgement( TSS_MISS ); + m_Combo.EndCombo(); for( int i=0; iIsButtonDown( PlayerI ) ) // they're holding the button down + PlayerInput PlayerI = { m_PlayerNumber, hs.m_TapStep }; + bool bIsHoldingButton = GAMEINFO->IsButtonDown( PlayerI ); + if( bIsHoldingButton ) { - hss.m_fTimeNotHeld = clamp( hss.m_fTimeNotHeld-fDeltaTime, 0, HOLD_ARROW_NG_TIME ); - int iCol = m_StepToColumnNumber[ hs.m_Step ]; - m_HoldGhostArrow[iCol].Step(); + hss.m_fLife += fDeltaTime/HOLD_ARROW_NG_TIME; + hss.m_fLife = min( hss.m_fLife, 1 ); // clamp + int iCol = m_Style.TapStepToColumnNumber( hs.m_TapStep ); + m_GhostArrows.HoldStep( iCol ); // update the "electric ghost" effect } + else // !bIsHoldingButton + { + hss.m_fLife -= fDeltaTime/HOLD_ARROW_NG_TIME; + hss.m_fLife = max( hss.m_fLife, 0 ); // clamp + } + m_ColorArrowField.SetHoldStepLife( i, hss.m_fLife ); // update the ColorArrowField display } - // update the logic - if( (m_HoldStepScores[i].m_HoldScore == HoldStepScore::HOLD_SCORE_NONE || m_HoldStepScores[i].m_HoldScore == HoldStepScore::HOLD_STEPPED_ON) && // this hold doesn't already have a score - fStartBeat+fMaxBeatDifference/2 < m_fSongBeat && m_fSongBeat < fEndBeat-fMaxBeatDifference/2 ) // if the song beat is in the range of this hold + // check for NG + if( hss.m_fLife == 0 ) // the player has not pressed the button for a long time! { - PlayerInput PlayerI = { m_PlayerNumber, hs.m_Step }; - if( !GAMEINFO->IsButtonDown( PlayerI ) ) // they're not holding the button down - { - hss.m_fTimeNotHeld = clamp( hss.m_fTimeNotHeld+fDeltaTime, 0, HOLD_ARROW_NG_TIME ); - if( hss.m_fTimeNotHeld >= HOLD_ARROW_NG_TIME ) // the player has not pressed the button for a long time! - { - hss.m_fTimeNotHeld = HOLD_ARROW_NG_TIME; - hss.m_HoldScore = HoldStepScore::HOLD_SCORE_NG; - int iCol = m_StepToColumnNumber[ hs.m_Step ]; - SetHoldJudgement( iCol, HoldStepScore::HOLD_SCORE_NG ); - } - } + hss.m_Result = HSR_NG; + int iCol = m_Style.TapStepToColumnNumber( hs.m_TapStep ); + m_HoldJudgement[iCol].SetHoldJudgement( HSR_NG ); } - } - // check for HoldStep completes - for( i=0; i fEndBeat && // if this hold step is in the past - m_HoldStepScores[i].m_HoldScore == HoldStepScore::HOLD_STEPPED_ON ) // and it doesn't yet have a score + // check for OK + if( m_fSongBeat > fEndBeat ) // if this HoldStep is in the past { - hss.m_fTimeNotHeld = 0; - m_HoldStepScores[i].m_HoldScore = HoldStepScore::HOLD_SCORE_OK; - int iCol = m_StepToColumnNumber[ hs.m_Step ]; - SetHoldJudgement( iCol, HoldStepScore::HOLD_SCORE_OK ); + // this implies that hss.m_fLife > 0, or else we would have marked it NG above + hss.m_fLife = 1; + hss.m_Result = HSR_OK; + int iCol = m_Style.TapStepToColumnNumber( hs.m_TapStep ); + m_HoldJudgement[iCol].SetHoldJudgement( HSR_OK ); + m_ColorArrowField.SetHoldStepLife( i, hss.m_fLife ); // update the ColorArrowField display } } - UpdateGrayArrows( fDeltaTime ); - UpdateColorArrows( fDeltaTime ); - UpdateGhostArrows( fDeltaTime ); - UpdateJudgement( fDeltaTime ); - UpdateCombo( fDeltaTime ); - UpdateScore( fDeltaTime ); - UpdateLifeMeter( fDeltaTime ); + ActorFrame::Update( fDeltaTime ); + + m_LifeMeter.SetBeat( fSongBeat ); + + m_GrayArrows.Update( fDeltaTime, fSongBeat ); + m_ColorArrowField.Update( fDeltaTime, fSongBeat ); + m_GhostArrows.Update( fDeltaTime, fSongBeat ); + + m_fSongBeat = fSongBeat; // save song beat - m_frameJudgementAndCombo.Update( fDeltaTime ); } void Player::CrossedIndex( int iIndex ) { - if( GAMEINFO->m_SongOptions.m_AssistType == SongOptions::ASSIST_TICK ) - { - bool bThereIsANoteThisIndex = false; - bThereIsANoteThisIndex |= (m_OriginalStep[iIndex] != STEP_NONE); - - for( int i=0; i 100 ); // update the combo display - switch( stepscore ) + switch( score ) { - case perfect: - case great: - ContinueCombo(); + case TSS_PERFECT: + case TSS_GREAT: + m_Combo.ContinueCombo(); break; - case good: - case boo: - EndCombo(); + case TSS_GOOD: + case TSS_BOO: + m_Combo.EndCombo(); break; } @@ -647,7 +281,7 @@ void Player::HandlePlayerStep( float fSongBeat, Step player_step, float fMaxBeat } -void Player::CheckForCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDiff ) +void Player::CheckForCompleteStep( float fSongBeat, TapStep player_step, float fMaxBeatDiff ) { //RageLog( "Player::CheckForCompleteStep()" ); @@ -664,17 +298,17 @@ void Player::CheckForCompleteStep( float fSongBeat, Step player_step, float fMax int iCurrentIndexLater = iIndexStartLookingAt + delta; // silly check to make sure we don't go out of bounds - iCurrentIndexEarlier = clamp( iCurrentIndexEarlier, 0, MAX_STEP_ELEMENTS-1 ); - iCurrentIndexLater = clamp( iCurrentIndexLater, 0, MAX_STEP_ELEMENTS-1 ); + iCurrentIndexEarlier = clamp( iCurrentIndexEarlier, 0, MAX_TAP_STEP_ELEMENTS-1 ); + iCurrentIndexLater = clamp( iCurrentIndexLater, 0, MAX_TAP_STEP_ELEMENTS-1 ); //////////////////////////// // check the step to the left of iIndexStartLookingAt //////////////////////////// //RageLog( "Checking steps[%d]", iCurrentIndexEarlier ); - if( m_LeftToStepOn[iCurrentIndexEarlier] & player_step ) // these steps overlap + if( m_TapStepsRemaining[iCurrentIndexEarlier] & player_step ) // these steps overlap { - m_LeftToStepOn[iCurrentIndexEarlier] &= ~player_step; // subtract player_step - if( m_LeftToStepOn[iCurrentIndexEarlier] == 0 ) { // did this complete the step? + m_TapStepsRemaining[iCurrentIndexEarlier] &= ~player_step; // subtract player_step + if( m_TapStepsRemaining[iCurrentIndexEarlier] == 0 ) { // did this complete the step? OnCompleteStep( fSongBeat, player_step, fMaxBeatDiff, iCurrentIndexEarlier ); return; } @@ -684,10 +318,10 @@ void Player::CheckForCompleteStep( float fSongBeat, Step player_step, float fMax // check the step to the right of iIndexStartLookingAt //////////////////////////// //RageLog( "Checking steps[%d]", iCurrentIndexLater ); - if( m_LeftToStepOn[iCurrentIndexLater] & player_step ) // these steps overlap + if( m_TapStepsRemaining[iCurrentIndexLater] & player_step ) // these steps overlap { - m_LeftToStepOn[iCurrentIndexLater] &= ~player_step; // subtract player_step - if( m_LeftToStepOn[iCurrentIndexLater] == 0 ) { // did this complete the step? + m_TapStepsRemaining[iCurrentIndexLater] &= ~player_step; // subtract player_step + if( m_TapStepsRemaining[iCurrentIndexLater] == 0 ) { // did this complete the step? OnCompleteStep( fSongBeat, player_step, fMaxBeatDiff, iCurrentIndexLater ); return; } @@ -695,52 +329,100 @@ void Player::CheckForCompleteStep( float fSongBeat, Step player_step, float fMax } } -void Player::OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDiff, int iIndexThatWasSteppedOn ) +void Player::OnCompleteStep( float fSongBeat, TapStep player_step, float fMaxBeatDiff, int iIndexThatWasSteppedOn ) { - float fStepBeat = StepIndexToBeat( iIndexThatWasSteppedOn ); + float fStepBeat = StepIndexToBeat( (float)iIndexThatWasSteppedOn ); float fBeatsUntilStep = fStepBeat - fSongBeat; - float fPercentFromPerfect = (float)fabs( fBeatsUntilStep / fMaxBeatDiff ); + float fPercentFromPerfect = fabsf( fBeatsUntilStep / fMaxBeatDiff ); //RageLog( "fBeatsUntilStep: %f, fPercentFromPerfect: %f", // fBeatsUntilStep, fPercentFromPerfect ); // compute what the score should be for the note we stepped on - StepScore &stepscore = m_StepScore[iIndexThatWasSteppedOn]; + TapStepScore &score = m_TapStepScores[iIndexThatWasSteppedOn]; - if( fPercentFromPerfect < 0.25f ) stepscore = perfect; - else if( fPercentFromPerfect < 0.50f ) stepscore = great; - else if( fPercentFromPerfect < 0.75f ) stepscore = good; - else stepscore = boo; + if( fPercentFromPerfect < 0.25f ) score = TSS_PERFECT; + else if( fPercentFromPerfect < 0.50f ) score = TSS_GREAT; + else if( fPercentFromPerfect < 0.75f ) score = TSS_GOOD; + else score = TSS_BOO; // update the judgement, score, and life - SetJudgement( stepscore ); - ChangeScore( stepscore, m_iCurCombo ); - ChangeLife( stepscore ); + m_Judgement.SetJudgement( score ); + m_Score.AddToScore( score, m_Combo.GetCurrentCombo() ); + m_LifeMeter.ChangeLife( score ); - // show the gray arrow ghost - for( int c=0; c < m_iNumColumns; c++ ) { // for each arrow column - if( m_OriginalStep[iIndexThatWasSteppedOn] & m_ColumnNumberToStep[c] ) { // this column is still unstepped on? - GhostArrowStep( c, stepscore ); - } + + // remove this row from the ColorArrowField + m_ColorArrowField.RemoveTapStepRow( iIndexThatWasSteppedOn ); + + // check to see if this completes a row of notes + for( int c=0; c100 ); // show the ghost arrow for this column } // update the combo display - switch( stepscore ) + switch( score ) { - case perfect: - case great: - ContinueCombo(); + case TSS_PERFECT: + case TSS_GREAT: + m_Combo.ContinueCombo(); break; - case good: - case boo: - EndCombo(); + case TSS_GOOD: + case TSS_BOO: + m_Combo.EndCombo(); break; } } +ScoreSummary Player::GetScoreSummary() +{ + ScoreSummary scoreSummary; + + for( int i=0; i= 100 ) - m_GhostArrowBright[index].Step( score ); - else - m_GhostArrow[index].Step( score ); -} - -void Player::UpdateColorArrows( float fDeltaTime ) -{ - int iIndexFirstArrowToDraw = BeatToStepIndex( m_fSongBeat - 2.0f ); // 2 beats earlier - if( iIndexFirstArrowToDraw < 0 ) iIndexFirstArrowToDraw = 0; - int iIndexLastArrowToDraw = BeatToStepIndex( m_fSongBeat + 7.0f ); // 7 beats later - - for( int c=0; c < m_iNumColumns; c++ ) - m_ColorArrow[c].Update( fDeltaTime ); - -} - - -// -// modified to add color shifting to the arrow texture -// -void Player::DrawColorArrows() -{ - //RageLog( "ColorArrows::Draw(%f)", fSongBeat ); - - int iBaseFrameNo = (int)(m_fSongBeat*2.5) % 12; // 2.5 is a "fudge number" :-) This should be based on BPM - if( iBaseFrameNo < 0 ) - iBaseFrameNo = 0; - - if( m_fSongBeat < 0 ) - m_fSongBeat = 0; - int iIndexFirstArrowToDraw = BeatToStepIndex( m_fSongBeat - 2.0f ); // 2 beats earlier - if( iIndexFirstArrowToDraw < 0 ) iIndexFirstArrowToDraw = 0; - int iIndexLastArrowToDraw = BeatToStepIndex( m_fSongBeat + 7.0f ); // 7 beats later - - //RageLog( "Drawing elements %d through %d", iIndexFirstArrowToDraw, iIndexLastArrowToDraw ); - - // draw all normal arrows - for( int i=iIndexFirstArrowToDraw; i<=iIndexLastArrowToDraw; i++ ) // for each row - { - if( m_LeftToStepOn[i] != 0 || // this step is not yet complete - m_StepScore[i] == good || m_StepScore[i] == boo || m_StepScore[i] == miss ) - { - float fYOffset = GetColorArrowYOffset( i, m_fSongBeat ); - float fYPos = GetColorArrowYPos( i, m_fSongBeat ); - if( m_PlayerOptions.m_bReverseScroll ) fYPos = SCREEN_HEIGHT - fYPos; - - float fAlpha = GetColorArrowAlphaFromYOffset( fYOffset ); - - // beats until the note is stepped on. - float fBeatsTilStep = StepIndexToBeat( i ) - m_fSongBeat; - - //RageLog( "iYPos: %d, iFrameNo: %d, m_OriginalStep[i]: %d", iYPos, iFrameNo, m_OriginalStep[i] ); - - // See if there is a hold step that begins on this beat. Terribly inefficient! - bool bHoldStepOnThisBeat = false; - for (int j=0; j iIndexLastArrowToDraw ) ) - { - continue; - } - - HoldStepScore &hss = m_HoldStepScores[i]; - - int iColNum = m_StepToColumnNumber[ hs.m_Step ]; - - switch( hss.m_HoldScore ) - { - case HoldStepScore::HOLD_SCORE_OK: - continue; // don't draw - case HoldStepScore::HOLD_SCORE_NONE: - case HoldStepScore::HOLD_SCORE_NG: - m_ColorArrow[iColNum].SetGrayPartClear(); - break; - case HoldStepScore::HOLD_STEPPED_ON: - m_ColorArrow[iColNum].SetGrayPartFull(); - break; - } - - // draw the gray parts - for( float j=hs.m_iStartIndex; j<=hs.m_iEndIndex; j+=1.5f ) // for each arrow in this freeze - { - // check if this arrow is off the the screen - if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j) - continue; // skip this arrow - - - float fYOffset = GetColorArrowYOffset( j, m_fSongBeat ); - - float fYPos = GetColorArrowYPos( j, m_fSongBeat ); - if( hss.m_HoldScore == HoldStepScore::HOLD_STEPPED_ON || hss.m_HoldScore == HoldStepScore::HOLD_SCORE_OK ) - { - if( fYPos < GetGrayArrowYPos() ) - continue; // don't draw - } - if( m_PlayerOptions.m_bReverseScroll ) fYPos = SCREEN_HEIGHT - fYPos; - m_ColorArrow[iColNum].SetY( fYPos ); - float fAlpha = GetColorArrowAlphaFromYOffset( fYOffset ); - m_ColorArrow[iColNum].SetAlpha( fAlpha ); - m_ColorArrow[iColNum].DrawGrayPart(); - } - - // draw the color parts - for( j=hs.m_iStartIndex; j<=hs.m_iEndIndex; j+=1.5f ) // for each arrow in this freeze - { - // check if this arrow is off the the screen - if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j ) - continue; // skip this arrow - - float fYOffset = GetColorArrowYOffset( j, m_fSongBeat ); - - float fYPos = GetColorArrowYPos( j, m_fSongBeat ); - m_ColorArrow[iColNum].SetY( fYPos ); - if( hss.m_HoldScore == HoldStepScore::HOLD_STEPPED_ON || hss.m_HoldScore == HoldStepScore::HOLD_SCORE_OK ) - { - if( fYPos < GetGrayArrowYPos() ) - continue; // don't draw - } - if( m_PlayerOptions.m_bReverseScroll ) fYPos = SCREEN_HEIGHT - fYPos; - m_ColorArrow[iColNum].SetY( fYPos ); - D3DXCOLOR color( (float)(j-hs.m_iStartIndex)/(float)(hs.m_iEndIndex-hs.m_iStartIndex), 1, 0, 1 ); // color shifts from green to yellow - float fPercentageDead = hss.m_fTimeNotHeld / HOLD_ARROW_NG_TIME; - color *= 1 - fPercentageDead / 1.2f; - color.a = 1; - m_ColorArrow[iColNum].SetDiffuseColor( color ); - float fAlpha = GetColorArrowAlphaFromYOffset( fYOffset ); - m_ColorArrow[iColNum].SetAlpha( fAlpha ); - m_ColorArrow[iColNum].DrawColorPart(); - } - - - // draw the first arrow on top of the others - j = hs.m_iStartIndex; - - // check if this arrow is off the the screen - if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j) - continue; // skip this arrow - - - float fYOffset = GetColorArrowYOffset( j, m_fSongBeat ); - float fYPos = GetColorArrowYPos( j, m_fSongBeat ); - - if( hss.m_HoldScore == HoldStepScore::HOLD_STEPPED_ON || hss.m_HoldScore == HoldStepScore::HOLD_SCORE_OK ) - { - if( fYPos < GetGrayArrowYPos() ) - continue; // don't draw - } - - if( hss.m_HoldScore == HoldStepScore::HOLD_STEPPED_ON || hss.m_HoldScore == HoldStepScore::HOLD_SCORE_OK ) - fYPos = max( fYPos, GetGrayArrowYPos() ); - if( m_PlayerOptions.m_bReverseScroll ) fYPos = SCREEN_HEIGHT - fYPos; - - m_ColorArrow[iColNum].SetY( fYPos ); - float fAlpha = GetColorArrowAlphaFromYOffset( fYOffset ); - m_ColorArrow[iColNum].SetAlpha( fAlpha ); - m_ColorArrow[iColNum].DrawGrayPart(); - - - m_ColorArrow[iColNum].SetY( fYPos ); - m_ColorArrow[iColNum].SetColorPartFromIndexAndBeat( i, m_fSongBeat ); - m_ColorArrow[iColNum].SetGrayPartFromIndexAndBeat( i, m_fSongBeat ); - D3DXCOLOR color( 0, 1, 0, 1 ); // color shifts from green to yellow - float fPercentageDead = hss.m_fTimeNotHeld / 0.5f; // Hack! Hard coded hold period - color *= 1 - fPercentageDead / 1.2f; - color.a = 1; - m_ColorArrow[iColNum].SetDiffuseColor( color ); - m_ColorArrow[iColNum].SetAlpha( fAlpha ); - m_ColorArrow[iColNum].Draw(); - - - } - -} - - - -float Player::GetColorArrowYPos( float fStepIndex, float fSongBeat ) -{ - float fBeatsUntilStep = StepIndexToBeat( fStepIndex ) - fSongBeat; - float fYOffset = fBeatsUntilStep * ARROW_GAP * m_PlayerOptions.m_fArrowScrollSpeed; - switch( m_PlayerOptions.m_EffectType ) - { - case PlayerOptions::EFFECT_BOOST: - fYOffset *= 1.4f / ((fYOffset+SCREEN_HEIGHT/1.6f)/SCREEN_HEIGHT); - break; - case PlayerOptions::EFFECT_WAVE: - fYOffset += 15.0f*(float)sin( fYOffset/38.0f ); - break; - } - float fYPos = fYOffset + GRAY_ARROW_Y; - - return fYPos; - -} - -float Player::GetColorArrowYOffset( float fStepIndex, float fSongBeat ) -{ - float fBeatsUntilStep = StepIndexToBeat( fStepIndex ) - fSongBeat; - float fYOffset = fBeatsUntilStep * ARROW_GAP * m_PlayerOptions.m_fArrowScrollSpeed; - switch( m_PlayerOptions.m_EffectType ) - { - case PlayerOptions::EFFECT_BOOST: - fYOffset *= 1.4f / ((fYOffset+SCREEN_HEIGHT/1.6f)/SCREEN_HEIGHT); - break; - case PlayerOptions::EFFECT_WAVE: - fYOffset += 15.0f*(float)sin( fYOffset/38.0f ); - break; - } - return fYOffset; -} - -float Player::GetColorArrowAlphaFromYOffset( float fYOffset ) -{ - float fAlpha; - switch( m_PlayerOptions.m_AppearanceType ) - { - case PlayerOptions::APPEARANCE_VISIBLE: - fAlpha = 1; - break; - case PlayerOptions::APPEARANCE_HIDDEN: -// fAlpha = m_PlayerOptions.m_bReverseScroll ? ((SCREEN_HEIGHT-(fYPos-200))/200) : ((fYPos-200)/200); - fAlpha = (fYOffset-100)/200; - break; - case PlayerOptions::APPEARANCE_SUDDEN: -// fAlpha = m_PlayerOptions.m_bReverseScroll ? ((SCREEN_HEIGHT-(fYPos+200))/200) : ((fYPos+200)/200); - fAlpha = ((SCREEN_HEIGHT-fYOffset)-280)/200; - break; - case PlayerOptions::APPEARANCE_STEALTH: - fAlpha = 0; - break; - }; - if( fYOffset < 0 ) - fAlpha = 1; - - return fAlpha; -}; - -float Player::GetGrayArrowYPos() -{ - return GRAY_ARROW_Y; -} - - - - - -void Player::SetJudgementX( int iNewX ) -{ - // the frame will do this for us - //float fY = JUDGEMENT_Y; - //if( m_PlayerOptions.m_bReverseScroll ) fY = SCREEN_HEIGHT - fY; - //m_sprJudgement.SetXY( iNewX, fY ); - - float fY = HOLD_JUDGEMENT_Y; - if( m_PlayerOptions.m_bReverseScroll ) fY = SCREEN_HEIGHT - fY; - for( int c=0; c 0 ) - m_fHoldJudgementDisplayCountdown[c] -= fDeltaTime; - m_sprHoldJudgement[c].Update( fDeltaTime ); - } - -} - -void Player::DrawJudgement() -{ - //if( m_fJudgementDisplayCountdown > 0.0 ) - // m_sprJudgement.Draw(); // the frame will take care of this for us - - for( int c=0; c 0.0 ) - m_sprHoldJudgement[c].Draw(); - } -} - -void Player::SetJudgement( StepScore score ) -{ - //RageLog( "Judgement::SetJudgement()" ); - - switch( score ) - { - case perfect: m_sprJudgement.SetState( 0 ); break; - case great: m_sprJudgement.SetState( 1 ); break; - case good: m_sprJudgement.SetState( 2 ); break; - case boo: m_sprJudgement.SetState( 3 ); break; - case miss: m_sprJudgement.SetState( 4 ); break; - } - - m_fJudgementDisplayCountdown = JUDGEMENT_DISPLAY_TIME; - - if( score == miss ) { // falling down - m_sprJudgement.SetY( (m_PlayerOptions.m_bReverseScroll ? JUDGEMENT_Y_OFFSET : -JUDGEMENT_Y_OFFSET) - 30 ); - m_sprJudgement.SetZoom( 1.0f ); - m_sprJudgement.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible - m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME ); - m_sprJudgement.SetTweenY( (m_PlayerOptions.m_bReverseScroll ? JUDGEMENT_Y_OFFSET : -JUDGEMENT_Y_OFFSET) + 30 ); - - } else { // zooming out - m_sprJudgement.StopTweening(); - m_sprJudgement.SetY( (m_PlayerOptions.m_bReverseScroll ? JUDGEMENT_Y_OFFSET : -JUDGEMENT_Y_OFFSET) ); - m_sprJudgement.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible - - m_frameJudgementAndCombo.SetZoom( 1.35f ); - m_frameJudgementAndCombo.BeginTweening( JUDGEMENT_DISPLAY_TIME/5.0f ); - m_frameJudgementAndCombo.SetTweenZoom( 1.0f ); - -/* m_sprJudgement.SetZoom( 1.5f ); - m_sprJudgement.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible - m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0 ); - m_sprJudgement.SetTweenZoom( 1.0f ); - */ - } -} - -void Player::SetHoldJudgement( int iCol, HoldStepScore::HoldScore score ) -{ - //RageLog( "Judgement::SetJudgement()" ); - - switch( score ) - { - case HoldStepScore::HOLD_SCORE_NONE: m_sprHoldJudgement[iCol].SetState( 0 ); break; // freeze! - case HoldStepScore::HOLD_SCORE_OK: m_sprHoldJudgement[iCol].SetState( 7 ); break; - case HoldStepScore::HOLD_SCORE_NG: m_sprHoldJudgement[iCol].SetState( 8 ); break; - } - - m_fHoldJudgementDisplayCountdown[iCol] = JUDGEMENT_DISPLAY_TIME; - - if( score == HoldStepScore::HOLD_SCORE_NG ) { // falling down - float fY = HOLD_JUDGEMENT_Y; - if( m_PlayerOptions.m_bReverseScroll ) fY = SCREEN_HEIGHT - fY; - m_sprHoldJudgement[iCol].SetY( fY - 10 ); - m_sprHoldJudgement[iCol].SetZoom( 1.0f ); - m_sprHoldJudgement[iCol].BeginTweening( JUDGEMENT_DISPLAY_TIME ); - m_sprHoldJudgement[iCol].SetTweenY( fY + 10 ); - } else { // zooming out - float fY = HOLD_JUDGEMENT_Y; - if( m_PlayerOptions.m_bReverseScroll ) fY = SCREEN_HEIGHT - fY; - m_sprHoldJudgement[iCol].SetY( fY ); - m_sprHoldJudgement[iCol].SetZoom( 1.5f ); - m_sprHoldJudgement[iCol].BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0f ); - m_sprHoldJudgement[iCol].SetTweenZoom( 1.0f ); - } -} - -void Player::SetComboX( int iNewX ) -{ - float fY; - - fY = COMBO_Y; - if( m_PlayerOptions.m_bReverseScroll ) fY = SCREEN_HEIGHT - fY; - - //m_sprCombo.SetXY( iNewX+40, fY ); // the frame will do this for us - //m_textComboNumber.SetXY( iNewX-50, fY ); -} - -void Player::UpdateCombo( float fDeltaTime ) -{ - //m_sprCombo.Update( fDeltaTime ); // the frame will do this for us - //m_textComboNumber.Update( fDeltaTime ); // the frame will do this for us -} - -void Player::DrawCombo() -{ -// the frame will do this for us -// if( m_bComboVisible ) -// { -// m_textComboNumber.Draw(); -// m_sprCombo.Draw(); -// } -} - - -void Player::ContinueCombo() -{ - m_iCurCombo++; - - // new max combo - if( m_iCurCombo > m_iMaxCombo ) - m_iMaxCombo = m_iCurCombo; - - if( m_iCurCombo <= 4 ) - { - m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible - m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible - } - else - { - m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible - m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible - - m_textComboNumber.SetText( ssprintf("%d", m_iCurCombo) ); - float fNewZoom = 0.5f + m_iCurCombo/800.0f; - m_textComboNumber.SetZoom( fNewZoom ); - m_textComboNumber.SetX( -40 - (fNewZoom-1)*30 ); - m_textComboNumber.SetY( m_PlayerOptions.m_bReverseScroll ? -JUDGEMENT_Y_OFFSET : JUDGEMENT_Y_OFFSET ); - - //m_textComboNumber.BeginTweening( COMBO_TWEEN_TIME ); - //m_textComboNumber.SetTweenZoom( 1 ); - } -} - -void Player::EndCombo() -{ - m_iCurCombo = 0; - - m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible - m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible - -} - - - -void Player::SetLifeMeterX( int iNewX ) -{ - m_sprLifeMeterFrame.SetXY( (float)iNewX, LIFEMETER_Y ); - m_sprLifeMeterPills.SetXY( (float)iNewX, LIFEMETER_PILLS_Y ); -} - -void Player::UpdateLifeMeter( float fDeltaTime ) -{ - m_sprLifeMeterFrame.Update( fDeltaTime ); - m_sprLifeMeterPills.Update( fDeltaTime ); -} - -void Player::DrawLifeMeter() -{ - float fBeatPercentage = m_fSongBeat - (int)m_fSongBeat; - int iOffsetStart = roundf( LIEFMETER_NUM_PILLS*fBeatPercentage ); - - m_sprLifeMeterFrame.Draw(); - - float iX = m_sprLifeMeterFrame.GetX() - m_sprLifeMeterFrame.GetZoomedWidth()/2 + 27; - int iNumPills = (int)(m_sprLifeMeterPills.GetNumStates() * m_fLifePercentage); - int iPillWidth = (int)m_sprLifeMeterPills.GetZoomedWidth(); - - for( int i=0; i= 0 ); - - - m_ScoreDisplay.SetScore( m_fScore ); -} \ No newline at end of file diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 4cbd901a7d..7b263e41bd 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -25,134 +25,63 @@ #include "Player.h" #include "ActorFrame.h" #include "SoundSet.h" -#include "ScoreDisplayRolling.h" +#include "ScoreDisplayRollingWithFrame.h" +#include "LifeMeterPills.h" +#include "Judgement.h" +#include "HoldJudgement.h" +#include "Combo.h" +#include "ColorArrowField.h" +#include "GrayArrows.h" +#include "GhostArrows.h" -const int MAX_NUM_COLUMNS = 8; - - class Player : public ActorFrame { public: Player(); - void SetPlayerOptions( PlayerOptions po, PlayerNumber pn ); virtual void Update( float fDeltaTime, float fSongBeat, float fMaxBeatDifference ); - virtual void RenderPrimitives(); - void SetSteps( Steps* pNewSteps, bool bLoadOnlyLeftSide = false, bool bLoadOnlyRightSide = false ); - void SetX( float fX ); + void Load( const Style& style, PlayerNumber player_no, const Steps& steps, const PlayerOptions& po ); void CrossedIndex( int iIndex ); + void HandlePlayerStep( float fSongBeat, TapStep step, float fMaxBeatDiff ); + int UpdateStepsMissedOlderThan( float fMissIfOlderThanThisBeat ); ScoreSummary GetScoreSummary(); - int UpdateStepsMissedOlderThan( float fMissIfOlderThanThisBeat ); - void HandlePlayerStep( float fSongBeat, Step player_step, float fMaxBeatDiff ); + + float GetLifePercentage() { return m_LifeMeter.GetLifePercentage(); }; + bool IsThereANoteAtIndex( int iIndex ); protected: - void CheckForCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDiff ); - void OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDiff, int iStepIndex ); + void CheckForCompleteStep( float fSongBeat, TapStep step, float fMaxBeatDiff ); + void OnCompleteStep( float fSongBeat, TapStep step, float fMaxBeatDiff, int iStepIndex ); - PlayerOptions m_PlayerOptions; + float m_fSongBeat; + Style m_Style; PlayerNumber m_PlayerNumber; + PlayerOptions m_PlayerOptions; - int m_iCurCombo; - int m_iMaxCombo; - float m_fSongBeat; + TapStep m_TapStepsOriginal[MAX_TAP_STEP_ELEMENTS]; // the original steps that were loaded into player + TapStep m_TapStepsRemaining[MAX_TAP_STEP_ELEMENTS]; // mask off the bits as the player steps + TapStepScore m_TapStepScores[MAX_TAP_STEP_ELEMENTS]; + HoldStep m_HoldSteps[MAX_HOLD_STEP_ELEMENTS]; + HoldStepScore m_HoldStepScores[MAX_HOLD_STEP_ELEMENTS]; + int m_iNumHoldSteps; - // index is quarter beat number (e.g. beat 30 is index 30*4) - Step m_OriginalStep[MAX_STEP_ELEMENTS]; - Step m_LeftToStepOn[MAX_STEP_ELEMENTS]; - StepScore m_StepScore[MAX_STEP_ELEMENTS]; - CArray m_HoldSteps; - //StepTiming m_StepTiming[MAX_STEP_ELEMENTS]; - CArray m_HoldStepScores; - // common to color and gray arrows - float m_fArrowsCenterX; + GrayArrows m_GrayArrows; + ColorArrowField m_ColorArrowField; + GhostArrows m_GhostArrows; - int m_iNumColumns; // will vary depending on the number panels (4,6,8,etc) - CMap m_StepToColumnNumber; - CMap m_ColumnNumberToStep; - CMap m_ColumnToRotation; - float GetArrowColumnX( int iColNum ); - - // color arrows - void SetColorArrowsX( int iX ); - void UpdateColorArrows( float fDeltaTime ); - float GetColorArrowYPos( float fStepIndex, float fSongBeat ); - float GetColorArrowYOffset( float fStepIndex, float fSongBeat ); - float GetColorArrowAlphaFromYOffset( float fYOffset ); - void DrawColorArrows(); - int m_iColorArrowFrameOffset[MAX_STEP_ELEMENTS]; - ColorArrow m_ColorArrow[MAX_NUM_COLUMNS]; - - // gray arrows - void SetGrayArrowsX( int iX ); - void UpdateGrayArrows( float fDeltaTime ); - float GetGrayArrowYPos(); - void DrawGrayArrows(); - void GrayArrowStep( int iCol, StepScore score ); - GrayArrow m_GrayArrow[MAX_NUM_COLUMNS]; - - // ghost arrows - void SetGhostArrowsX( int iX ); - void UpdateGhostArrows( float fDeltaTime ); - void DrawGhostArrows(); - void GhostArrowStep( int iCol, StepScore score ); - GhostArrow m_GhostArrow[MAX_NUM_COLUMNS]; - GhostArrowBright m_GhostArrowBright[MAX_NUM_COLUMNS]; - HoldGhostArrow m_HoldGhostArrow[MAX_NUM_COLUMNS]; - - // holder for judgement and combo displays - ActorFrame m_frameJudgementAndCombo; - - // judgement - void SetJudgementX( int iX ); - void UpdateJudgement( float fDeltaTime ); - void DrawJudgement(); - void SetJudgement( StepScore score ); - float m_fJudgementDisplayCountdown; - Sprite m_sprJudgement; - - void SetHoldJudgement( int iCol, HoldStepScore::HoldScore score ); - float m_fHoldJudgementDisplayCountdown[MAX_NUM_COLUMNS]; - Sprite m_sprHoldJudgement[MAX_NUM_COLUMNS]; - - // combo - void SetComboX( int iX ); - void UpdateCombo( float fDeltaTime ); - void DrawCombo(); - void ContinueCombo(); - void EndCombo(); - bool m_bComboVisible; - Sprite m_sprCombo; - BitmapText m_textComboNumber; - - // life meter - void SetLifeMeterX( int iX ); - void UpdateLifeMeter( float fDeltaTime ); - void DrawLifeMeter(); - void ChangeLife( StepScore score ); -public: - float GetLifePercentage() { return m_fLifePercentage; }; -private: - float m_fLifePercentage; - Sprite m_sprLifeMeterFrame; - Sprite m_sprLifeMeterPills; - - // score - void SetScoreX( int iX ); - void UpdateScore( float fDeltaTime ); - void DrawScore(); - void ChangeScore( StepScore stepscore, int iCurCombo ); - float m_fScore; - Sprite m_sprScoreFrame; - ScoreDisplayRolling m_ScoreDisplay; - - // assist - SoundSet m_soundAssistTick; + Judgement m_Judgement; + HoldJudgement m_HoldJudgement[MAX_NUM_COLUMNS]; + Combo m_Combo; + LifeMeterPills m_LifeMeter; + ScoreDisplayRollingWithFrame m_Score; + + SoundSet m_soundAssistTick; }; diff --git a/stepmania/src/ScoreDisplayRolling.cpp b/stepmania/src/ScoreDisplayRolling.cpp index 20d4e6b131..8bd7ff0183 100644 --- a/stepmania/src/ScoreDisplayRolling.cpp +++ b/stepmania/src/ScoreDisplayRolling.cpp @@ -35,6 +35,8 @@ ScoreDisplayRolling::ScoreDisplayRolling() void ScoreDisplayRolling::SetScore( float fNewScore ) { + m_fScore = fNewScore; + // super inefficient (but isn't called very often) CString sFormatString = ssprintf( "%%%d.0f", NUM_SCORE_DIGITS ); CString sScore = ssprintf( sFormatString, fNewScore ); @@ -47,6 +49,12 @@ void ScoreDisplayRolling::SetScore( float fNewScore ) } +float ScoreDisplayRolling::GetScore() +{ + return m_fScore; +} + + void ScoreDisplayRolling::Update( float fDeltaTime ) { BitmapText::Update( fDeltaTime ); @@ -81,4 +89,45 @@ void ScoreDisplayRolling::Draw() SetText( ssprintf(sFormat, iCurScore) ); BitmapText::Draw(); -} \ No newline at end of file +} + + + +void ScoreDisplayRolling::AddToScore( TapStepScore stepscore, int iCurCombo ) +{ + // The scoring system for DDR versions 1 and 2 (including the Plus remixes) is as follows: + // For every step: + // + // Multiplier (M) = (# of steps in your current combo / 4) rounded down + // "Good" step = M * 100 (and this ends your combo) + // "Great" step = M * M * 100 + // "Perfect" step = M * M * 300 + // + // e.g. When you get a 259 combo, the 260th step will earn you: + // + // M = (260 / 4) rounded down + // = 65 + // step = M x M X 100 + // = 65 x 65 x 100 + // = 422,500 + // Perfect step = Great step score x 3 + // = 422,500 x 3 + // = 1,267,500 + + float M = iCurCombo/4.0f; + + float fScoreToAdd = 0; + switch( stepscore ) + { + case TSS_MISS: break; + case TSS_BOO: break; + case TSS_GOOD: fScoreToAdd = M * 100 + 100; break; + case TSS_GREAT: fScoreToAdd = M * M * 100 + 300; break; + case TSS_PERFECT: fScoreToAdd = M * M * 300 + 500; break; + } + m_fScore += fScoreToAdd; + ASSERT( m_fScore >= 0 ); + + + this->SetScore( m_fScore ); +} diff --git a/stepmania/src/ScoreDisplayRolling.h b/stepmania/src/ScoreDisplayRolling.h index 5d33b1e6d6..653470256e 100644 --- a/stepmania/src/ScoreDisplayRolling.h +++ b/stepmania/src/ScoreDisplayRolling.h @@ -26,12 +26,17 @@ class ScoreDisplayRolling : public BitmapText { public: ScoreDisplayRolling(); + void SetScore( float fNewScore ); + float GetScore(); + void AddToScore( TapStepScore stepscore, int iCurCombo ); virtual void Update( float fDeltaTime ); virtual void Draw(); protected: + float m_fScore; + int m_iCurrentScoreDigits[NUM_SCORE_DIGITS]; int m_iDestinationScoreDigits[NUM_SCORE_DIGITS]; }; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index a3478b5fe6..e07039bdd3 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -345,7 +345,7 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir ) { case 01: // background music track float fBeatOffset; - fBeatOffset = StepIndexToBeat(iStepIndex); + fBeatOffset = StepIndexToBeat( (float)iStepIndex ); float fBPS; fBPS = m_BPMSegments[0].m_fBPM/60.0f; m_fOffsetInSeconds = fBeatOffset / fBPS; @@ -353,7 +353,7 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir ) break; case 03: // bpm BPMSegment new_seg; - new_seg.m_fStartBeat = StepIndexToBeat( iStepIndex ); + new_seg.m_fStartBeat = StepIndexToBeat( (float)iStepIndex ); new_seg.m_fBPM = (float)arrayNotes[j]; m_BPMSegments.Add( new_seg ); // add to back for now (we'll sort later) @@ -856,13 +856,12 @@ int CompareSongPointersByArtist(const void *arg1, const void *arg2) CString sArtist1 = pSong1->GetArtist(); CString sArtist2 = pSong2->GetArtist(); - CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs - CString sFilePath2 = pSong2->GetSongFilePath(); - - CString sCompareString1 = sArtist1 + sFilePath1; - CString sCompareString2 = sArtist2 + sFilePath2; - - return CompareCStrings( (void*)&sCompareString1, (void*)&sCompareString2 ); + if( sArtist1 < sArtist2 ) + return -1; + else if( sArtist1 == sArtist2 ) + return CompareSongPointersByTitle( arg1, arg2 ); + else + return 1; } void SortSongPointerArrayByArtist( CArray &arraySongPointers ) @@ -878,13 +877,12 @@ int CompareSongPointersByGroup(const void *arg1, const void *arg2) CString sGroup1 = pSong1->GetGroupName(); CString sGroup2 = pSong2->GetGroupName(); - CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs - CString sFilePath2 = pSong2->GetSongFilePath(); - - CString sCompareString1 = sGroup1 + sFilePath1; - CString sCompareString2 = sGroup2 + sFilePath2; - - return CompareCStrings( (void*)&sCompareString1, (void*)&sCompareString2 ); + if( sGroup1 < sGroup2 ) + return -1; + else if( sGroup1 == sGroup2 ) + return CompareSongPointersByTitle( arg1, arg2 ); + else + return 1; } void SortSongPointerArrayByGroup( CArray &arraySongPointers ) @@ -900,13 +898,10 @@ int CompareSongPointersByMostPlayed(const void *arg1, const void *arg2) int iNumTimesPlayed1 = pSong1->GetNumTimesPlayed(); int iNumTimesPlayed2 = pSong2->GetNumTimesPlayed(); - CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs - CString sFilePath2 = pSong2->GetSongFilePath(); - - if( iNumTimesPlayed1 > iNumTimesPlayed2 ) + if( iNumTimesPlayed1 < iNumTimesPlayed2 ) return -1; else if( iNumTimesPlayed1 == iNumTimesPlayed2 ) - return CompareCStrings( (void*)&sFilePath1, (void*)&sFilePath2 ); + return CompareSongPointersByTitle( arg1, arg2 ); else return 1; } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index fd5b67059e..b1b5a73e03 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -199,6 +199,7 @@ void Sprite::Update( float fDeltaTime ) void Sprite::RenderPrimitives() { + SCREEN->Translate( -0.5f, -0.5f, 0 ); // offset so that pixels are aligned to texels if( m_pTexture == NULL ) return; diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index c8d678cbaa..39bd22ce6f 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -32,7 +32,7 @@ #include "ScreenDimensions.h" -#include +#include "DXUtil.h" //----------------------------------------------------------------------------- // Links diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 63f60b95a6..f607039ad9 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -420,6 +420,14 @@ SOURCE=.\Steps.h # End Source File # Begin Source File +SOURCE=.\Style.cpp +# End Source File +# Begin Source File + +SOURCE=.\Style.h +# End Source File +# Begin Source File + SOURCE=.\ThemeManager.cpp # End Source File # Begin Source File @@ -448,14 +456,6 @@ SOURCE=.\dxutil.cpp # End Source File # Begin Source File -SOURCE=.\getdxver.cpp -# End Source File -# Begin Source File - -SOURCE=.\getdxver.h -# End Source File -# Begin Source File - SOURCE=.\resource.h # End Source File # Begin Source File @@ -576,14 +576,34 @@ SOURCE=.\ActorFrame.h # End Source File # Begin Source File -SOURCE=.\Background.cpp +SOURCE=.\BitmapText.cpp # End Source File # Begin Source File -SOURCE=.\Background.h +SOURCE=.\BitmapText.h # End Source File # Begin Source File +SOURCE=.\Rectangle.cpp +# End Source File +# Begin Source File + +SOURCE=.\Rectangle.h +# End Source File +# Begin Source File + +SOURCE=.\Sprite.cpp +# End Source File +# Begin Source File + +SOURCE=.\Sprite.h +# End Source File +# End Group +# Begin Group "Actors used in Menus" + +# PROP Default_Filter "" +# Begin Source File + SOURCE=.\Banner.cpp # End Source File # Begin Source File @@ -592,14 +612,6 @@ SOURCE=.\Banner.h # End Source File # Begin Source File -SOURCE=.\BitmapText.cpp -# End Source File -# Begin Source File - -SOURCE=.\BitmapText.h -# End Source File -# Begin Source File - SOURCE=.\BPMDisplay.cpp # End Source File # Begin Source File @@ -608,14 +620,6 @@ SOURCE=.\BPMDisplay.h # End Source File # Begin Source File -SOURCE=.\ColorArrow.cpp -# End Source File -# Begin Source File - -SOURCE=.\ColorArrow.h -# End Source File -# Begin Source File - SOURCE=.\DifficultyIcon.cpp # End Source File # Begin Source File @@ -624,14 +628,6 @@ SOURCE=.\DifficultyIcon.h # End Source File # Begin Source File -SOURCE=.\FocusingSprite.cpp -# End Source File -# Begin Source File - -SOURCE=.\FocusingSprite.h -# End Source File -# Begin Source File - SOURCE=.\FootMeter.cpp # End Source File # Begin Source File @@ -640,22 +636,6 @@ SOURCE=.\FootMeter.h # End Source File # Begin Source File -SOURCE=.\GhostArrow.cpp -# End Source File -# Begin Source File - -SOURCE=.\GhostArrow.h -# End Source File -# Begin Source File - -SOURCE=.\GhostArrowBright.cpp -# End Source File -# Begin Source File - -SOURCE=.\GhostArrowBright.h -# End Source File -# Begin Source File - SOURCE=.\GradeDisplay.cpp # End Source File # Begin Source File @@ -664,30 +644,6 @@ SOURCE=.\GradeDisplay.h # End Source File # Begin Source File -SOURCE=.\GrayArrow.cpp -# End Source File -# Begin Source File - -SOURCE=.\GrayArrow.h -# End Source File -# Begin Source File - -SOURCE=.\HoldGhostArrow.cpp -# End Source File -# Begin Source File - -SOURCE=.\HoldGhostArrow.h -# End Source File -# Begin Source File - -SOURCE=.\MotionBlurSprite.cpp -# End Source File -# Begin Source File - -SOURCE=.\MotionBlurSprite.h -# End Source File -# Begin Source File - SOURCE=.\MusicSortDisplay.cpp # End Source File # Begin Source File @@ -712,30 +668,6 @@ SOURCE=.\MusicWheel.h # End Source File # Begin Source File -SOURCE=.\Rectangle.cpp -# End Source File -# Begin Source File - -SOURCE=.\Rectangle.h -# End Source File -# Begin Source File - -SOURCE=.\ScoreDisplayRolling.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScoreDisplayRolling.h -# End Source File -# Begin Source File - -SOURCE=.\Sprite.cpp -# End Source File -# Begin Source File - -SOURCE=.\Sprite.h -# End Source File -# Begin Source File - SOURCE=.\StepsSelector.cpp # End Source File # Begin Source File @@ -759,6 +691,146 @@ SOURCE=.\TipDisplay.cpp SOURCE=.\TipDisplay.h # End Source File # End Group +# Begin Group "Actors used in Dancing" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\Background.cpp +# End Source File +# Begin Source File + +SOURCE=.\Background.h +# End Source File +# Begin Source File + +SOURCE=.\ColorArrow.cpp +# End Source File +# Begin Source File + +SOURCE=.\ColorArrow.h +# End Source File +# Begin Source File + +SOURCE=.\ColorArrowField.cpp +# End Source File +# Begin Source File + +SOURCE=.\ColorArrowField.h +# End Source File +# Begin Source File + +SOURCE=.\Combo.cpp +# End Source File +# Begin Source File + +SOURCE=.\Combo.h +# End Source File +# Begin Source File + +SOURCE=.\FocusingSprite.cpp +# End Source File +# Begin Source File + +SOURCE=.\FocusingSprite.h +# End Source File +# Begin Source File + +SOURCE=.\GhostArrow.cpp +# End Source File +# Begin Source File + +SOURCE=.\GhostArrow.h +# End Source File +# Begin Source File + +SOURCE=.\GhostArrowBright.cpp +# End Source File +# Begin Source File + +SOURCE=.\GhostArrowBright.h +# End Source File +# Begin Source File + +SOURCE=.\GhostArrows.cpp +# End Source File +# Begin Source File + +SOURCE=.\GhostArrows.h +# End Source File +# Begin Source File + +SOURCE=.\GrayArrow.cpp +# End Source File +# Begin Source File + +SOURCE=.\GrayArrow.h +# End Source File +# Begin Source File + +SOURCE=.\GrayArrows.cpp +# End Source File +# Begin Source File + +SOURCE=.\GrayArrows.h +# End Source File +# Begin Source File + +SOURCE=.\HoldGhostArrow.cpp +# End Source File +# Begin Source File + +SOURCE=.\HoldGhostArrow.h +# End Source File +# Begin Source File + +SOURCE=.\HoldJudgement.cpp +# End Source File +# Begin Source File + +SOURCE=.\HoldJudgement.h +# End Source File +# Begin Source File + +SOURCE=.\Judgement.cpp +# End Source File +# Begin Source File + +SOURCE=.\Judgement.h +# End Source File +# Begin Source File + +SOURCE=.\LifeMeterPills.cpp +# End Source File +# Begin Source File + +SOURCE=.\LifeMeterPills.h +# End Source File +# Begin Source File + +SOURCE=.\MotionBlurSprite.cpp +# End Source File +# Begin Source File + +SOURCE=.\MotionBlurSprite.h +# End Source File +# Begin Source File + +SOURCE=.\ScoreDisplayRolling.cpp +# End Source File +# Begin Source File + +SOURCE=.\ScoreDisplayRolling.h +# End Source File +# Begin Source File + +SOURCE=.\ScoreDisplayRollingWithFrame.cpp +# End Source File +# Begin Source File + +SOURCE=.\ScoreDisplayRollingWithFrame.h +# End Source File +# End Group # Begin Source File SOURCE=.\error.bmp diff --git a/stepmania/src/Style.h b/stepmania/src/Style.h new file mode 100644 index 0000000000..d401a74e34 --- /dev/null +++ b/stepmania/src/Style.h @@ -0,0 +1,43 @@ +/* +----------------------------------------------------------------------------- + File: Style.h + + Desc: A data structure that holds the definition of a GameMode. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#ifndef _Style_H_ +#define _Style_H_ + +#include "Steps.h" + + +const int MAX_NUM_COLUMNS = 8; + + +struct Style +{ + int m_iNumPlayers; + int m_iNumColumns; // will vary depending on the number panels (4,6,8,etc) + TapStep m_ColumnToTapStep[MAX_NUM_COLUMNS]; + float m_ColumnToRotation[MAX_NUM_COLUMNS]; + + int TapStepToColumnNumber( TapStep tap_step ) + { + for( int i=0; i