GetCurrentStyle()

This commit is contained in:
Glenn Maynard
2006-09-30 22:13:20 +00:00
parent cd8f1fc1c6
commit a8dd0c5fdc
12 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -572,7 +572,7 @@ float ArrowEffects::GetZoom( const PlayerState* pPlayerState )
{ {
float fZoom = 1.0f; float fZoom = 1.0f;
// FIXME: Move the zoom values into Style // FIXME: Move the zoom values into Style
if( GAMESTATE->m_pCurStyle->m_bNeedsZoomOutWith2Players && if( GAMESTATE->GetCurrentStyle()->m_bNeedsZoomOutWith2Players &&
(GAMESTATE->GetNumSidesJoined()==2 || GAMESTATE->AnyPlayersAreCpu()) ) (GAMESTATE->GetNumSidesJoined()==2 || GAMESTATE->AnyPlayersAreCpu()) )
fZoom *= 0.6f; fZoom *= 0.6f;
+1 -1
View File
@@ -117,7 +117,7 @@ bool BeginnerHelper::CanUse()
if( !DoesFileExist(GetAnimPath((Animation)i)) ) if( !DoesFileExist(GetAnimPath((Animation)i)) )
return false; return false;
return GAMESTATE->m_pCurStyle->m_bCanUseBeginnerHelper; return GAMESTATE->GetCurrentStyle()->m_bCanUseBeginnerHelper;
} }
bool BeginnerHelper::Initialize( int iDancePadType ) bool BeginnerHelper::Initialize( int iDancePadType )
+4 -4
View File
@@ -79,7 +79,7 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
{ {
if( m_pm != PlayMode_Invalid && GAMESTATE->m_PlayMode != m_pm ) if( m_pm != PlayMode_Invalid && GAMESTATE->m_PlayMode != m_pm )
return false; return false;
if( m_pStyle && GAMESTATE->m_pCurStyle.Get() != m_pStyle ) if( m_pStyle && GAMESTATE->GetCurrentStyle() != m_pStyle )
return false; return false;
// HACK: don't compare m_dc if m_pSteps is set. This causes problems // HACK: don't compare m_dc if m_pSteps is set. This causes problems
// in ScreenSelectOptionsMaster::ImportOptions if m_PreferredDifficulty // in ScreenSelectOptionsMaster::ImportOptions if m_PreferredDifficulty
@@ -255,7 +255,7 @@ void GameCommand::LoadOne( const Command& cmd )
if( !m_bInvalid ) if( !m_bInvalid )
{ {
Song *pSong = (m_pSong != NULL)? m_pSong:GAMESTATE->m_pCurSong; Song *pSong = (m_pSong != NULL)? m_pSong:GAMESTATE->m_pCurSong;
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->m_pCurStyle; const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle();
if( pSong == NULL || pStyle == NULL ) if( pSong == NULL || pStyle == NULL )
RageException::Throw( "Must set Song and Style to set Steps." ); RageException::Throw( "Must set Song and Style to set Steps." );
@@ -290,7 +290,7 @@ void GameCommand::LoadOne( const Command& cmd )
if( !m_bInvalid ) if( !m_bInvalid )
{ {
Course *pCourse = (m_pCourse != NULL)? m_pCourse:GAMESTATE->m_pCurCourse; Course *pCourse = (m_pCourse != NULL)? m_pCourse:GAMESTATE->m_pCurCourse;
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->m_pCurStyle; const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle();
if( pCourse == NULL || pStyle == NULL ) if( pCourse == NULL || pStyle == NULL )
RageException::Throw( "Must set Course and Style to set Steps." ); RageException::Throw( "Must set Course and Style to set Steps." );
@@ -511,7 +511,7 @@ bool GameCommand::IsPlayable( RString *why ) const
if( m_pm != PlayMode_Invalid || m_pStyle != NULL ) if( m_pm != PlayMode_Invalid || m_pStyle != NULL )
{ {
const PlayMode pm = (m_pm != PlayMode_Invalid) ? m_pm : GAMESTATE->m_PlayMode; const PlayMode pm = (m_pm != PlayMode_Invalid) ? m_pm : GAMESTATE->m_PlayMode;
const Style *style = (m_pStyle != NULL)? m_pStyle: GAMESTATE->m_pCurStyle; const Style *style = (m_pStyle != NULL)? m_pStyle: GAMESTATE->GetCurrentStyle();
if( !AreStyleAndPlayModeCompatible( style, pm ) ) if( !AreStyleAndPlayModeCompatible( style, pm ) )
{ {
if( why ) if( why )
+6 -6
View File
@@ -63,7 +63,7 @@ RString ModeSwitcher::GetStyleName()
RString sStyleName; RString sStyleName;
RString sDiff[NUM_PLAYERS]; RString sDiff[NUM_PLAYERS];
sStyleName = GAMESTATE->m_pCurStyle->m_szName; sStyleName = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName.MakeUpper(); sStyleName.MakeUpper();
FOREACH_PlayerNumber(i) FOREACH_PlayerNumber(i)
@@ -131,7 +131,7 @@ RString ModeSwitcher::GetNextStyleName()
{ {
if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_CHALLENGE) if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_CHALLENGE)
{ {
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName; sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper(); sStyleName[i].MakeUpper();
switch(GAMESTATE->m_PreferredDifficulty[i]) switch(GAMESTATE->m_PreferredDifficulty[i])
@@ -176,7 +176,7 @@ RString ModeSwitcher::GetNextStyleName()
} }
else else
{ {
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName; sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper(); sStyleName[i].MakeUpper();
sDiff[i] = "Beginner\n"; sDiff[i] = "Beginner\n";
@@ -204,7 +204,7 @@ RString ModeSwitcher::GetPrevStyleName()
{ {
if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_BEGINNER) if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_BEGINNER)
{ {
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName; sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper(); sStyleName[i].MakeUpper();
switch(GAMESTATE->m_PreferredDifficulty[i]) switch(GAMESTATE->m_PreferredDifficulty[i])
@@ -249,7 +249,7 @@ RString ModeSwitcher::GetPrevStyleName()
} }
else else
{ {
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName; sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper(); sStyleName[i].MakeUpper();
sDiff[i] = "Challenge\n"; sDiff[i] = "Challenge\n";
@@ -301,7 +301,7 @@ void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir)
ASSERT( !vPossibleStyles.empty() ); ASSERT( !vPossibleStyles.empty() );
int index = 0; int index = 0;
vector<const Style*>::const_iterator iter = find(vPossibleStyles.begin(), vPossibleStyles.end(), GAMESTATE->m_pCurStyle ); vector<const Style*>::const_iterator iter = find(vPossibleStyles.begin(), vPossibleStyles.end(), GAMESTATE->GetCurrentStyle() );
if( iter != vPossibleStyles.end() ) if( iter != vPossibleStyles.end() )
{ {
index = iter - vPossibleStyles.begin(); index = iter - vPossibleStyles.begin();
+4 -4
View File
@@ -874,7 +874,7 @@ void ScreenEdit::Update( float fDeltaTime )
{ {
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
{ {
GameInput GameI = GAMESTATE->m_pCurStyle->StyleInputToGameInput( t, PLAYER_1 ); GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, PLAYER_1 );
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI ); float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() ); fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() );
if( fSecsHeld == 0 ) if( fSecsHeld == 0 )
@@ -922,7 +922,7 @@ void ScreenEdit::Update( float fDeltaTime )
bool bButtonIsBeingPressed = false; bool bButtonIsBeingPressed = false;
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
{ {
GameInput GameI = GAMESTATE->m_pCurStyle->StyleInputToGameInput( t, PLAYER_1 ); GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, PLAYER_1 );
if( INPUTMAPPER->IsBeingPressed(GameI) ) if( INPUTMAPPER->IsBeingPressed(GameI) )
bButtonIsBeingPressed = true; bButtonIsBeingPressed = true;
} }
@@ -1910,7 +1910,7 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
if( input.pn != PLAYER_1 ) if( input.pn != PLAYER_1 )
return; // ignore return; // ignore
const int iCol = GAMESTATE->m_pCurStyle->GameInputToColumn( input.GameI ); const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
switch( input.type ) switch( input.type )
{ {
@@ -2064,7 +2064,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
return; return;
} }
const int iCol = GAMESTATE->m_pCurStyle->GameInputToColumn( input.GameI ); const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
if( PREFSMAN->m_AutoPlay != PC_HUMAN || iCol == -1 ) if( PREFSMAN->m_AutoPlay != PC_HUMAN || iCol == -1 )
return; return;
+3 -3
View File
@@ -399,7 +399,7 @@ void ScreenGameplay::Init( bool bUseSongBackgroundAndForeground )
PROFILEMAN->IncrementCoursePlayCount( GAMESTATE->m_pCurCourse, GAMESTATE->m_pCurTrail[p], p ); PROFILEMAN->IncrementCoursePlayCount( GAMESTATE->m_pCurCourse, GAMESTATE->m_pCurTrail[p], p );
STATSMAN->m_CurStageStats.playMode = GAMESTATE->m_PlayMode; STATSMAN->m_CurStageStats.playMode = GAMESTATE->m_PlayMode;
STATSMAN->m_CurStageStats.pStyle = GAMESTATE->m_pCurStyle; STATSMAN->m_CurStageStats.pStyle = GAMESTATE->GetCurrentStyle();
/* Record combo rollover. */ /* Record combo rollover. */
FOREACH_EnabledPlayerInfoNotDummy( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerInfoNotDummy( m_vPlayerInfo, pi )
@@ -2110,7 +2110,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
* However, if this is also a style button, don't do this. (pump center = start) * However, if this is also a style button, don't do this. (pump center = start)
*/ */
bool bHoldingGiveUp = false; bool bHoldingGiveUp = false;
if( GAMESTATE->m_pCurStyle->GameInputToColumn(input.GameI) == Column_INVALID ) if( GAMESTATE->GetCurrentStyle()->GameInputToColumn(input.GameI) == Column_INVALID )
{ {
bHoldingGiveUp |= ( START_GIVES_UP && input.MenuI == MENU_BUTTON_START ); bHoldingGiveUp |= ( START_GIVES_UP && input.MenuI == MENU_BUTTON_START );
bHoldingGiveUp |= ( BACK_GIVES_UP && input.MenuI == MENU_BUTTON_BACK ); bHoldingGiveUp |= ( BACK_GIVES_UP && input.MenuI == MENU_BUTTON_BACK );
@@ -2169,7 +2169,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
} }
bool bRelease = input.type == IET_RELEASE; bool bRelease = input.type == IET_RELEASE;
const int iCol = GAMESTATE->m_pCurStyle->GameInputToColumn( input.GameI ); const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
if( GAMESTATE->m_bMultiplayer ) if( GAMESTATE->m_bMultiplayer )
{ {
+1 -1
View File
@@ -15,7 +15,7 @@ ScreenGameplayLesson::ScreenGameplayLesson()
void ScreenGameplayLesson::Init() void ScreenGameplayLesson::Init()
{ {
ASSERT( GAMESTATE->m_pCurStyle ); ASSERT( GAMESTATE->GetCurrentStyle() );
ASSERT( GAMESTATE->m_pCurSong ); ASSERT( GAMESTATE->m_pCurSong );
/* Now that we've set up, init the base class. */ /* Now that we've set up, init the base class. */
+1 -1
View File
@@ -182,7 +182,7 @@ ScreenJukebox::ScreenJukebox()
void ScreenJukebox::Init() void ScreenJukebox::Init()
{ {
// ScreeJukeboxMenu must set this // ScreeJukeboxMenu must set this
ASSERT( GAMESTATE->m_pCurStyle ); ASSERT( GAMESTATE->GetCurrentStyle() );
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
SetSong(); SetSong();
+1 -1
View File
@@ -345,7 +345,7 @@ void ScreenNameEntry::Input( const InputEventPlus &input )
if( input.type != IET_FIRST_PRESS ) if( input.type != IET_FIRST_PRESS )
return; // ignore return; // ignore
const int iCol = GAMESTATE->m_pCurStyle->GameInputToColumn( input.GameI ); const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
if( iCol != Column_INVALID && m_bStillEnteringName[input.pn] ) if( iCol != Column_INVALID && m_bStillEnteringName[input.pn] )
{ {
int iStringIndex = m_ColToStringIndex[input.pn][iCol]; int iStringIndex = m_ColToStringIndex[input.pn][iCol];
+1 -1
View File
@@ -146,7 +146,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional()
{ {
ss.vpPlayedSongs.push_back( SONGMAN->GetRandomSong() ); ss.vpPlayedSongs.push_back( SONGMAN->GetRandomSong() );
ss.vpPossibleSongs = ss.vpPlayedSongs; ss.vpPossibleSongs = ss.vpPlayedSongs;
ss.pStyle = GAMESTATE->m_pCurStyle; ss.pStyle = GAMESTATE->GetCurrentStyle();
ss.playMode = GAMESTATE->m_PlayMode; ss.playMode = GAMESTATE->m_PlayMode;
ASSERT( ss.vpPlayedSongs[0]->GetAllSteps().size() ); ASSERT( ss.vpPlayedSongs[0]->GetAllSteps().size() );
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
+1 -1
View File
@@ -99,7 +99,7 @@ void ScreenSelectMusic::Init()
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","mode")) ); m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","mode")) );
} }
if( GAMESTATE->m_pCurStyle == NULL ) if( GAMESTATE->GetCurrentStyle() == NULL )
RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." ); RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." );
if( GAMESTATE->m_PlayMode == PlayMode_Invalid ) if( GAMESTATE->m_PlayMode == PlayMode_Invalid )
+2 -2
View File
@@ -47,7 +47,7 @@ void ScreenWithMenuElements::Init()
SET_XY( m_autoHeader ); SET_XY( m_autoHeader );
this->AddChild( m_autoHeader ); this->AddChild( m_autoHeader );
if( STYLE_ICON && GAMESTATE->m_pCurStyle ) if( STYLE_ICON && GAMESTATE->GetCurrentStyle() )
{ {
m_sprStyleIcon.SetName( "StyleIcon" ); m_sprStyleIcon.SetName( "StyleIcon" );
m_sprStyleIcon.Load( THEME->GetPathG("MenuElements",RString("icon ")+GAMESTATE->GetCurrentStyle()->m_szName) ); m_sprStyleIcon.Load( THEME->GetPathG("MenuElements",RString("icon ")+GAMESTATE->GetCurrentStyle()->m_szName) );
@@ -57,7 +57,7 @@ void ScreenWithMenuElements::Init()
this->AddChild( &m_sprStyleIcon ); this->AddChild( &m_sprStyleIcon );
} }
if( SHOW_STAGE && GAMESTATE->m_pCurStyle ) if( SHOW_STAGE && GAMESTATE->GetCurrentStyle() )
{ {
m_sprStage.Load( THEME->GetPathG(m_sName,"stage") ); m_sprStage.Load( THEME->GetPathG(m_sName,"stage") );
m_sprStage->SetName( "Stage" ); m_sprStage->SetName( "Stage" );