diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 8692808d53..a8f0f4f4d6 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -3,21 +3,21 @@ ----------------------------------------------------------------------------- File: ArrowEffects.cpp - Desc: Functions that return properties of arrows based on Style and PlayerOptions + Desc: Functions that return properties of arrows based on StyleDef and PlayerOptions Copyright (c) 2001-2002 by the names listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "ArrowEffects.h" -#include "Steps.h" +#include "Pattern.h" #include "ColorArrow.h" #include "ScreenDimensions.h" float ArrowGetYOffset( const PlayerOptions& po, float fStepIndex, float fSongBeat ) { - float fBeatsUntilStep = StepIndexToBeat( fStepIndex ) - fSongBeat; + float fBeatsUntilStep = NoteIndexToBeat( fStepIndex ) - fSongBeat; float fYOffset = fBeatsUntilStep * ARROW_GAP; switch( po.m_EffectType ) { @@ -31,9 +31,9 @@ float ArrowGetYOffset( const PlayerOptions& po, float fStepIndex, float fSongBea return fYOffset; } -float ArrowGetXPos( const PlayerOptions& po, const Style &style, int iColNum, float fYOffset, float fSongBeat ) +float ArrowGetXPos( const PlayerOptions& po, const StyleDef &StyleDef, int iColNum, float fYOffset, float fSongBeat ) { - float fColOffsetFromCenter = iColNum - (style.m_iNumColumns-1)/2.0f; + float fColOffsetFromCenter = iColNum - (StyleDef.m_iNumColumns-1)/2.0f; float fPixelOffsetFromCenter = fColOffsetFromCenter * ARROW_SIZE; switch( po.m_EffectType ) @@ -45,9 +45,9 @@ float ArrowGetXPos( const PlayerOptions& po, const Style &style, int iColNum, fl return fPixelOffsetFromCenter; } -float ArrowGetRotation( const PlayerOptions& po, const Style &style, int iColNum, float fYOffset ) +float ArrowGetRotation( const PlayerOptions& po, const StyleDef &StyleDef, int iColNum, float fYOffset ) { - float fRotation = style.m_ColumnToRotation[iColNum]; + float fRotation = StyleDef.m_ColumnToRotation[iColNum]; switch( po.m_EffectType ) { diff --git a/stepmania/src/ArrowEffects.h b/stepmania/src/ArrowEffects.h index a7d6b5e348..c501ada84a 100644 --- a/stepmania/src/ArrowEffects.h +++ b/stepmania/src/ArrowEffects.h @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- File: ArrowEffects.h - Desc: Functions that return properties of arrows based on Style and PlayerOptions + Desc: Functions that return properties of arrows based on StyleDef and PlayerOptions Copyright (c) 2001-2002 by the names listed below. All rights reserved. Chris Danford @@ -14,7 +14,7 @@ #include "GameTypes.h" -#include "Style.h" +#include "StyleDef.h" // fYOffset is a vertical position in pixels relative to the center. @@ -26,13 +26,13 @@ float ArrowGetYOffset( const PlayerOptions& po, float fStepIndex, float fSongBea // fXPos is a horizontal position in pixels relative to the center of the field. // This depends on the column of the arrow and possibly the Arrow effect and // fYOffset (in the case of EFFECT_DRUNK). -float ArrowGetXPos( const PlayerOptions& po, const Style &style, int iCol, float fYOffset, float fSongBeat ); +float ArrowGetXPos( const PlayerOptions& po, const StyleDef &StyleDef, int iCol, float fYOffset, float fSongBeat ); // fRotation is Z rotation of an arrow. This will depend on the column of // the arrow and possibly the Arrow effect and the fYOffset (in the case of // EFFECT_DIZZY). -float ArrowGetRotation( const PlayerOptions& po, const Style &style, int iCol, float fYOffset ); +float ArrowGetRotation( const PlayerOptions& po, const StyleDef &StyleDef, int iCol, float fYOffset ); // fYPos is the position of the note in pixels relative to the center. diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 09a740976e..41add195db 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -13,6 +13,7 @@ #include "RageUtil.h" #include "ScreenDimensions.h" #include "ThemeManager.h" +#include "PrefsManager.h" #include "RageBitmapTexture.h" diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index 35cf72a757..ab337e46ca 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -46,7 +46,7 @@ void Banner::CropToRightSize() float fOriginalX = GetX(); float fOriginalY = GetY(); - if( iImageWidth == iImageHeight ) // this is a SSR/DWI style banner + if( iImageWidth == iImageHeight ) // this is a SSR/DWI StyleDef banner { float fCustomImageCoords[8] = { 0.22f, 0.98f, // bottom left diff --git a/stepmania/src/DifficultyIcon.h b/stepmania/src/DifficultyIcon.h index 9edd91585f..13982b526a 100644 --- a/stepmania/src/DifficultyIcon.h +++ b/stepmania/src/DifficultyIcon.h @@ -30,7 +30,7 @@ public: SetFromDescription( "" ); }; - void SetFromSteps( Steps* pSteps ) + void SetFromSteps( Pattern* pSteps ) { if( pSteps != NULL ) { diff --git a/stepmania/src/FootMeter.h b/stepmania/src/FootMeter.h index a023db52a3..1509a6643c 100644 --- a/stepmania/src/FootMeter.h +++ b/stepmania/src/FootMeter.h @@ -29,7 +29,7 @@ public: SetNumFeet( 0, "" ); }; - void SetFromSteps( Steps* pSteps ) + void SetFromSteps( Pattern* pSteps ) { if( pSteps != NULL ) { diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp new file mode 100644 index 0000000000..d82e7df687 --- /dev/null +++ b/stepmania/src/GameManager.cpp @@ -0,0 +1,159 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + Class: GameManager + + Desc: See Header. + + Copyright (c) 2001-2002 by the names listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "GameManager.h" +#include "D3DXmath.h" + + +GameManager* GAME = NULL; // global and accessable from anywhere in our program + + + +GameManager::GameManager() +{ + m_DanceStyle = STYLE_SINGLE; +} + +GameManager::~GameManager() +{ + +} + +bool GameManager::IsPlayerEnabled( PlayerNumber PlayerNo ) +{ + switch( m_DanceStyle ) + { + case STYLE_VERSUS: + case STYLE_COUPLE: + if( PlayerNo == PLAYER_1 ) + return true; + if( PlayerNo == PLAYER_2 ) + return true; + break; + case STYLE_SINGLE: + case STYLE_SOLO: + case STYLE_DOUBLE: + if( PlayerNo == PLAYER_1 ) + return true; + if( PlayerNo == PLAYER_2 ) + return false; + break; + default: + ASSERT( false ); // invalid StyleDef + } + return false; +} + + +StyleDef GameManager::GetStyleDef( DanceStyle mode ) +{ + StyleDef StyleDef; + + + CMap mapTapNoteToRotation; // arrow facing left is rotation 0 + mapTapNoteToRotation[NOTE_PAD1_LEFT] = 0; + mapTapNoteToRotation[NOTE_PAD1_UPLEFT] = D3DX_PI/4.0f; + mapTapNoteToRotation[NOTE_PAD1_DOWN] = -D3DX_PI/2.0f; + mapTapNoteToRotation[NOTE_PAD1_UP] = D3DX_PI/2.0f; + mapTapNoteToRotation[NOTE_PAD1_UPRIGHT] = D3DX_PI*3.0f/4.0f; + mapTapNoteToRotation[NOTE_PAD1_RIGHT] = D3DX_PI; + mapTapNoteToRotation[NOTE_PAD2_LEFT] = mapTapNoteToRotation[NOTE_PAD1_LEFT]; + mapTapNoteToRotation[NOTE_PAD2_UPLEFT] = mapTapNoteToRotation[NOTE_PAD1_UPLEFT]; + mapTapNoteToRotation[NOTE_PAD2_DOWN] = mapTapNoteToRotation[NOTE_PAD1_DOWN]; + mapTapNoteToRotation[NOTE_PAD2_UP] = mapTapNoteToRotation[NOTE_PAD1_UP]; + mapTapNoteToRotation[NOTE_PAD2_UPRIGHT] = mapTapNoteToRotation[NOTE_PAD1_UPRIGHT]; + mapTapNoteToRotation[NOTE_PAD2_RIGHT] = mapTapNoteToRotation[NOTE_PAD1_RIGHT]; + + + switch( mode ) + { + case STYLE_SINGLE: + case STYLE_DOUBLE: + case STYLE_SOLO: + StyleDef.m_iNumPlayers = 1; + break; + case STYLE_VERSUS: + case STYLE_COUPLE: + StyleDef.m_iNumPlayers = 2; + break; + default: + ASSERT( false ); // invalid GameMode + } + + + switch( mode ) + { + case STYLE_SINGLE: + case STYLE_VERSUS: + case STYLE_COUPLE: + StyleDef.m_iNumColumns = 4; // LEFT, DOWN, UP, RIGHT + StyleDef.m_ColumnToTapNote[0] = NOTE_PAD1_LEFT; + StyleDef.m_ColumnToTapNote[1] = NOTE_PAD1_DOWN; + StyleDef.m_ColumnToTapNote[2] = NOTE_PAD1_UP; + StyleDef.m_ColumnToTapNote[3] = NOTE_PAD1_RIGHT; + StyleDef.m_ColumnToTapNote[4] = NOTE_PAD1_UPLEFT; // Even though this isn't used, Need them here so + StyleDef.m_ColumnToTapNote[5] = NOTE_PAD1_UPRIGHT; // TapNoteToColumnNumber doesn't get confused by them + StyleDef.m_ColumnToRotation[0] = mapTapNoteToRotation[NOTE_PAD1_LEFT]; + StyleDef.m_ColumnToRotation[1] = mapTapNoteToRotation[NOTE_PAD1_DOWN]; + StyleDef.m_ColumnToRotation[2] = mapTapNoteToRotation[NOTE_PAD1_UP]; + StyleDef.m_ColumnToRotation[3] = mapTapNoteToRotation[NOTE_PAD1_RIGHT]; + StyleDef.m_ColumnToRotation[4] = mapTapNoteToRotation[NOTE_PAD1_UPLEFT]; + StyleDef.m_ColumnToRotation[5] = mapTapNoteToRotation[NOTE_PAD1_UPRIGHT]; + break; + case STYLE_SOLO: + StyleDef.m_iNumColumns = 6; // LEFT, UP+LEFT, DOWN, UP, UP+RIGHT, RIGHT + StyleDef.m_ColumnToTapNote[0] = NOTE_PAD1_LEFT; + StyleDef.m_ColumnToTapNote[1] = NOTE_PAD1_UPLEFT; + StyleDef.m_ColumnToTapNote[2] = NOTE_PAD1_DOWN; + StyleDef.m_ColumnToTapNote[3] = NOTE_PAD1_UP; + StyleDef.m_ColumnToTapNote[4] = NOTE_PAD1_UPRIGHT; + StyleDef.m_ColumnToTapNote[5] = NOTE_PAD1_RIGHT; + StyleDef.m_ColumnToRotation[0] = mapTapNoteToRotation[NOTE_PAD1_LEFT]; + StyleDef.m_ColumnToRotation[1] = mapTapNoteToRotation[NOTE_PAD1_UPLEFT]; + StyleDef.m_ColumnToRotation[2] = mapTapNoteToRotation[NOTE_PAD1_DOWN]; + StyleDef.m_ColumnToRotation[3] = mapTapNoteToRotation[NOTE_PAD1_UP]; + StyleDef.m_ColumnToRotation[4] = mapTapNoteToRotation[NOTE_PAD1_UPRIGHT]; + StyleDef.m_ColumnToRotation[5] = mapTapNoteToRotation[NOTE_PAD1_RIGHT]; + break; + case STYLE_DOUBLE: + StyleDef.m_iNumColumns = 8; // 1_LEFT, 1_DOWN, 1_UP, 1_RIGHT, 2_LEFT, 2_DOWN, 2_UP, 2_RIGHT + StyleDef.m_ColumnToTapNote[0] = NOTE_PAD1_LEFT; + StyleDef.m_ColumnToTapNote[1] = NOTE_PAD1_DOWN; + StyleDef.m_ColumnToTapNote[2] = NOTE_PAD1_UP; + StyleDef.m_ColumnToTapNote[3] = NOTE_PAD1_RIGHT; + StyleDef.m_ColumnToTapNote[4] = NOTE_PAD2_LEFT; + StyleDef.m_ColumnToTapNote[5] = NOTE_PAD2_DOWN; + StyleDef.m_ColumnToTapNote[6] = NOTE_PAD2_UP; + StyleDef.m_ColumnToTapNote[7] = NOTE_PAD2_RIGHT; + StyleDef.m_ColumnToTapNote[8] = NOTE_PAD1_UPLEFT;// Even though this isn't used, Need them here so + StyleDef.m_ColumnToTapNote[9] = NOTE_PAD1_UPRIGHT;// TapNoteToColumnNumber doesn't get confused by them + StyleDef.m_ColumnToTapNote[10] = NOTE_PAD2_UPLEFT; + StyleDef.m_ColumnToTapNote[11] = NOTE_PAD2_UPRIGHT; + StyleDef.m_ColumnToRotation[0] = mapTapNoteToRotation[NOTE_PAD1_LEFT]; + StyleDef.m_ColumnToRotation[1] = mapTapNoteToRotation[NOTE_PAD1_DOWN]; + StyleDef.m_ColumnToRotation[2] = mapTapNoteToRotation[NOTE_PAD1_UP]; + StyleDef.m_ColumnToRotation[3] = mapTapNoteToRotation[NOTE_PAD1_RIGHT]; + StyleDef.m_ColumnToRotation[4] = mapTapNoteToRotation[NOTE_PAD2_LEFT]; + StyleDef.m_ColumnToRotation[5] = mapTapNoteToRotation[NOTE_PAD2_DOWN]; + StyleDef.m_ColumnToRotation[6] = mapTapNoteToRotation[NOTE_PAD2_UP]; + StyleDef.m_ColumnToRotation[7] = mapTapNoteToRotation[NOTE_PAD2_RIGHT]; + StyleDef.m_ColumnToRotation[8] = mapTapNoteToRotation[NOTE_PAD1_UPLEFT]; + StyleDef.m_ColumnToRotation[9] = mapTapNoteToRotation[NOTE_PAD1_UPRIGHT]; + StyleDef.m_ColumnToRotation[10] = mapTapNoteToRotation[NOTE_PAD2_UPLEFT]; + StyleDef.m_ColumnToRotation[11] = mapTapNoteToRotation[NOTE_PAD2_UPRIGHT]; + break; + default: + ASSERT( false ); // invalid GameMode + } + + return StyleDef; +} \ No newline at end of file diff --git a/stepmania/src/GameManager.h b/stepmania/src/GameManager.h new file mode 100644 index 0000000000..5490e67e39 --- /dev/null +++ b/stepmania/src/GameManager.h @@ -0,0 +1,40 @@ +/* +----------------------------------------------------------------------------- + Class: GameManager + + Desc: Manages "Game" and "StyleDef", and "Instrument" definitions, which define + different ways of playing - like "dance" and "pump". + + Copyright (c) 2001-2002 by the names listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#ifndef _GameManager_H_ +#define _GameManager_H_ + +#include "StyleDef.h" + +class GameManager +{ +public: + GameManager(); + ~GameManager(); + + DanceStyle m_DanceStyle; // the current style + + + bool IsPlayerEnabled( PlayerNumber PlayerNo ); + + StyleDef GetStyleDef( DanceStyle mode ); + StyleDef GetCurrentStyleDef() { return GetStyleDef(m_DanceStyle); }; + +protected: + +}; + + +extern GameManager* GAME; // global and accessable from anywhere in our program + + +#endif \ No newline at end of file diff --git a/stepmania/src/GhostArrow.cpp b/stepmania/src/GhostArrow.cpp index 8a0bbe4d10..46fd0cc49a 100644 --- a/stepmania/src/GhostArrow.cpp +++ b/stepmania/src/GhostArrow.cpp @@ -31,15 +31,15 @@ void GhostArrow::SetBeat( const float fSongBeat ) //SetState( fmodf(fSongBeat,1)<0.25 ? 1 : 0 ); } -void GhostArrow::Step( TapStepScore score ) +void GhostArrow::Step( TapNoteScore score ) { switch( score ) { - 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; + case TNS_PERFECT: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.6f) ); break; // yellow + case TNS_GREAT: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.6f) ); break; // green + case TNS_GOOD: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.6f) ); break; + case TNS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.6f) ); break; + case TNS_MISS: ASSERT( false ); break; } SetZoom( 1.0f ); BeginTweening( 0.3f ); diff --git a/stepmania/src/GhostArrow.h b/stepmania/src/GhostArrow.h index f5fb7889ed..a0e84a0cad 100644 --- a/stepmania/src/GhostArrow.h +++ b/stepmania/src/GhostArrow.h @@ -16,7 +16,7 @@ class GhostArrow; #include "Sprite.h" -#include "Steps.h" +#include "Pattern.h" class GhostArrow : public Sprite @@ -27,7 +27,7 @@ public: virtual void Update( float fDeltaTime ); void SetBeat( const float fSongBeat ); - void Step( TapStepScore score ); + void Step( TapNoteScore score ); float m_fVisibilityCountdown; }; diff --git a/stepmania/src/GhostArrowBright.cpp b/stepmania/src/GhostArrowBright.cpp index ff7d222f4c..30cf087bb1 100644 --- a/stepmania/src/GhostArrowBright.cpp +++ b/stepmania/src/GhostArrowBright.cpp @@ -27,15 +27,15 @@ void GhostArrowBright::SetBeat( const float fSongBeat ) //SetState( fmodf(fSongBeat,1)<0.25 ? 1 : 0 ); } -void GhostArrowBright::Step( TapStepScore score ) +void GhostArrowBright::Step( TapNoteScore score ) { switch( score ) { - 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; + case TNS_PERFECT: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,1.0f) ); break; // yellow + case TNS_GREAT: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,1.0f) ); break; // green + case TNS_GOOD: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,1.0f) ); break; + case TNS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,1.0f) ); break; + case TNS_MISS: ASSERT( false ); break; } SetState( 0 ); SetZoom( 1.2f ); diff --git a/stepmania/src/GhostArrowBright.h b/stepmania/src/GhostArrowBright.h index 53dd750862..94a56dfd24 100644 --- a/stepmania/src/GhostArrowBright.h +++ b/stepmania/src/GhostArrowBright.h @@ -16,7 +16,7 @@ class GhostArrowBright; #include "Sprite.h" -#include "Steps.h" +#include "Pattern.h" class GhostArrowBright : public Sprite @@ -25,7 +25,7 @@ public: GhostArrowBright(); void SetBeat( const float fSongBeat ); - void Step( TapStepScore score ); + void Step( TapNoteScore score ); float m_fVisibilityCountdown; }; diff --git a/stepmania/src/Grade.cpp b/stepmania/src/Grade.cpp index f8567cc15f..8351df03a4 100644 --- a/stepmania/src/Grade.cpp +++ b/stepmania/src/Grade.cpp @@ -1,11 +1,12 @@ #include "stdafx.h" /* ----------------------------------------------------------------------------- - File: Grade.cpp + Class: Grade - Desc: A graphic displayed in the Grade during Dancing. + Desc: See header. - Copyright (c) 2001 Chris Danford. All rights reserved. + Copyright (c) 2001-2002 by the names listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ diff --git a/stepmania/src/Grade.h b/stepmania/src/Grade.h index 0d773df9df..ff98e26d35 100644 --- a/stepmania/src/Grade.h +++ b/stepmania/src/Grade.h @@ -1,10 +1,11 @@ /* ----------------------------------------------------------------------------- - File: Grade.h + Class: Grade - Desc: A graphic displayed in the Grade during Dancing. + Desc: This a mark the player receives after clearing a song. - Copyright (c) 2001 Chris Danford. All rights reserved. + Copyright (c) 2001-2002 by the names listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ diff --git a/stepmania/src/GrayArrow.h b/stepmania/src/GrayArrow.h index d65adb3ea1..b90df95207 100644 --- a/stepmania/src/GrayArrow.h +++ b/stepmania/src/GrayArrow.h @@ -16,7 +16,7 @@ #include "Sprite.h" -#include "Steps.h" +#include "Pattern.h" class GrayArrow : public Sprite { diff --git a/stepmania/src/HoldGhostArrow.h b/stepmania/src/HoldGhostArrow.h index 820b3dffeb..0ffe090825 100644 --- a/stepmania/src/HoldGhostArrow.h +++ b/stepmania/src/HoldGhostArrow.h @@ -16,7 +16,7 @@ class HoldGhostArrow; #include "Sprite.h" -#include "Steps.h" +#include "Pattern.h" class HoldGhostArrow : public Sprite diff --git a/stepmania/src/HoldJudgement.cpp b/stepmania/src/HoldJudgement.cpp index b8314a6d2d..c9e33d4271 100644 --- a/stepmania/src/HoldJudgement.cpp +++ b/stepmania/src/HoldJudgement.cpp @@ -43,21 +43,21 @@ void HoldJudgement::RenderPrimitives() } } -void HoldJudgement::SetHoldJudgement( HoldStepResult result ) +void HoldJudgement::SetHoldJudgement( HoldNoteResult 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; + case HNR_NONE: m_sprJudgement.SetState( 0 ); break; + case HNR_OK: m_sprJudgement.SetState( 7 ); break; + case HNR_NG: m_sprJudgement.SetState( 8 ); break; default: ASSERT( false ); } m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME; - if( result == HSR_NG ) + if( result == HNR_NG ) { // falling down m_sprJudgement.SetY( -10 ); @@ -65,7 +65,7 @@ void HoldJudgement::SetHoldJudgement( HoldStepResult result ) m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME ); m_sprJudgement.SetTweenY( 10 ); } - else if( result == HSR_OK ) + else if( result == HNR_OK ) { // zooming out m_sprJudgement.SetZoom( 1.5f ); diff --git a/stepmania/src/HoldJudgement.h b/stepmania/src/HoldJudgement.h index 3a4f36d26c..46bf5bab83 100644 --- a/stepmania/src/HoldJudgement.h +++ b/stepmania/src/HoldJudgement.h @@ -24,7 +24,7 @@ class HoldJudgement : public ActorFrame { public: HoldJudgement(); - void SetHoldJudgement( HoldStepResult result ); + void SetHoldJudgement( HoldNoteResult result ); virtual void Update( float fDeltaTime ); virtual void RenderPrimitives(); diff --git a/stepmania/src/Judgement.cpp b/stepmania/src/Judgement.cpp index a81d65c7fa..130f26f40a 100644 --- a/stepmania/src/Judgement.cpp +++ b/stepmania/src/Judgement.cpp @@ -44,23 +44,23 @@ void Judgement::RenderPrimitives() } -void Judgement::SetJudgement( TapStepScore score ) +void Judgement::SetJudgement( TapNoteScore 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; + case TNS_PERFECT: m_sprJudgement.SetState( 0 ); break; + case TNS_GREAT: m_sprJudgement.SetState( 1 ); break; + case TNS_GOOD: m_sprJudgement.SetState( 2 ); break; + case TNS_BOO: m_sprJudgement.SetState( 3 ); break; + case TNS_MISS: m_sprJudgement.SetState( 4 ); break; default: ASSERT( false ); } m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME; - if( score == TSS_MISS ) + if( score == TNS_MISS ) { // falling down m_sprJudgement.SetY( -30 ); diff --git a/stepmania/src/Judgement.h b/stepmania/src/Judgement.h index 491995c306..1f1e9ddfc3 100644 --- a/stepmania/src/Judgement.h +++ b/stepmania/src/Judgement.h @@ -24,7 +24,7 @@ class Judgement : public ActorFrame { public: Judgement(); - void SetJudgement( TapStepScore score ); + void SetJudgement( TapNoteScore score ); virtual void Update( float fDeltaTime ); virtual void RenderPrimitives(); diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index d9678468f7..327cc795cd 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -12,6 +12,7 @@ #include "MusicWheel.h" #include "RageUtil.h" #include "SongManager.h" +#include "GameManager.h" #include "ScreenDimensions.h" #include "ThemeManager.h" #include "RageMusic.h" @@ -231,7 +232,7 @@ MusicWheel::MusicWheel() // init m_mapGroupNameToBannerColor CArray arraySongs; - arraySongs.Copy( SONGS->m_pSongs ); + arraySongs.Copy( SONG->m_pSongs ); SortSongPointerArrayByGroup( arraySongs ); int iNextGroupBannerColor = 0; @@ -271,10 +272,10 @@ MusicWheel::MusicWheel() BuildWheelItemDatas( m_WheelItemDatas[so], SongSortOrder(so) ); - if( SONGS->m_pCurSong == NULL && // if there is no currently selected song - SONGS->m_pSongs.GetSize() > 0 ) // and there is at least one song + if( SONG->m_pCurSong == NULL && // if there is no currently selected song + SONG->m_pSongs.GetSize() > 0 ) // and there is at least one song { - SONGS->m_pCurSong = SONGS->m_pSongs[0]; // select the first song + SONG->m_pCurSong = SONG->m_pSongs[0]; // select the first song } @@ -283,7 +284,7 @@ MusicWheel::MusicWheel() for( i=0; im_pCurSong ) + && GetCurWheelItemDatas()[i].m_pSong == SONG->m_pCurSong ) { m_iSelection = i; // select it m_sExpandedSectionName = GetCurWheelItemDatas()[m_iSelection].m_sSectionName; // make its group the currently expanded group @@ -309,20 +310,20 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr /////////////////////////////////// CArray arraySongs; - // copy only song that have at least one Steps for the current GameMode - for( int i=0; im_pSongs.GetSize(); i++ ) + // copy only song that have at least one Pattern for the current GameMode + for( int i=0; im_pSongs.GetSize(); i++ ) { - Song* pSong = SONGS->m_pSongs[i]; + Song* pSong = SONG->m_pSongs[i]; - CArray arraySteps; - pSong->GetStepsThatMatchGameMode( PREFS->m_GameMode, arraySteps ); + CArray arraySteps; + pSong->GetPatternsThatMatchStyle( GAME->m_DanceStyle, arraySteps ); if( arraySteps.GetSize() > 0 ) arraySongs.Add( pSong ); } - // sort the songs + // sort the SONG switch( so ) { case SORT_GROUP: @@ -432,7 +433,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr if( arrayWheelItemDatas.GetSize() == 0 ) { arrayWheelItemDatas.SetSize( 1 ); - arrayWheelItemDatas[0].LoadFromSectionName( "No Songs" ); + arrayWheelItemDatas[0].LoadFromSectionName( "No SONG" ); arrayWheelItemDatas[0].m_colorTint = D3DXCOLOR(0.5f,0.5f,0.5f,1); } } diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index be2eb62374..e455fd9387 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -1,10 +1,9 @@ #include "stdafx.h" /* ----------------------------------------------------------------------------- - File: Player.cpp + Class: Pattern - Desc: Object that accepts pad input, knocks down ColorArrows that were stepped on, - and keeps score for the player. + Desc: See header. Copyright (c) 2001 Chris Danford. All rights reserved. ----------------------------------------------------------------------------- @@ -36,13 +35,13 @@ Player::Player() m_PlayerNumber = PLAYER_NONE; // init step elements - for( int i=0; iAddActor( &m_GrayArrows ); @@ -57,39 +56,39 @@ Player::Player() } -void Player::Load( const Style& style, PlayerNumber player_no, const Steps& steps, const PlayerOptions& po ) +void Player::Load( const StyleDef& StyleDef, PlayerNumber player_no, const Pattern& pattern, const PlayerOptions& po ) { //RageLog( "Player::Load()", ); - m_Style = style; + m_Style = StyleDef; m_PlayerNumber = player_no; m_PlayerOptions = po; - Steps steps2 = steps; + Pattern pattern2 = pattern; if( !po.m_bAllowFreezeArrows ) - steps2.RemoveHoldSteps(); + pattern2.RemoveHoldNotes(); - steps2.Turn( po.m_TurnType ); + pattern2.Turn( po.m_TurnType ); if( po.m_bLittle ) - steps2.MakeLittle(); + pattern2.MakeLittle(); - m_ColorArrowField.Load( style, steps2, po, 2, 10 ); - m_GrayArrows.Load( po, style ); - m_GhostArrows.Load( po, style ); + m_ColorArrowField.Load( StyleDef, pattern2, po, 2, 10 ); + m_GrayArrows.Load( po, StyleDef ); + m_GhostArrows.Load( po, StyleDef ); // load step elements - for( int i=0; i 0 ) { - m_Judgement.SetJudgement( TSS_MISS ); + m_Judgement.SetJudgement( TNS_MISS ); m_Combo.EndCombo(); for( int i=0; iIsButtonDown( PlayerI ); if( bIsHoldingButton ) { - 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 + hns.m_fLife += fDeltaTime/HOLD_ARROW_NG_TIME; + hns.m_fLife = min( hns.m_fLife, 1 ); // clamp + int iCol = m_Style.TapNoteToColumnNumber( hn.m_TapNote ); + m_GhostArrows.HoldNote( 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 + hns.m_fLife -= fDeltaTime/HOLD_ARROW_NG_TIME; + hns.m_fLife = max( hns.m_fLife, 0 ); // clamp } - m_ColorArrowField.SetHoldStepLife( i, hss.m_fLife ); // update the ColorArrowField display + m_ColorArrowField.SetHoldNoteLife( i, hns.m_fLife ); // update the ColorArrowField display } // check for NG - if( hss.m_fLife == 0 ) // the player has not pressed the button for a long time! + if( hns.m_fLife == 0 ) // the player has not pressed the button for a long time! { - hss.m_Result = HSR_NG; - int iCol = m_Style.TapStepToColumnNumber( hs.m_TapStep ); - m_HoldJudgement[iCol].SetHoldJudgement( HSR_NG ); + hns.m_Result = HNR_NG; + int iCol = m_Style.TapNoteToColumnNumber( hn.m_TapNote ); + m_HoldJudgement[iCol].SetHoldJudgement( HNR_NG ); } // check for OK - if( m_fSongBeat > fEndBeat ) // if this HoldStep is in the past + if( m_fSongBeat > fEndBeat ) // if this HoldNote is in the past { - // 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 + // this implies that hns.m_fLife > 0, or else we would have marked it NG above + hns.m_fLife = 1; + hns.m_Result = HNR_OK; + int iCol = m_Style.TapNoteToColumnNumber( hn.m_TapNote ); + m_HoldJudgement[iCol].SetHoldJudgement( HNR_OK ); + m_ColorArrowField.SetHoldNoteLife( i, hns.m_fLife ); // update the ColorArrowField display } } @@ -249,12 +248,12 @@ void Player::RenderPrimitives() bool Player::IsThereANoteAtIndex( int iIndex ) { - if( m_TapStepsOriginal[iIndex] != STEP_NONE ) + if( m_TapNotesOriginal[iIndex] != NOTE_NONE ) return true; - for( int i=0; i 100 ); + int iColNum = m_Style.TapNoteToColumnNumber( player_step ); + m_GhostArrows.TapNote( iColNum, score, m_Combo.GetCurrentCombo() > 100 ); // update the combo display switch( score ) { - case TSS_PERFECT: - case TSS_GREAT: + case TNS_PERFECT: + case TNS_GREAT: m_Combo.ContinueCombo(); break; - case TSS_GOOD: - case TSS_BOO: + case TNS_GOOD: + case TNS_BOO: m_Combo.EndCombo(); break; } @@ -339,13 +338,13 @@ void Player::HandlePlayerStep( float fSongBeat, TapStep player_step, float fMaxB } -void Player::CheckForCompleteStep( float fSongBeat, TapStep player_step, float fMaxBeatDiff ) +void Player::CheckForCompleteStep( float fSongBeat, TapNote player_step, float fMaxBeatDiff ) { //RageLog( "Player::CheckForCompleteStep()" ); // look for the closest matching step - int iIndexStartLookingAt = BeatToStepIndex( fSongBeat ); - int iNumElementsToExamine = BeatToStepIndex( fMaxBeatDiff ); // number of elements to examine on either end of iIndexStartLookingAt + int iIndexStartLookingAt = BeatToNoteIndex( fSongBeat ); + int iNumElementsToExamine = BeatToNoteIndex( fMaxBeatDiff ); // number of elements to examine on either end of iIndexStartLookingAt //RageLog( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine ); @@ -356,17 +355,17 @@ void Player::CheckForCompleteStep( float fSongBeat, TapStep player_step, float f int iCurrentIndexLater = iIndexStartLookingAt + delta; // silly check to make sure we don't go out of bounds - iCurrentIndexEarlier = clamp( iCurrentIndexEarlier, 0, MAX_TAP_STEP_ELEMENTS-1 ); - iCurrentIndexLater = clamp( iCurrentIndexLater, 0, MAX_TAP_STEP_ELEMENTS-1 ); + iCurrentIndexEarlier = clamp( iCurrentIndexEarlier, 0, MAX_TAP_NOTE_ELEMENTS-1 ); + iCurrentIndexLater = clamp( iCurrentIndexLater, 0, MAX_TAP_NOTE_ELEMENTS-1 ); //////////////////////////// // check the step to the left of iIndexStartLookingAt //////////////////////////// - //RageLog( "Checking steps[%d]", iCurrentIndexEarlier ); - if( m_TapStepsRemaining[iCurrentIndexEarlier] & player_step ) // these steps overlap + //RageLog( "Checking Pattern[%d]", iCurrentIndexEarlier ); + if( m_TapNotesRemaining[iCurrentIndexEarlier] & player_step ) // these Pattern overlap { - m_TapStepsRemaining[iCurrentIndexEarlier] &= ~player_step; // subtract player_step - if( m_TapStepsRemaining[iCurrentIndexEarlier] == 0 ) { // did this complete the step? + m_TapNotesRemaining[iCurrentIndexEarlier] &= ~player_step; // subtract player_step + if( m_TapNotesRemaining[iCurrentIndexEarlier] == 0 ) { // did this complete the step? OnCompleteStep( fSongBeat, player_step, fMaxBeatDiff, iCurrentIndexEarlier ); return; } @@ -375,11 +374,11 @@ void Player::CheckForCompleteStep( float fSongBeat, TapStep player_step, float f //////////////////////////// // check the step to the right of iIndexStartLookingAt //////////////////////////// - //RageLog( "Checking steps[%d]", iCurrentIndexLater ); - if( m_TapStepsRemaining[iCurrentIndexLater] & player_step ) // these steps overlap + //RageLog( "Checking Pattern[%d]", iCurrentIndexLater ); + if( m_TapNotesRemaining[iCurrentIndexLater] & player_step ) // these Pattern overlap { - m_TapStepsRemaining[iCurrentIndexLater] &= ~player_step; // subtract player_step - if( m_TapStepsRemaining[iCurrentIndexLater] == 0 ) { // did this complete the step? + m_TapNotesRemaining[iCurrentIndexLater] &= ~player_step; // subtract player_step + if( m_TapNotesRemaining[iCurrentIndexLater] == 0 ) { // did this complete the step? OnCompleteStep( fSongBeat, player_step, fMaxBeatDiff, iCurrentIndexLater ); return; } @@ -387,9 +386,9 @@ void Player::CheckForCompleteStep( float fSongBeat, TapStep player_step, float f } } -void Player::OnCompleteStep( float fSongBeat, TapStep player_step, float fMaxBeatDiff, int iIndexThatWasSteppedOn ) +void Player::OnCompleteStep( float fSongBeat, TapNote player_step, float fMaxBeatDiff, int iIndexThatWasSteppedOn ) { - float fStepBeat = StepIndexToBeat( (float)iIndexThatWasSteppedOn ); + float fStepBeat = NoteIndexToBeat( (float)iIndexThatWasSteppedOn ); float fBeatsUntilStep = fStepBeat - fSongBeat; @@ -399,12 +398,12 @@ void Player::OnCompleteStep( float fSongBeat, TapStep player_step, float fMaxBea // fBeatsUntilStep, fPercentFromPerfect ); // compute what the score should be for the note we stepped on - TapStepScore &score = m_TapStepScores[iIndexThatWasSteppedOn]; + TapNoteScore &score = m_TapNoteScores[iIndexThatWasSteppedOn]; - 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; + if( fPercentFromPerfect < 0.25f ) score = TNS_PERFECT; + else if( fPercentFromPerfect < 0.50f ) score = TNS_GREAT; + else if( fPercentFromPerfect < 0.75f ) score = TNS_GOOD; + else score = TNS_BOO; // update the judgement, score, and life m_Judgement.SetJudgement( score ); @@ -413,24 +412,24 @@ void Player::OnCompleteStep( float fSongBeat, TapStep player_step, float fMaxBea // remove this row from the ColorArrowField - m_ColorArrowField.RemoveTapStepRow( iIndexThatWasSteppedOn ); + m_ColorArrowField.RemoveTapNoteRow( iIndexThatWasSteppedOn ); // check to see if this completes a row of notes for( int c=0; c100 ); // show the ghost arrow for this column + if( m_TapNotesOriginal[iIndexThatWasSteppedOn] & m_Style.m_ColumnToTapNote[c] ) // if this colum was part of the original step + m_GhostArrows.TapNote( c, score, m_Combo.GetCurrentCombo()>100 ); // show the ghost arrow for this column } // update the combo display switch( score ) { - case TSS_PERFECT: - case TSS_GREAT: + case TNS_PERFECT: + case TNS_GREAT: m_Combo.ContinueCombo(); break; - case TSS_GOOD: - case TSS_BOO: + case TNS_GOOD: + case TNS_BOO: m_Combo.EndCombo(); break; } @@ -441,36 +440,36 @@ ScoreSummary Player::GetScoreSummary() { ScoreSummary scoreSummary; - for( int i=0; im_DanceStyle ) { - case MODE_SINGLE: - case MODE_SOLO: + case STYLE_SINGLE: + case STYLE_SOLO: if( PadI.pad_no == PAD_1 ) PlayerI.player_no = PLAYER_1; else PlayerI.player_no = PLAYER_NONE; - if ( PadI.button == BUTTON_LEFT ) PlayerI.step |= STEP_PAD1_LEFT; - if ( PadI.button == BUTTON_UPLEFT ) PlayerI.step |= STEP_PAD1_UPLEFT; - if ( PadI.button == BUTTON_DOWN ) PlayerI.step |= STEP_PAD1_DOWN; - if ( PadI.button == BUTTON_UP ) PlayerI.step |= STEP_PAD1_UP; - if ( PadI.button == BUTTON_UPRIGHT ) PlayerI.step |= STEP_PAD1_UPRIGHT; - if ( PadI.button == BUTTON_RIGHT ) PlayerI.step |= STEP_PAD1_RIGHT; + if ( PadI.button == BUTTON_LEFT ) PlayerI.note |= NOTE_PAD1_LEFT; + if ( PadI.button == BUTTON_UPLEFT ) PlayerI.note |= NOTE_PAD1_UPLEFT; + if ( PadI.button == BUTTON_DOWN ) PlayerI.note |= NOTE_PAD1_DOWN; + if ( PadI.button == BUTTON_UP ) PlayerI.note |= NOTE_PAD1_UP; + if ( PadI.button == BUTTON_UPRIGHT ) PlayerI.note |= NOTE_PAD1_UPRIGHT; + if ( PadI.button == BUTTON_RIGHT ) PlayerI.note |= NOTE_PAD1_RIGHT; break; - case MODE_VERSUS: - case MODE_COUPLE: + case STYLE_VERSUS: + case STYLE_COUPLE: if( PadI.pad_no == PAD_1 ) PlayerI.player_no = PLAYER_1; else if( PadI.pad_no == PAD_2 ) @@ -303,31 +302,31 @@ void PrefsManager::PadToPlayer( PadInput PadI, PlayerInput &PlayerI ) else PlayerI.player_no = PLAYER_NONE; - if ( PadI.button == BUTTON_LEFT ) PlayerI.step |= STEP_PAD1_LEFT; - if ( PadI.button == BUTTON_UPLEFT ) PlayerI.step |= STEP_PAD1_UPLEFT; - if ( PadI.button == BUTTON_DOWN ) PlayerI.step |= STEP_PAD1_DOWN; - if ( PadI.button == BUTTON_UP ) PlayerI.step |= STEP_PAD1_UP; - if ( PadI.button == BUTTON_UPRIGHT ) PlayerI.step |= STEP_PAD1_UPRIGHT; - if ( PadI.button == BUTTON_RIGHT ) PlayerI.step |= STEP_PAD1_RIGHT; + if ( PadI.button == BUTTON_LEFT ) PlayerI.note |= NOTE_PAD1_LEFT; + if ( PadI.button == BUTTON_UPLEFT ) PlayerI.note |= NOTE_PAD1_UPLEFT; + if ( PadI.button == BUTTON_DOWN ) PlayerI.note |= NOTE_PAD1_DOWN; + if ( PadI.button == BUTTON_UP ) PlayerI.note |= NOTE_PAD1_UP; + if ( PadI.button == BUTTON_UPRIGHT ) PlayerI.note |= NOTE_PAD1_UPRIGHT; + if ( PadI.button == BUTTON_RIGHT ) PlayerI.note |= NOTE_PAD1_RIGHT; break; - case MODE_DOUBLE: + case STYLE_DOUBLE: switch( PadI.pad_no ) { case PAD_1: PlayerI.player_no = PLAYER_1; - if ( PadI.button == BUTTON_LEFT ) PlayerI.step |= STEP_PAD1_LEFT; - if ( PadI.button == BUTTON_DOWN ) PlayerI.step |= STEP_PAD1_DOWN; - if ( PadI.button == BUTTON_UP ) PlayerI.step |= STEP_PAD1_UP; - if ( PadI.button == BUTTON_RIGHT ) PlayerI.step |= STEP_PAD1_RIGHT; + if ( PadI.button == BUTTON_LEFT ) PlayerI.note |= NOTE_PAD1_LEFT; + if ( PadI.button == BUTTON_DOWN ) PlayerI.note |= NOTE_PAD1_DOWN; + if ( PadI.button == BUTTON_UP ) PlayerI.note |= NOTE_PAD1_UP; + if ( PadI.button == BUTTON_RIGHT ) PlayerI.note |= NOTE_PAD1_RIGHT; break; case PAD_2: PlayerI.player_no = PLAYER_1; - if ( PadI.button == BUTTON_LEFT ) PlayerI.step |= STEP_PAD2_LEFT; - if ( PadI.button == BUTTON_DOWN ) PlayerI.step |= STEP_PAD2_DOWN; - if ( PadI.button == BUTTON_UP ) PlayerI.step |= STEP_PAD2_UP; - if ( PadI.button == BUTTON_RIGHT ) PlayerI.step |= STEP_PAD2_RIGHT; + if ( PadI.button == BUTTON_LEFT ) PlayerI.note |= NOTE_PAD2_LEFT; + if ( PadI.button == BUTTON_DOWN ) PlayerI.note |= NOTE_PAD2_DOWN; + if ( PadI.button == BUTTON_UP ) PlayerI.note |= NOTE_PAD2_UP; + if ( PadI.button == BUTTON_RIGHT ) PlayerI.note |= NOTE_PAD2_RIGHT; break; case PAD_NONE: PlayerI.player_no = PLAYER_NONE; @@ -336,7 +335,7 @@ void PrefsManager::PadToPlayer( PadInput PadI, PlayerInput &PlayerI ) break; default: - ASSERT( false ); // invalid GameMode + ASSERT( false ); // invalid DanceStyle } } @@ -345,38 +344,38 @@ void PrefsManager::PlayerToPad( PlayerInput PlayerI, PadInput &PadI ) PadI.pad_no = PAD_NONE; PadI.button = BUTTON_NONE; - switch( m_GameMode ) + switch( GAME->m_DanceStyle ) { - case MODE_SINGLE: - case MODE_SOLO: - case MODE_VERSUS: - case MODE_COUPLE: + case STYLE_SINGLE: + case STYLE_SOLO: + case STYLE_VERSUS: + case STYLE_COUPLE: PadI.pad_no = (PadNumber)PlayerI.player_no; - if ( PlayerI.step == STEP_PAD1_LEFT ) PadI.button = BUTTON_LEFT; - if ( PlayerI.step == STEP_PAD1_UPLEFT ) PadI.button = BUTTON_UPLEFT; - if ( PlayerI.step == STEP_PAD1_DOWN ) PadI.button = BUTTON_DOWN; - if ( PlayerI.step == STEP_PAD1_UP ) PadI.button = BUTTON_UP; - if ( PlayerI.step == STEP_PAD1_UPRIGHT ) PadI.button = BUTTON_UPRIGHT; - if ( PlayerI.step == STEP_PAD1_RIGHT ) PadI.button = BUTTON_RIGHT; + if ( PlayerI.note == NOTE_PAD1_LEFT ) PadI.button = BUTTON_LEFT; + if ( PlayerI.note == NOTE_PAD1_UPLEFT ) PadI.button = BUTTON_UPLEFT; + if ( PlayerI.note == NOTE_PAD1_DOWN ) PadI.button = BUTTON_DOWN; + if ( PlayerI.note == NOTE_PAD1_UP ) PadI.button = BUTTON_UP; + if ( PlayerI.note == NOTE_PAD1_UPRIGHT ) PadI.button = BUTTON_UPRIGHT; + if ( PlayerI.note == NOTE_PAD1_RIGHT ) PadI.button = BUTTON_RIGHT; break; - case MODE_DOUBLE: - switch( PlayerI.step ) + case STYLE_DOUBLE: + switch( PlayerI.note ) { - case STEP_PAD1_LEFT: PadI.pad_no = PAD_1; PadI.button = BUTTON_LEFT; break; - case STEP_PAD1_DOWN: PadI.pad_no = PAD_1; PadI.button = BUTTON_DOWN; break; - case STEP_PAD1_UP: PadI.pad_no = PAD_1; PadI.button = BUTTON_UP; break; - case STEP_PAD1_RIGHT: PadI.pad_no = PAD_1; PadI.button = BUTTON_RIGHT; break; - case STEP_PAD2_LEFT: PadI.pad_no = PAD_2; PadI.button = BUTTON_LEFT; break; - case STEP_PAD2_DOWN: PadI.pad_no = PAD_2; PadI.button = BUTTON_DOWN; break; - case STEP_PAD2_UP: PadI.pad_no = PAD_2; PadI.button = BUTTON_UP; break; - case STEP_PAD2_RIGHT: PadI.pad_no = PAD_2; PadI.button = BUTTON_RIGHT; break; + case NOTE_PAD1_LEFT: PadI.pad_no = PAD_1; PadI.button = BUTTON_LEFT; break; + case NOTE_PAD1_DOWN: PadI.pad_no = PAD_1; PadI.button = BUTTON_DOWN; break; + case NOTE_PAD1_UP: PadI.pad_no = PAD_1; PadI.button = BUTTON_UP; break; + case NOTE_PAD1_RIGHT: PadI.pad_no = PAD_1; PadI.button = BUTTON_RIGHT; break; + case NOTE_PAD2_LEFT: PadI.pad_no = PAD_2; PadI.button = BUTTON_LEFT; break; + case NOTE_PAD2_DOWN: PadI.pad_no = PAD_2; PadI.button = BUTTON_DOWN; break; + case NOTE_PAD2_UP: PadI.pad_no = PAD_2; PadI.button = BUTTON_UP; break; + case NOTE_PAD2_RIGHT: PadI.pad_no = PAD_2; PadI.button = BUTTON_RIGHT; break; } break; default: - ASSERT( false ); // invalid GameMode + ASSERT( false ); // invalid DanceStyle } } diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 5da16590ad..c30459ef9b 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -2,8 +2,11 @@ ----------------------------------------------------------------------------- Class: PrefsManager - Desc: Manages input mapping, saves preferences, and holds data that is passed - between Windows. + Desc: Manages all other game data that isn't handled about SongManager, + GameManager, or ThemeManager. Some of this data is saved between sessions, + for example, input mapping settings and GameOptions. This class also has + temporary holders for information that passed between windows - e.g. + ScoreSummary. Copyright (c) 2001-2002 by the names listed below. All rights reserved. Chris Danford @@ -32,44 +35,16 @@ public: PrefsManager(); ~PrefsManager(); - GameMode m_GameMode; - - ScoreSummary scoreSummaryPlayer[NUM_PLAYERS]; - - SongSortOrder m_SongSortOrder; - - int m_iCurrentStage; + ScoreSummary m_ScoreSummary[NUM_PLAYERS]; // for passing from Dancing to Results + SongSortOrder m_SongSortOrder; // used by MusicWheel and should be saved until the app exits + int m_iCurrentStage; // number of stages played +1 GameOptions m_GameOptions; PlayerOptions m_PlayerOptions[NUM_PLAYERS]; SongOptions m_SongOptions; - bool IsPlayerEnabled( PlayerNumber PlayerNo ) - { - switch( m_GameMode ) - { - case MODE_VERSUS: - case MODE_COUPLE: - if( PlayerNo == PLAYER_1 ) - return true; - if( PlayerNo == PLAYER_2 ) - return true; - break; - case MODE_SINGLE: - case MODE_SOLO: - case MODE_DOUBLE: - if( PlayerNo == PLAYER_1 ) - return true; - if( PlayerNo == PLAYER_2 ) - return false; - break; - default: - ASSERT( false ); // invalid game mode - } - return false; - }; - // prefs file stuff + // read and write to disk void ReadPrefsFromDisk(); void SavePrefsToDisk(); @@ -91,11 +66,6 @@ public: bool IsButtonDown( PadInput pi ); bool IsButtonDown( PlayerInput PlayerI ); - // theme stuff - CString m_ThemeName; - - - protected: diff --git a/stepmania/src/ScoreDisplayRolling.cpp b/stepmania/src/ScoreDisplayRolling.cpp index 8bd7ff0183..135c5ea794 100644 --- a/stepmania/src/ScoreDisplayRolling.cpp +++ b/stepmania/src/ScoreDisplayRolling.cpp @@ -93,12 +93,12 @@ void ScoreDisplayRolling::Draw() -void ScoreDisplayRolling::AddToScore( TapStepScore stepscore, int iCurCombo ) +void ScoreDisplayRolling::AddToScore( TapNoteScore score, 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 + // Multiplier (M) = (# of Pattern 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 @@ -117,17 +117,59 @@ void ScoreDisplayRolling::AddToScore( TapStepScore stepscore, int iCurCombo ) float M = iCurCombo/4.0f; float fScoreToAdd = 0; - switch( stepscore ) + switch( score ) { - 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; + case TNS_MISS: break; + case TNS_BOO: break; + case TNS_GOOD: fScoreToAdd = M * 100 + 100; break; + case TNS_GREAT: fScoreToAdd = M * M * 100 + 300; break; + case TNS_PERFECT: fScoreToAdd = M * M * 300 + 500; break; } m_fScore += fScoreToAdd; ASSERT( m_fScore >= 0 ); + /* Score implementation by Chris Gomez, February 6th, 2002 The + scoring system for 5th mix is much more complicated than the original + scoring system. We don't have bonuses yet, so they're not included in + this code. Max score is (feet + 1) * 5,000,000. Scores are clamped + to integers; this is fixed on the last step (if it's perfect) + + The base step value is the max score divided by 10, divided by + one-half of the max combo squared plus the max combo. This value is + multiplied by 10 for a perfect or 5 for a great, and further + multiplied by the number of Pattern currently in the combo. */ +/* + int iScoreToAdd = 0; int iBonus = 0; + + Pattern *pSteps = GAMEINFO->m_pStepsPlayer[m_PlayerNumber]; + int iNumFeet = pSteps->m_iNumFeet; + int iMaxCombo = pSteps->GetNumSteps(); + + int iScoreMax = (iNumFeet + 1) * 5000000; //magic numbers. int + iBaseScore = (iScoreMax / 10) / ((iMaxCombo * (iMaxCombo + 1)) / 2); + + iCurCombo++; // looks like the current combo counter starts at 0 when + iCurCombo++it should start at 1 + // this was messing with the scoring, so it had to be fixed. + + switch (score) + { + case miss: + case boo: + case good: + break; + case great: + iScoreToAdd = 5 * iBaseScore * iCurCombo; + break; + case perfect: + iScoreToAdd = 10 * iBaseScore * iCurCombo; + if(BeatToStepIndex(pSteps->GetLastBeat()) == iMaxCombo) + for(int i = 1; i <= iMaxCombo; i++) + iBonus += 10 * iBaseScore * i; + iScoreToAdd += iBonus; + break; + } +*/ this->SetScore( m_fScore ); } diff --git a/stepmania/src/ScoreDisplayRolling.h b/stepmania/src/ScoreDisplayRolling.h index 653470256e..1af2840a1e 100644 --- a/stepmania/src/ScoreDisplayRolling.h +++ b/stepmania/src/ScoreDisplayRolling.h @@ -29,7 +29,7 @@ public: void SetScore( float fNewScore ); float GetScore(); - void AddToScore( TapStepScore stepscore, int iCurCombo ); + void AddToScore( TapNoteScore score, int iCurCombo ); virtual void Update( float fDeltaTime ); virtual void Draw(); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 31a635f795..14fa080328 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -11,7 +11,7 @@ #include "Util.h" -#include "Steps.h" +#include "Pattern.h" #include "RageUtil.h" #include "Song.h" @@ -224,12 +224,12 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir ) // is identical for every BMS file in the directory. m_sSongFilePath = m_sSongDir + arrayBMSFileNames[0]; - // load the Steps from the rest of the BMS files + // load the Pattern from the rest of the BMS files for( int i=0; i') + // strip Pattern type out of description leaving only song title (looks like 'B4U ') m_sTitle.Replace( "(ANOTHER)", "" ); m_sTitle.Replace( "(BASIC)", "" ); m_sTitle.Replace( "(MANIAC)", "" ); @@ -347,15 +347,15 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir ) { case 01: // background music track float fBeatOffset; - fBeatOffset = StepIndexToBeat( (float)iStepIndex ); + fBeatOffset = NoteIndexToBeat( (float)iStepIndex ); float fBPS; fBPS = m_BPMSegments[0].m_fBPM/60.0f; m_fOffsetInSeconds = fBeatOffset / fBPS; - //RageLog( "Found offset to be index %d, beat %f", iStepIndex, StepIndexToBeat(iStepIndex) ); + //RageLog( "Found offset to be index %d, beat %f", iStepIndex, NoteIndexToBeat(iStepIndex) ); break; case 03: // bpm BPMSegment new_seg; - new_seg.m_fStartBeat = StepIndexToBeat( (float)iStepIndex ); + new_seg.m_fStartBeat = NoteIndexToBeat( (float)iStepIndex ); new_seg.m_fBPM = (float)arrayNotes[j]; m_BPMSegments.Add( new_seg ); // add to back for now (we'll sort later) @@ -488,7 +488,7 @@ bool Song::LoadSongInfoFromDWIFile( CString sPath ) CStringArray arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); float fIndex = atoi( arrayFreezeValues[0] ) * ELEMENTS_PER_BEAT / 4.0f; - float fFreezeBeat = StepIndexToBeat( fIndex ); + float fFreezeBeat = NoteIndexToBeat( fIndex ); float fFreezeSeconds = (float)atof( arrayFreezeValues[1] ) / 1000.0f; FreezeSegment new_seg; @@ -513,7 +513,7 @@ bool Song::LoadSongInfoFromDWIFile( CString sPath ) CStringArray arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); float fIndex = atoi( arrayBPMChangeValues[0] ) * ELEMENTS_PER_BEAT / 4.0f; - float fBeat = StepIndexToBeat( fIndex ); + float fBeat = NoteIndexToBeat( fIndex ); float fNewBPM = (float)atoi( arrayBPMChangeValues[1] ); BPMSegment new_seg; @@ -528,9 +528,10 @@ bool Song::LoadSongInfoFromDWIFile( CString sPath ) else if( sValueName == "#SINGLE" || sValueName == "#DOUBLE" || sValueName == "#COUPLE" ) { - arraySteps.SetSize( arraySteps.GetSize()+1 ); - Steps &new_steps = arraySteps[ arraySteps.GetSize()-1 ]; - new_steps.LoadFromDWIValueTokens( arrayValueTokens ); + m_arrayPatterns.SetSize( m_arrayPatterns.GetSize()+1, 1 ); + Pattern &new_pattern = m_arrayPatterns[ m_arrayPatterns.GetSize()-1 ]; + new_pattern.LoadFromDWIValueTokens( arrayValueTokens ); + int ksjfk = 0; } else // do nothing. We don't care about this value name @@ -639,26 +640,26 @@ void Song::TidyUpData() } -void Song::GetStepsThatMatchGameMode( GameMode gm, CArray& arrayAddTo ) +void Song::GetPatternsThatMatchStyle( DanceStyle s, CArray& arrayAddTo ) { - for( int i=0; im_GameMode // if the current GameModes matches the Steps's GameMode - || (gm == MODE_VERSUS && pCurrentSteps->m_GameMode == MODE_SINGLE) ) + if( s == pCurPattern->m_DanceStyle // if the current GameModes matches the Pattern's GameMode + || (s == STYLE_VERSUS && pCurPattern->m_DanceStyle == STYLE_SINGLE) ) { - arrayAddTo.Add( pCurrentSteps ); + arrayAddTo.Add( pCurPattern ); } } } -void Song::GetNumFeet( GameMode gm, int& iDiffEasyOut, int& iDiffMediumOut, int& iDiffHardOut ) +void Song::GetNumFeet( DanceStyle s, int& iDiffEasyOut, int& iDiffMediumOut, int& iDiffHardOut ) { iDiffEasyOut = iDiffMediumOut = iDiffHardOut = -1; // -1 means not found - CArray arrayMatchingSteps; - GetStepsThatMatchGameMode( gm, arrayMatchingSteps ); + CArray arrayMatchingSteps; + GetPatternsThatMatchStyle( s, arrayMatchingSteps ); for( int i=0; im_DifficultyClass ) { - case Steps::CLASS_EASY: + case Pattern::CLASS_EASY: iDiffEasyOut = iNumFeet; break; - case Steps::CLASS_MEDIUM: + case Pattern::CLASS_MEDIUM: iDiffMediumOut = iNumFeet; break; - case Steps::CLASS_HARD: + case Pattern::CLASS_HARD: iDiffHardOut = iNumFeet; break; - case Steps::CLASS_OTHER: + case Pattern::CLASS_OTHER: // should do something intelligent to fill in the missing spots... if( iDiffEasyOut < 0 && iNumFeet <= 4 ) iDiffEasyOut = iNumFeet; @@ -697,14 +698,14 @@ void Song::SaveOffsetChangeToDisk() if( sExt == "bms" ) { - for( int i=0; iarraySteps.GetSize(); i++ ) + // Search for the corresponding Pattern pointer. + Pattern* pPattern = NULL; + for( i=0; im_arrayPatterns.GetSize(); i++ ) { - if( pSong->arraySteps[i].m_sDescription == szStepsName ) // match! + if( pSong->m_arrayPatterns[i].m_sDescription == szStepsName ) // match! { - pSteps = &pSong->arraySteps[i]; + pPattern = &pSong->m_arrayPatterns[i]; break; } } - if( pSteps == NULL ) // didn't find a match + if( pPattern == NULL ) // didn't find a match continue; // skip this entry - // Parse the Steps statistics. + // Parse the Pattern statistics. char szGradeLetters[10]; // longest possible string is "AAA" iRetVal = sscanf( value_string, "%d::%[^:]::%d::%d", - &pSteps->m_iNumTimesPlayed, + &pPattern->m_iNumTimesPlayed, szGradeLetters, - &pSteps->m_iTopScore, - &pSteps->m_iMaxCombo + &pPattern->m_iTopScore, + &pPattern->m_iMaxCombo ); if( iRetVal != 4 ) continue; - pSteps->m_TopGrade = StringToGrade( szGradeLetters ); + pPattern->m_TopGrade = StringToGrade( szGradeLetters ); } } } @@ -246,32 +246,28 @@ void SongManager::SaveStatisticsToDisk() { IniFile ini; ini.SetPath( g_sStatisticsFileName ); - if( !ini.ReadFile() ) { - return; // load nothing - //RageError( "could not read config file" ); - } // save song statistics for( int i=0; iarraySteps.GetSize(); j++ ) // for each Steps + for( int j=0; jm_arrayPatterns.GetSize(); j++ ) // for each Pattern { - Steps* pSteps = &pSong->arraySteps[j]; + Pattern* pPattern = &pSong->m_arrayPatterns[j]; - if( pSteps->m_TopGrade == GRADE_NO_DATA ) - continue; + if( pPattern->m_TopGrade == GRADE_NO_DATA ) + continue; // skip - // Each value has the format "SongName::StepsName=TimesPlayed::TopGrade::TopScore::MaxCombo". + // Each value has the format "SongName::PatternName=TimesPlayed::TopGrade::TopScore::MaxCombo". - CString sName = ssprintf( "%s::%s", pSong->GetTitle(), pSteps->m_sDescription ); + CString sName = ssprintf( "%s::%s", pSong->GetTitle(), pPattern->m_sDescription ); CString sValue = ssprintf( "%d::%s::%d::%d", - pSteps->m_iNumTimesPlayed, - GradeToString( pSteps->m_TopGrade ), - pSteps->m_iTopScore, - pSteps->m_iMaxCombo + pPattern->m_iNumTimesPlayed, + GradeToString( pPattern->m_TopGrade ), + pPattern->m_iTopScore, + pPattern->m_iMaxCombo ); ini.SetValue( "Statistics", sName, sValue ); @@ -282,7 +278,7 @@ void SongManager::SaveStatisticsToDisk() } -CString SongManager::GetBannerPathFromGroup( CString sGroupName ) +CString SongManager::GetGroupBannerPath( CString sGroupName ) { CString sPath; diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 87b0aab462..dce647b3b7 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -2,8 +2,8 @@ ----------------------------------------------------------------------------- Class: SongManager - Desc: Holder for all Songs and Steps. Also keeps track of the current - Song and Steps, and loads/saves statistics. + Desc: Holder for all Songs and Pattern. Also keeps track of the current + Song and Pattern, and loads/saves statistics. Copyright (c) 2001-2002 by the names listed below. All rights reserved. Chris Danford @@ -24,9 +24,10 @@ public: SongManager(); ~SongManager(); - CArray m_pSongs; Song* m_pCurSong; - Steps* m_pStepsPlayer[NUM_PLAYERS]; + Pattern* m_pCurPattern[NUM_PLAYERS]; + + CArray m_pSongs; // all songs that can be played void InitSongArrayFromDisk(); @@ -38,7 +39,7 @@ public: void SaveStatisticsToDisk(); - CString GetBannerPathFromGroup( CString sGroupName ); + CString GetGroupBannerPath( CString sGroupName ); protected: void LoadStepManiaSongDir( CString sDir ); @@ -48,7 +49,7 @@ protected: }; -extern SongManager* SONGS; // global and accessable from anywhere in our program +extern SongManager* SONG; // global and accessable from anywhere in our program #endif \ No newline at end of file diff --git a/stepmania/src/StepMania.ICO b/stepmania/src/StepMania.ICO index 2a574f29c9..57d3e633ff 100644 Binary files a/stepmania/src/StepMania.ICO and b/stepmania/src/StepMania.ICO differ diff --git a/stepmania/src/StepMania.RC b/stepmania/src/StepMania.RC index 0071035b22..612ae08a6b 100644 --- a/stepmania/src/StepMania.RC +++ b/stepmania/src/StepMania.RC @@ -124,71 +124,28 @@ END // Bitmap // -SPLASH BITMAP DISCARDABLE "splash.bmp" BITMAP_ERROR BITMAP DISCARDABLE "error.bmp" +BITMAP_SPLASH BITMAP DISCARDABLE "splash.bmp" ///////////////////////////////////////////////////////////////////////////// // // Dialog // -IDD_ERROR_DIALOG DIALOGEX 0, 0, 320, 202 -STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW +IDD_ERROR_DIALOG DIALOG DISCARDABLE 0, 0, 332, 234 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +CAPTION "StepMania Error" FONT 8, "MS Sans Serif" BEGIN - CONTROL "",IDC_SHOCKWAVEFLASH1, - "{D27CDB6E-AE6D-11CF-96B8-444553540000}",WS_TABSTOP,0,0, - 319,201 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_ERROR_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 313 - TOPMARGIN, 7 - BOTTOMMARGIN, 195 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_ERROR_DIALOG DLGINIT -BEGIN - IDC_SHOCKWAVEFLASH1, 0x376, 308, 0 -0x0000, 0x0000, 0x5567, 0x5566, 0x0300, 0x0000, 0x3182, 0x0000, 0x21cc, -0x0000, 0x0008, 0x004a, 0x0000, 0x0066, 0x0069, 0x006c, 0x0065, 0x003a, -0x002f, 0x002f, 0x002f, 0x0064, 0x003a, 0x005c, 0x0064, 0x0065, 0x0076, -0x005c, 0x0066, 0x006c, 0x0061, 0x0073, 0x0068, 0x0020, 0x0074, 0x0065, -0x0073, 0x0074, 0x005c, 0x0066, 0x0069, 0x0067, 0x0068, 0x0074, 0x0033, -0x002e, 0x0073, 0x0077, 0x0066, 0x0000, 0x0008, 0x004a, 0x0000, 0x0066, -0x0069, 0x006c, 0x0065, 0x003a, 0x002f, 0x002f, 0x002f, 0x0064, 0x003a, -0x005c, 0x0064, 0x0065, 0x0076, 0x005c, 0x0066, 0x006c, 0x0061, 0x0073, -0x0068, 0x0020, 0x0074, 0x0065, 0x0073, 0x0074, 0x005c, 0x0066, 0x0069, -0x0067, 0x0068, 0x0074, 0x0033, 0x002e, 0x0073, 0x0077, 0x0066, 0x0000, -0x0008, 0x000e, 0x0000, 0x0057, 0x0069, 0x006e, 0x0064, 0x006f, 0x0077, -0x0000, 0x000b, 0xffff, 0x000b, 0xffff, 0x0008, 0x000a, 0x0000, 0x0048, -0x0069, 0x0067, 0x0068, 0x0000, 0x0008, 0x0002, 0x0000, 0x0000, 0x000b, -0xffff, 0x0008, 0x0002, 0x0000, 0x0000, 0x0008, 0x0010, 0x0000, 0x0053, -0x0068, 0x006f, 0x0077, 0x0041, 0x006c, 0x006c, 0x0000, 0x000b, 0x0000, -0x000b, 0x0000, 0x0008, 0x0002, 0x0000, 0x0000, 0x0008, 0x0002, 0x0000, -0x0000, 0x0008, 0x000c, 0x0000, 0x0062, 0x0065, 0x006c, 0x006f, 0x0077, -0x0000, - 0 + EDITTEXT IDC_EDIT_ERROR,5,80,320,80,ES_CENTER | ES_MULTILINE | + ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP + DEFPUSHBUTTON "Close",IDOK,265,215,60,15 + CONTROL 129,IDC_STATIC,"Static",SS_BITMAP,0,0,258,37 + LTEXT "We're sorry. An error has occurred while running StepMania.\r\n\r\nMore specific details about the error may be listeted in the box below:", + IDC_STATIC,7,47,298,28 + PUSHBUTTON "Restart StepMania",IDC_BUTTON_RESTART,175,215,80,15 + PUSHBUTTON "Report the Error",IDC_BUTTON_REPORT,120,190,80,15 + PUSHBUTTON "View Log",IDC_BUTTON_VIEW_LOG,120,170,80,15 END #endif // English (U.S.) resources diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 301d42e56c..24dd95e6f4 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -24,6 +24,7 @@ #include "SongManager.h" #include "ThemeManager.h" #include "WindowManager.h" +#include "GameManager.h" #include "WindowSandbox.h" #include "WindowLoading.h" @@ -87,13 +88,16 @@ BOOL SwitchDisplayMode();// BOOL bWindowed, DWORD dwWidth, DWORD dwHeight, DWORD //----------------------------------------------------------------------------- int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) { - AfxEnableControlContainer(); + // Initialize ActiveX for Flash + //AfxEnableControlContainer(); #ifndef DEBUG // don't use error handler in Release mode try { #endif + // // Check to see if the app is already running. + // g_hMutex = CreateMutex( NULL, TRUE, g_sAppName ); if( GetLastError() == ERROR_ALREADY_EXISTS ) { @@ -101,7 +105,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) RageError( "StepMania is already running!" ); } + // // Make sure the current directory is the root program directory + // if( !DoesFileExist("Songs") ) { // change dir to path of the execuctable @@ -112,9 +118,13 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) LPSTR pLastBackslash = strrchr(szFullAppPath, '\\'); *pLastBackslash = '\0'; // terminate the string - SetCurrentDirectory(szFullAppPath); + RageLog( "Changing path to '%s'", szFullAppPath ); + SetCurrentDirectory( szFullAppPath ); } + + + CoInitialize (NULL); // Initialize COM @@ -144,7 +154,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) g_hWndMain = CreateWindow( g_sAppClassName,// pointer to registered class name g_sAppName, // pointer to window name - g_dwWindowStyle, // window style + g_dwWindowStyle, // window StyleDef CW_USEDEFAULT, // horizontal position of window CW_USEDEFAULT, // vertical position of window RECTWIDTH(rcWnd), // window width @@ -439,12 +449,12 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) //----------------------------------------------------------------------------- HRESULT CreateObjects( HWND hWnd ) { - //////////////////////////////// + // // Draw a splash bitmap so the user isn't looking at a black screen - //////////////////////////////// + // HBITMAP hSplashBitmap = (HBITMAP)LoadImage( GetModuleHandle( NULL ), - TEXT("SPLASH"), + TEXT("BITMAP_SPLASH"), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION ); BITMAP bmp; @@ -467,9 +477,9 @@ HRESULT CreateObjects( HWND hWnd ) - ///////////////////////////////// + // // Create game objects - ///////////////////////////////// + // srand( (unsigned)time(NULL) ); // seed number generator RageLogStart(); @@ -477,8 +487,8 @@ HRESULT CreateObjects( HWND hWnd ) MUSIC = new RageSoundStream; INPUT = new RageInput( hWnd ); PREFS = new PrefsManager; - SONGS = new SongManager; SCREEN = new RageScreen( hWnd ); + SONG = new SongManager; BringWindowToTop( hWnd ); SetForegroundWindow( hWnd ); @@ -489,12 +499,13 @@ HRESULT CreateObjects( HWND hWnd ) TM = new RageTextureManager( SCREEN ); THEME = new ThemeManager; WM = new WindowManager; + GAME = new GameManager; // Ugly... Switch the screen resolution again so that the system message will display SwitchDisplayMode(); - WM->SystemMessage( ssprintf("Found %d songs.", SONGS->m_pSongs.GetSize()) ); + WM->SystemMessage( ssprintf("Found %d songs.", SONG->m_pSongs.GetSize()) ); //WM->SetNewWindow( new WindowLoading ); @@ -520,7 +531,8 @@ void DestroyObjects() SAFE_DELETE( WM ); SAFE_DELETE( PREFS ); - SAFE_DELETE( SONGS ); + SAFE_DELETE( SONG ); + SAFE_DELETE( GAME ); SAFE_DELETE( INPUT ); SAFE_DELETE( MUSIC ); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index ee30566d05..79f9c14b65 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -388,6 +388,14 @@ SOURCE=.\GameConstants.h # End Source File # Begin Source File +SOURCE=.\GameManager.cpp +# End Source File +# Begin Source File + +SOURCE=.\GameManager.h +# End Source File +# Begin Source File + SOURCE=.\GameTypes.h # End Source File # Begin Source File @@ -404,6 +412,14 @@ SOURCE=.\PadInput.h # End Source File # Begin Source File +SOURCE=.\Pattern.cpp +# End Source File +# Begin Source File + +SOURCE=.\Pattern.h +# End Source File +# Begin Source File + SOURCE=.\Player.cpp # End Source File # Begin Source File @@ -456,19 +472,11 @@ SOURCE=.\SongManager.h # End Source File # Begin Source File -SOURCE=.\Steps.cpp +SOURCE=.\StyleDef.cpp # End Source File # Begin Source File -SOURCE=.\Steps.h -# End Source File -# Begin Source File - -SOURCE=.\Style.cpp -# End Source File -# Begin Source File - -SOURCE=.\Style.h +SOURCE=.\StyleDef.h # End Source File # Begin Source File diff --git a/stepmania/src/StyleDef.cpp b/stepmania/src/StyleDef.cpp new file mode 100644 index 0000000000..f10a8600f7 --- /dev/null +++ b/stepmania/src/StyleDef.cpp @@ -0,0 +1,14 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + File: StyleDef.cpp + + Desc: A data structure that holds the definition of a GameMode. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#include "StyleDef.h" + + diff --git a/stepmania/src/Style.h b/stepmania/src/StyleDef.h similarity index 68% rename from stepmania/src/Style.h rename to stepmania/src/StyleDef.h index 3665539478..88b8d8c232 100644 --- a/stepmania/src/Style.h +++ b/stepmania/src/StyleDef.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- - File: Style.h + File: StyleDef.h Desc: A data structure that holds the definition of a GameMode. @@ -11,33 +11,32 @@ #ifndef _Style_H_ #define _Style_H_ -#include "Steps.h" +#include "Pattern.h" const int MAX_NUM_COLUMNS = 12; -struct Style + +struct StyleDef { int m_iNumPlayers; int m_iNumColumns; // will vary depending on the number panels (4,6,8,etc) - TapStep m_ColumnToTapStep[MAX_NUM_COLUMNS]; + TapNote m_ColumnToTapNote[MAX_NUM_COLUMNS]; float m_ColumnToRotation[MAX_NUM_COLUMNS]; - int TapStepToColumnNumber( TapStep tap_step ) + inline int TapNoteToColumnNumber( TapNote tap_step ) { for (int i=0; i& arrayAddTo ); - void GetNumFeet( GameMode gm, int& iDiffEasy, int& iDiffMedium, int& iDiffHard ); + void GetPatternsThatMatchStyle( DanceStyle s, CArray& arrayAddTo ); + void GetNumFeet( DanceStyle s, int& iDiffEasy, int& iDiffMedium, int& iDiffHard ); int GetNumTimesPlayed() { int iTotalNumTimesPlayed = 0; - for( int i=0; i m_FreezeSegments; // this must be sorted before dancing public: - CArray arraySteps; + CArray m_arrayPatterns; }; diff --git a/stepmania/src/splash.bmp b/stepmania/src/splash.bmp index 772480280d..ce387761b1 100644 Binary files a/stepmania/src/splash.bmp and b/stepmania/src/splash.bmp differ