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;
// FIXME: Move the zoom values into Style
if( GAMESTATE->m_pCurStyle->m_bNeedsZoomOutWith2Players &&
if( GAMESTATE->GetCurrentStyle()->m_bNeedsZoomOutWith2Players &&
(GAMESTATE->GetNumSidesJoined()==2 || GAMESTATE->AnyPlayersAreCpu()) )
fZoom *= 0.6f;
+1 -1
View File
@@ -117,7 +117,7 @@ bool BeginnerHelper::CanUse()
if( !DoesFileExist(GetAnimPath((Animation)i)) )
return false;
return GAMESTATE->m_pCurStyle->m_bCanUseBeginnerHelper;
return GAMESTATE->GetCurrentStyle()->m_bCanUseBeginnerHelper;
}
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 )
return false;
if( m_pStyle && GAMESTATE->m_pCurStyle.Get() != m_pStyle )
if( m_pStyle && GAMESTATE->GetCurrentStyle() != m_pStyle )
return false;
// HACK: don't compare m_dc if m_pSteps is set. This causes problems
// in ScreenSelectOptionsMaster::ImportOptions if m_PreferredDifficulty
@@ -255,7 +255,7 @@ void GameCommand::LoadOne( const Command& cmd )
if( !m_bInvalid )
{
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 )
RageException::Throw( "Must set Song and Style to set Steps." );
@@ -290,7 +290,7 @@ void GameCommand::LoadOne( const Command& cmd )
if( !m_bInvalid )
{
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 )
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 )
{
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( why )
+6 -6
View File
@@ -63,7 +63,7 @@ RString ModeSwitcher::GetStyleName()
RString sStyleName;
RString sDiff[NUM_PLAYERS];
sStyleName = GAMESTATE->m_pCurStyle->m_szName;
sStyleName = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName.MakeUpper();
FOREACH_PlayerNumber(i)
@@ -131,7 +131,7 @@ RString ModeSwitcher::GetNextStyleName()
{
if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_CHALLENGE)
{
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName;
sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper();
switch(GAMESTATE->m_PreferredDifficulty[i])
@@ -176,7 +176,7 @@ RString ModeSwitcher::GetNextStyleName()
}
else
{
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName;
sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper();
sDiff[i] = "Beginner\n";
@@ -204,7 +204,7 @@ RString ModeSwitcher::GetPrevStyleName()
{
if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_BEGINNER)
{
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName;
sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper();
switch(GAMESTATE->m_PreferredDifficulty[i])
@@ -249,7 +249,7 @@ RString ModeSwitcher::GetPrevStyleName()
}
else
{
sStyleName[i] = GAMESTATE->m_pCurStyle->m_szName;
sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper();
sDiff[i] = "Challenge\n";
@@ -301,7 +301,7 @@ void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir)
ASSERT( !vPossibleStyles.empty() );
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() )
{
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
{
GameInput GameI = GAMESTATE->m_pCurStyle->StyleInputToGameInput( t, PLAYER_1 );
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, PLAYER_1 );
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() );
if( fSecsHeld == 0 )
@@ -922,7 +922,7 @@ void ScreenEdit::Update( float fDeltaTime )
bool bButtonIsBeingPressed = false;
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) )
bButtonIsBeingPressed = true;
}
@@ -1910,7 +1910,7 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
if( input.pn != PLAYER_1 )
return; // ignore
const int iCol = GAMESTATE->m_pCurStyle->GameInputToColumn( input.GameI );
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
switch( input.type )
{
@@ -2064,7 +2064,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
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 )
return;
+3 -3
View File
@@ -399,7 +399,7 @@ void ScreenGameplay::Init( bool bUseSongBackgroundAndForeground )
PROFILEMAN->IncrementCoursePlayCount( GAMESTATE->m_pCurCourse, GAMESTATE->m_pCurTrail[p], p );
STATSMAN->m_CurStageStats.playMode = GAMESTATE->m_PlayMode;
STATSMAN->m_CurStageStats.pStyle = GAMESTATE->m_pCurStyle;
STATSMAN->m_CurStageStats.pStyle = GAMESTATE->GetCurrentStyle();
/* Record combo rollover. */
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)
*/
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 |= ( BACK_GIVES_UP && input.MenuI == MENU_BUTTON_BACK );
@@ -2169,7 +2169,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
}
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 )
{
+1 -1
View File
@@ -15,7 +15,7 @@ ScreenGameplayLesson::ScreenGameplayLesson()
void ScreenGameplayLesson::Init()
{
ASSERT( GAMESTATE->m_pCurStyle );
ASSERT( GAMESTATE->GetCurrentStyle() );
ASSERT( GAMESTATE->m_pCurSong );
/* Now that we've set up, init the base class. */
+1 -1
View File
@@ -182,7 +182,7 @@ ScreenJukebox::ScreenJukebox()
void ScreenJukebox::Init()
{
// ScreeJukeboxMenu must set this
ASSERT( GAMESTATE->m_pCurStyle );
ASSERT( GAMESTATE->GetCurrentStyle() );
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
SetSong();
+1 -1
View File
@@ -345,7 +345,7 @@ void ScreenNameEntry::Input( const InputEventPlus &input )
if( input.type != IET_FIRST_PRESS )
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] )
{
int iStringIndex = m_ColToStringIndex[input.pn][iCol];
+1 -1
View File
@@ -146,7 +146,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional()
{
ss.vpPlayedSongs.push_back( SONGMAN->GetRandomSong() );
ss.vpPossibleSongs = ss.vpPlayedSongs;
ss.pStyle = GAMESTATE->m_pCurStyle;
ss.pStyle = GAMESTATE->GetCurrentStyle();
ss.playMode = GAMESTATE->m_PlayMode;
ASSERT( ss.vpPlayedSongs[0]->GetAllSteps().size() );
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")) );
}
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." );
if( GAMESTATE->m_PlayMode == PlayMode_Invalid )
+2 -2
View File
@@ -47,7 +47,7 @@ void ScreenWithMenuElements::Init()
SET_XY( m_autoHeader );
this->AddChild( m_autoHeader );
if( STYLE_ICON && GAMESTATE->m_pCurStyle )
if( STYLE_ICON && GAMESTATE->GetCurrentStyle() )
{
m_sprStyleIcon.SetName( "StyleIcon" );
m_sprStyleIcon.Load( THEME->GetPathG("MenuElements",RString("icon ")+GAMESTATE->GetCurrentStyle()->m_szName) );
@@ -57,7 +57,7 @@ void ScreenWithMenuElements::Init()
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->SetName( "Stage" );