diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index a499e9c5d6..2e8d82bb32 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -120,8 +120,11 @@ PlayerStageStats.cpp PlayerStageStats.h \ PlayerState.cpp PlayerState.h Preference.cpp Preference.h Profile.cpp Profile.h \ RandomSample.cpp RandomSample.h RadarValues.cpp RadarValues.h \ ScreenDimensions.h ScreenDimensions.cpp \ -ScoreKeeper.h ScoreKeeper.cpp ScoreKeeperNormal.cpp ScoreKeeperNormal.h \ -ScoreKeeperRave.cpp ScoreKeeperRave.h Song.cpp song.h SongCacheIndex.cpp SongCacheIndex.h \ +ScoreKeeper.h ScoreKeeper.cpp \ +ScoreKeeperGuitar.cpp ScoreKeeperGuitar.h \ +ScoreKeeperNormal.cpp ScoreKeeperNormal.h \ +ScoreKeeperRave.cpp ScoreKeeperRave.h \ +Song.cpp song.h SongCacheIndex.cpp SongCacheIndex.h \ SongOptions.cpp SongOptions.h SongUtil.cpp SongUtil.h StageStats.cpp StageStats.h Steps.cpp Steps.h \ StepsUtil.cpp StepsUtil.h Style.cpp Style.h StyleUtil.cpp StyleUtil.h \ SubscriptionManager.h \ diff --git a/stepmania/src/ScoreKeeper.cpp b/stepmania/src/ScoreKeeper.cpp index 63e3949cd4..e1c912586c 100644 --- a/stepmania/src/ScoreKeeper.cpp +++ b/stepmania/src/ScoreKeeper.cpp @@ -30,6 +30,19 @@ void ScoreKeeper::GetScoreOfLastTapInRow( const NoteData &nd, int iRow, iNumTapsInRowOut = iNum; } +#include "ScoreKeeperNormal.h" +#include "ScoreKeeperGuitar.h" + +ScoreKeeper* ScoreKeeper::MakeScoreKeeper( RString sClassName, PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ) +{ + if( sClassName == "ScoreKeeperNormal" ) + return new ScoreKeeperNormal( pPlayerState, pPlayerStageStats ); + else if( sClassName == "ScoreKeeperGuitar" ) + return new ScoreKeeperGuitar( pPlayerState, pPlayerStageStats ); + FAIL_M( sClassName ); +} + + /* * (c) 2006 Steve Checkoway * All rights reserved. diff --git a/stepmania/src/ScoreKeeper.h b/stepmania/src/ScoreKeeper.h index d2a775acdb..c8aeffa1df 100644 --- a/stepmania/src/ScoreKeeper.h +++ b/stepmania/src/ScoreKeeper.h @@ -24,6 +24,9 @@ struct AttackArray; class ScoreKeeper { +public: + static ScoreKeeper* MakeScoreKeeper( RString sClassName, PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ); + protected: PlayerState *m_pPlayerState; PlayerStageStats *m_pPlayerStageStats; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 97d9950d74..06c9108e1a 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -68,6 +68,7 @@ static ThemeMetric INITIAL_BACKGROUND_BRIGHTNESS ("ScreenGameplay","InitialBackgroundBrightness"); static ThemeMetric SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments"); +static ThemeMetric SCORE_KEEPER_CLASS ("ScreenGameplay","ScoreKeeperClass"); AutoScreenMessage( SM_PlayGo ) @@ -164,7 +165,7 @@ void PlayerInfo::Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField ) if( m_pSecondaryScoreDisplay ) m_pSecondaryScoreDisplay->Init( pPlayerState, pPlayerStageStats ); - m_pPrimaryScoreKeeper = new ScoreKeeperNormal( pPlayerState, pPlayerStageStats ); + m_pPrimaryScoreKeeper = ScoreKeeper::MakeScoreKeeper( SCORE_KEEPER_CLASS, pPlayerState, pPlayerStageStats ); switch( GAMESTATE->m_PlayMode ) { diff --git a/stepmania/src/StepMania-net2003.vcproj b/stepmania/src/StepMania-net2003.vcproj index 3333e4feac..e2c9124707 100644 --- a/stepmania/src/StepMania-net2003.vcproj +++ b/stepmania/src/StepMania-net2003.vcproj @@ -1091,6 +1091,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + +