[default -> loading window] YAM

This commit is contained in:
Henrik Andersson
2011-06-07 12:26:46 +02:00
56 changed files with 140 additions and 188 deletions
+11
View File
@@ -8,6 +8,17 @@ ________________________________________________________________________________
StepMania 5.0 Preview 2 | 20110??? StepMania 5.0 Preview 2 | 20110???
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
2011/06/06
----------
* [PlayerOptions] Removed the ScoreDisplay mod choices. Use lua to make your
own scoring formulas that work in reverse instead. [Wolfman2000]
* [ScreenGameplay] Fix an assist tick bug if there was no Player 1. Note that
this changes the behavior slightly: it is the first enabled player, or
master player, that gets the ticks now. A better solution will be looked at
in the future. [Wolfman2000]
* [NoteDataUtil] Fix a radar issue involving hands. Unfortunately, this means
yet another cache reload for accuracy purposes. [Wolfman2000]
2011/06/04 2011/06/04
---------- ----------
* Changed default MusicWheelSwitchSpeed to 15 (was 10). [AJ] * Changed default MusicWheelSwitchSpeed to 15 (was 10). [AJ]
+1 -5
View File
@@ -33,11 +33,7 @@ end
Branch = { Branch = {
Init = function() Init = function()
if GAMESTATE:GetCoinMode() == 'CoinMode_Home' then return "ScreenInit"
return "ScreenInit"
else
return "ScreenInit"
end
end, end,
AfterInit = function() AfterInit = function()
if GAMESTATE:GetCoinMode() == 'CoinMode_Home' then if GAMESTATE:GetCoinMode() == 'CoinMode_Home' then
@@ -224,10 +224,10 @@ end;
--[[ ----------------------------------------------------------------------- ]] --[[ ----------------------------------------------------------------------- ]]
--[[ profile stuff ]] --[[ profile stuff ]]
-- Profile(pn) -- GetPlayerOrMachineProfile(pn)
-- This returns a profile, preferably a player one. -- This returns a profile, preferably a player one.
-- If there isn't one, we fall back on the machine profile. -- If there isn't one, we fall back on the machine profile.
function Profile(pn) function GetPlayerOrMachineProfile(pn)
if PROFILEMAN:IsPersistentProfile(pn) then if PROFILEMAN:IsPersistentProfile(pn) then
-- player profile -- player profile
return PROFILEMAN:GetProfile(pn); return PROFILEMAN:GetProfile(pn);
+2 -3
View File
@@ -2510,8 +2510,8 @@ CursorOnCommand=visible,false
Class="ScreenOptionsMaster" Class="ScreenOptionsMaster"
Fallback="ScreenOptionsSimpleService" Fallback="ScreenOptionsSimpleService"
# #
NextScreen=Branch.Init() NextScreen=Branch.AfterInit()
PrevScreen=Branch.Init() PrevScreen=Branch.AfterInit()
LineNames="SystemDirection,KeyConfig,GameType,6,8,Reload,Credits,MoreOptions" LineNames="SystemDirection,KeyConfig,GameType,6,8,Reload,Credits,MoreOptions"
# LineNames="SystemDirection,1,2,Sync,13,3,10,11,4,12,6,5,Theme,8,9" # LineNames="SystemDirection,1,2,Sync,13,3,10,11,4,12,6,5,Theme,8,9"
@@ -2884,7 +2884,6 @@ Line11="list,Attacks"
Line12="list,PlayerAutoPlay" Line12="list,PlayerAutoPlay"
Line13="list,Hide" Line13="list,Hide"
Line14="list,Persp" Line14="list,Persp"
Line15="list,ScoreDisplay"
Line16="list,Steps" Line16="list,Steps"
Line17="list,Characters" Line17="list,Characters"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

@@ -3,21 +3,6 @@
-- this file are in metrics.ini ([ScreenTitleMenu] ShowLogo, etc.) -- this file are in metrics.ini ([ScreenTitleMenu] ShowLogo, etc.)
local t = Def.ActorFrame{ -- [BGAnimation] local t = Def.ActorFrame{ -- [BGAnimation]
LoadActor("_logo"); -- [Layer1] Type=0 File=_ball.png LoadActor("_logo"); -- [Layer1] Type=0 File=_ball.png
LoadActor("_logo")..{ -- [Layer2] Type=0 File=_ball.png
};
--[[LoadActor("_text")..{ -- [Layer3] Type=0 File=_text.png
InitCommand=cmd(y,48;hide_if,GAMESTATE:GetMultiplayer()); -- Command=y,48
};
LoadActor("_multi")..{ -- [Layer4] Type=0 File=_multi.png
InitCommand=cmd(y,60;hide_if,not GAMESTATE:GetMultiplayer()); -- Command=y,48
-- the hide_if command would be similar to Condition=, which also exists.
-- Condition=GAMESTATE:GetMultiplayer(); is the equivalent code.
};]]
LoadFont("Common normal")..{
Text="sm-ssc Multiplayer";
InitCommand=cmd(y,5;shadowlength,0;strokecolor,color("0,0,0,0.375");diffusebottomedge,color("#D6DBDD"););
BeginCommand=cmd(hide_if,not GAMESTATE:GetMultiplayer());
};
}; };
return t; return t;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 295 B

+2 -2
View File
@@ -1216,7 +1216,7 @@ ItemsLongRowSharedX=SCREEN_CENTER_X
[ScreenTestInput] [ScreenTestInput]
[ScreenOptionsSystemDirection] [ScreenOptionsSystemDirection]
LineNames="1,2,3,4,5,6,7,8,9,FlashyCombo,RollCombo,10,11,12,13,14,15,16,LF,17,18,19,20,21,22" LineNames="1,2,3,4,5,6,7,8,9,FlashyCombo,RollCombo,10,11,12,13,14,16,LF,17,18,19,20,21,22"
LineLF="lua,UserPrefLongFail()" LineLF="lua,UserPrefLongFail()"
LineRollCombo="lua,UserPrefComboOnRolls()" LineRollCombo="lua,UserPrefComboOnRolls()"
LineFlashyCombo="lua,UserPrefFlashyCombo()" LineFlashyCombo="lua,UserPrefFlashyCombo()"
@@ -1224,7 +1224,7 @@ LineFlashyCombo="lua,UserPrefFlashyCombo()"
[ScreenOptionsGraphicsSound] [ScreenOptionsGraphicsSound]
[ScreenOptionsAdvanced] [ScreenOptionsAdvanced]
LineNames="Score,3,4,8,11,13,14,15,16,28,29,30,RollCombo" LineNames="Score,3,4,8,11,13,14,16,28,29,30,RollCombo"
LineRollCombo="lua,UserPrefComboOnRolls()" LineRollCombo="lua,UserPrefComboOnRolls()"
[ScreenAppearanceOptions] [ScreenAppearanceOptions]
+2 -2
View File
@@ -49,7 +49,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
* Add all current autoplay sounds in both players to the chain. If a sound is * Add all current autoplay sounds in both players to the chain. If a sound is
* common to both players, don't pan it; otherwise pan it to that player's side. * common to both players, don't pan it; otherwise pan it to that player's side.
*/ */
int iNumTracks = m_ndAutoKeysoundsOnly[GAMESTATE->m_MasterPlayerNumber].GetNumTracks(); int iNumTracks = m_ndAutoKeysoundsOnly[GAMESTATE->GetMasterPlayerNumber()].GetNumTracks();
for( int t = 0; t < iNumTracks; t++ ) for( int t = 0; t < iNumTracks; t++ )
{ {
int iRow = -1; int iRow = -1;
@@ -297,7 +297,7 @@ void AutoKeysounds::FinishLoading()
apSounds.push_back( m_pPlayerSounds[1] ); apSounds.push_back( m_pPlayerSounds[1] );
} }
if( GAMESTATE->GetNumPlayersEnabled() == 1 && GAMESTATE->m_MasterPlayerNumber == PLAYER_2 ) if( GAMESTATE->GetNumPlayersEnabled() == 1 && GAMESTATE->GetMasterPlayerNumber() == PLAYER_2 )
swap( m_pPlayerSounds[PLAYER_1], m_pPlayerSounds[PLAYER_2] ); swap( m_pPlayerSounds[PLAYER_1], m_pPlayerSounds[PLAYER_2] );
if( apSounds.size() > 1 ) if( apSounds.size() > 1 )
+2 -2
View File
@@ -42,9 +42,9 @@ void CourseContentsList::SetFromGameState()
{ {
RemoveAllChildren(); RemoveAllChildren();
if( GAMESTATE->m_MasterPlayerNumber == PlayerNumber_Invalid ) if( GAMESTATE->GetMasterPlayerNumber() == PlayerNumber_Invalid )
return; return;
const Trail *pMasterTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber]; const Trail *pMasterTrail = GAMESTATE->m_pCurTrail[GAMESTATE->GetMasterPlayerNumber()];
if( pMasterTrail == NULL ) if( pMasterTrail == NULL )
return; return;
unsigned uNumEntriesToShow = pMasterTrail->m_vEntries.size(); unsigned uNumEntriesToShow = pMasterTrail->m_vEntries.size();
+30 -20
View File
@@ -190,6 +190,16 @@ GameState::~GameState()
SAFE_DELETE( g_pImpl ); SAFE_DELETE( g_pImpl );
} }
PlayerNumber GameState::GetMasterPlayerNumber() const
{
return this->masterPlayerNumber;
}
void GameState::SetMasterPlayerNumber(const PlayerNumber p)
{
this->masterPlayerNumber = p;
}
void GameState::ApplyGameCommand( const RString &sCommand, PlayerNumber pn ) void GameState::ApplyGameCommand( const RString &sCommand, PlayerNumber pn )
{ {
GameCommand m; GameCommand m;
@@ -244,7 +254,7 @@ void GameState::ResetPlayer( PlayerNumber pn )
void GameState::Reset() void GameState::Reset()
{ {
m_MasterPlayerNumber = PLAYER_INVALID; // must initialize for UnjoinPlayer this->SetMasterPlayerNumber(PLAYER_INVALID); // must initialize for UnjoinPlayer
FOREACH_PlayerNumber( pn ) FOREACH_PlayerNumber( pn )
UnjoinPlayer( pn ); UnjoinPlayer( pn );
@@ -334,14 +344,14 @@ void GameState::JoinPlayer( PlayerNumber pn )
* give the new player the same number of stage tokens that the old player * give the new player the same number of stage tokens that the old player
* has. */ * has. */
if( GetCoinMode() == CoinMode_Pay && GetPremium() == Premium_2PlayersFor1Credit && GetNumSidesJoined() == 1 ) if( GetCoinMode() == CoinMode_Pay && GetPremium() == Premium_2PlayersFor1Credit && GetNumSidesJoined() == 1 )
m_iPlayerStageTokens[pn] = m_iPlayerStageTokens[m_MasterPlayerNumber]; m_iPlayerStageTokens[pn] = m_iPlayerStageTokens[this->GetMasterPlayerNumber()];
else else
m_iPlayerStageTokens[pn] = PREFSMAN->m_iSongsPerPlay; m_iPlayerStageTokens[pn] = PREFSMAN->m_iSongsPerPlay;
m_bSideIsJoined[pn] = true; m_bSideIsJoined[pn] = true;
if( m_MasterPlayerNumber == PLAYER_INVALID ) if( this->GetMasterPlayerNumber() == PLAYER_INVALID )
m_MasterPlayerNumber = pn; this->SetMasterPlayerNumber(pn);
// if first player to join, set start time // if first player to join, set start time
if( GetNumSidesJoined() == 1 ) if( GetNumSidesJoined() == 1 )
@@ -385,8 +395,8 @@ void GameState::UnjoinPlayer( PlayerNumber pn )
ResetPlayer( pn ); ResetPlayer( pn );
if( m_MasterPlayerNumber == pn ) if( this->GetMasterPlayerNumber() == pn )
m_MasterPlayerNumber = GetFirstHumanPlayer(); this->SetMasterPlayerNumber(GetFirstHumanPlayer());
/* Unjoin STATSMAN first, so steps used by this player are released /* Unjoin STATSMAN first, so steps used by this player are released
* and can be released by PROFILEMAN. */ * and can be released by PROFILEMAN. */
@@ -398,7 +408,7 @@ void GameState::UnjoinPlayer( PlayerNumber pn )
MESSAGEMAN->Broadcast( msg ); MESSAGEMAN->Broadcast( msg );
// If there are no players left, reset some non-player-specific stuff, too. // If there are no players left, reset some non-player-specific stuff, too.
if( m_MasterPlayerNumber == PLAYER_INVALID ) if( this->GetMasterPlayerNumber() == PLAYER_INVALID )
{ {
SongOptions so; SongOptions so;
GetDefaultSongOptions( so ); GetDefaultSongOptions( so );
@@ -635,8 +645,8 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
if( pStyle == NULL ) if( pStyle == NULL )
{ {
const Steps *pSteps = NULL; const Steps *pSteps = NULL;
if( m_MasterPlayerNumber != PlayerNumber_Invalid ) if( this->GetMasterPlayerNumber() != PlayerNumber_Invalid )
pSteps = m_pCurSteps[m_MasterPlayerNumber]; pSteps = m_pCurSteps[this->GetMasterPlayerNumber()];
// Don't call GetFirstCompatibleStyle if numSidesJoined == 0. // Don't call GetFirstCompatibleStyle if numSidesJoined == 0.
// This happens because on SContinue when players are unjoined, // This happens because on SContinue when players are unjoined,
// pCurSteps will still be set while no players are joined. -Chris // pCurSteps will still be set while no players are joined. -Chris
@@ -994,9 +1004,9 @@ bool GameState::IsFinalStageForAnyHumanPlayer() const
bool GameState::IsAnExtraStage() const bool GameState::IsAnExtraStage() const
{ {
if( m_MasterPlayerNumber == PlayerNumber_Invalid ) if( this->GetMasterPlayerNumber() == PlayerNumber_Invalid )
return false; return false;
return !IsEventMode() && !IsCourseMode() && m_iAwardedExtraStages[m_MasterPlayerNumber] > 0; return !IsEventMode() && !IsCourseMode() && m_iAwardedExtraStages[this->GetMasterPlayerNumber()] > 0;
} }
static ThemeMetric<bool> LOCK_EXTRA_STAGE_SELECTION("GameState","LockExtraStageSelection"); static ThemeMetric<bool> LOCK_EXTRA_STAGE_SELECTION("GameState","LockExtraStageSelection");
@@ -1007,16 +1017,16 @@ bool GameState::IsAnExtraStageAndSelectionLocked() const
bool GameState::IsExtraStage() const bool GameState::IsExtraStage() const
{ {
if( m_MasterPlayerNumber == PlayerNumber_Invalid ) if( this->GetMasterPlayerNumber() == PlayerNumber_Invalid )
return false; return false;
return !IsEventMode() && !IsCourseMode() && m_iAwardedExtraStages[m_MasterPlayerNumber] == 1; return !IsEventMode() && !IsCourseMode() && m_iAwardedExtraStages[this->GetMasterPlayerNumber()] == 1;
} }
bool GameState::IsExtraStage2() const bool GameState::IsExtraStage2() const
{ {
if( m_MasterPlayerNumber == PlayerNumber_Invalid ) if( this->GetMasterPlayerNumber() == PlayerNumber_Invalid )
return false; return false;
return !IsEventMode() && !IsCourseMode() && m_iAwardedExtraStages[m_MasterPlayerNumber] == 2; return !IsEventMode() && !IsCourseMode() && m_iAwardedExtraStages[this->GetMasterPlayerNumber()] == 2;
} }
Stage GameState::GetCurrentStage() const Stage GameState::GetCurrentStage() const
@@ -1059,7 +1069,7 @@ int GameState::GetCourseSongIndex() const
} }
else else
{ {
return STATSMAN->m_CurStageStats.m_player[m_MasterPlayerNumber].m_iSongsPlayed-1; return STATSMAN->m_CurStageStats.m_player[this->GetMasterPlayerNumber()].m_iSongsPlayed-1;
} }
} }
@@ -1131,7 +1141,7 @@ void GameState::SetCurrentStyle( const Style *pStyle )
if( INPUTMAPPER ) if( INPUTMAPPER )
{ {
if( GetCurrentStyle() && GetCurrentStyle()->m_StyleType == StyleType_OnePlayerTwoSides ) if( GetCurrentStyle() && GetCurrentStyle()->m_StyleType == StyleType_OnePlayerTwoSides )
INPUTMAPPER->SetJoinControllers( m_MasterPlayerNumber ); INPUTMAPPER->SetJoinControllers( this->GetMasterPlayerNumber() );
else else
INPUTMAPPER->SetJoinControllers( PLAYER_INVALID ); INPUTMAPPER->SetJoinControllers( PLAYER_INVALID );
} }
@@ -1192,7 +1202,7 @@ bool GameState::IsHumanPlayer( PlayerNumber pn ) const
return true; return true;
case StyleType_OnePlayerOneSide: case StyleType_OnePlayerOneSide:
case StyleType_OnePlayerTwoSides: case StyleType_OnePlayerTwoSides:
return pn == m_MasterPlayerNumber; return pn == this->GetMasterPlayerNumber();
default: default:
ASSERT(0); // invalid style type ASSERT(0); // invalid style type
return false; return false;
@@ -1276,7 +1286,7 @@ EarnedExtraStage GameState::CalculateEarnedExtraStage() const
if( GetSmallestNumStagesLeftForAnyHumanPlayer() > 0 ) if( GetSmallestNumStagesLeftForAnyHumanPlayer() > 0 )
return EarnedExtraStage_No; return EarnedExtraStage_No;
if( m_iAwardedExtraStages[m_MasterPlayerNumber] >= 2 ) if( m_iAwardedExtraStages[this->GetMasterPlayerNumber()] >= 2 )
return EarnedExtraStage_No; return EarnedExtraStage_No;
FOREACH_EnabledPlayer( pn ) FOREACH_EnabledPlayer( pn )
@@ -2124,7 +2134,7 @@ public:
DEFINE_METHOD( IsPlayerEnabled, IsPlayerEnabled(Enum::Check<PlayerNumber>(L, 1)) ) DEFINE_METHOD( IsPlayerEnabled, IsPlayerEnabled(Enum::Check<PlayerNumber>(L, 1)) )
DEFINE_METHOD( IsHumanPlayer, IsHumanPlayer(Enum::Check<PlayerNumber>(L, 1)) ) DEFINE_METHOD( IsHumanPlayer, IsHumanPlayer(Enum::Check<PlayerNumber>(L, 1)) )
DEFINE_METHOD( GetPlayerDisplayName, GetPlayerDisplayName(Enum::Check<PlayerNumber>(L, 1)) ) DEFINE_METHOD( GetPlayerDisplayName, GetPlayerDisplayName(Enum::Check<PlayerNumber>(L, 1)) )
DEFINE_METHOD( GetMasterPlayerNumber, m_MasterPlayerNumber ) DEFINE_METHOD( GetMasterPlayerNumber, GetMasterPlayerNumber() )
DEFINE_METHOD( GetMultiplayer, m_bMultiplayer ) DEFINE_METHOD( GetMultiplayer, m_bMultiplayer )
static int SetMultiplayer( T* p, lua_State *L ) static int SetMultiplayer( T* p, lua_State *L )
{ {
+12 -2
View File
@@ -35,6 +35,8 @@ class Trail;
/** @brief Holds game data that is not saved between sessions. */ /** @brief Holds game data that is not saved between sessions. */
class GameState class GameState
{ {
/** @brief The player number used with Styles where one player controls both sides. */
PlayerNumber masterPlayerNumber;
public: public:
/** @brief Set up the GameState with initial values. */ /** @brief Set up the GameState with initial values. */
GameState(); GameState();
@@ -91,8 +93,6 @@ public:
* to get one credit, only to have to put in another four coins to get * to get one credit, only to have to put in another four coins to get
* the three credits needed to begin the game. */ * the three credits needed to begin the game. */
BroadcastOnChange<int> m_iCoins; BroadcastOnChange<int> m_iCoins;
/** @brief The player number used with Styles where one player controls both sides. */
PlayerNumber m_MasterPlayerNumber;
bool m_bMultiplayer; bool m_bMultiplayer;
int m_iNumMultiplayerNoteFields; int m_iNumMultiplayerNoteFields;
bool DifficultiesLocked() const; bool DifficultiesLocked() const;
@@ -140,6 +140,16 @@ public:
bool IsCpuPlayer( PlayerNumber pn ) const; bool IsCpuPlayer( PlayerNumber pn ) const;
bool AnyPlayersAreCpu() const; bool AnyPlayersAreCpu() const;
/**
* @brief Retrieve the present master player number.
* @return The master player number. */
PlayerNumber GetMasterPlayerNumber() const;
/**
* @brief Set the master player number.
* @param p the master player number. */
void SetMasterPlayerNumber(const PlayerNumber p);
bool IsCourseMode() const; bool IsCourseMode() const;
bool IsBattleMode() const; // not Rave bool IsBattleMode() const; // not Rave
+1 -1
View File
@@ -969,7 +969,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
} }
/* If the song has no steps for the current style, remove it. */ /* If the song has no steps for the current style, remove it. */
if( !pSong->HasStepsType(GAMESTATE->GetCurrentStyle()->m_StepsType) ) if( !CommonMetrics::AUTO_SET_STYLE && !pSong->HasStepsType(GAMESTATE->GetCurrentStyle()->m_StepsType) )
{ {
aiRemove[i] = true; aiRemove[i] = true;
continue; continue;
+1 -1
View File
@@ -886,7 +886,7 @@ void NoteDataUtil::CalculateRadarValues( const NoteData &in, float fSongSeconds,
case RadarCategory_Jumps: out[rc] = (float) stats.jumps; break; case RadarCategory_Jumps: out[rc] = (float) stats.jumps; break;
case RadarCategory_Holds: out[rc] = (float) in.GetNumHoldNotes(); break; case RadarCategory_Holds: out[rc] = (float) in.GetNumHoldNotes(); break;
case RadarCategory_Mines: out[rc] = (float) in.GetNumMines(); break; case RadarCategory_Mines: out[rc] = (float) in.GetNumMines(); break;
case RadarCategory_Hands: out[rc] = (float) stats.hands; break; case RadarCategory_Hands: out[rc] = (float) in.GetNumHands(); break;
case RadarCategory_Rolls: out[rc] = (float) in.GetNumRolls(); break; case RadarCategory_Rolls: out[rc] = (float) in.GetNumRolls(); break;
case RadarCategory_Lifts: out[rc] = (float) in.GetNumLifts(); break; case RadarCategory_Lifts: out[rc] = (float) in.GetNumLifts(); break;
case RadarCategory_Fakes: out[rc] = (float) in.GetNumFakes(); break; case RadarCategory_Fakes: out[rc] = (float) in.GetNumFakes(); break;
+1 -1
View File
@@ -303,7 +303,7 @@ void NoteField::Update( float fDeltaTime )
// TODO: Remove use of PlayerNumber. // TODO: Remove use of PlayerNumber.
PlayerNumber pn = m_pPlayerState->m_PlayerNumber; PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
if( pn == GAMESTATE->m_MasterPlayerNumber ) if( pn == GAMESTATE->GetMasterPlayerNumber() )
NoteDisplay::Update( fDeltaTime ); NoteDisplay::Update( fDeltaTime );
} }
+3 -3
View File
@@ -196,7 +196,7 @@ RString OptionRow::GetRowTitle() const
if( GAMESTATE->m_pCurCourse ) if( GAMESTATE->m_pCurCourse )
{ {
const Trail* pTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber]; const Trail* pTrail = GAMESTATE->m_pCurTrail[GAMESTATE->GetMasterPlayerNumber()];
ASSERT( pTrail != NULL ); ASSERT( pTrail != NULL );
const int iNumCourseEntries = pTrail->m_vEntries.size(); const int iNumCourseEntries = pTrail->m_vEntries.size();
if( iNumCourseEntries > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) if( iNumCourseEntries > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
@@ -417,8 +417,8 @@ void OptionRow::AfterImportOptions( PlayerNumber pn )
// we need to copy p2 to p1, not p1 to p2. // we need to copy p2 to p1, not p1 to p2.
if( m_pHand->m_Def.m_bOneChoiceForAllPlayers ) if( m_pHand->m_Def.m_bOneChoiceForAllPlayers )
{ {
PlayerNumber pnCopyFrom = GAMESTATE->m_MasterPlayerNumber; PlayerNumber pnCopyFrom = GAMESTATE->GetMasterPlayerNumber();
if( GAMESTATE->m_MasterPlayerNumber == PLAYER_INVALID ) if( GAMESTATE->GetMasterPlayerNumber() == PLAYER_INVALID )
pnCopyFrom = PLAYER_1; pnCopyFrom = PLAYER_1;
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
m_vbSelected[p] = m_vbSelected[pnCopyFrom]; m_vbSelected[p] = m_vbSelected[pnCopyFrom];
-20
View File
@@ -137,26 +137,6 @@ void PercentageDisplay::Refresh()
else else
{ {
float fPercentDancePoints = m_pPlayerStageStats->GetPercentDancePoints(); float fPercentDancePoints = m_pPlayerStageStats->GetPercentDancePoints();
float fCurMaxPercentDancePoints = m_pPlayerStageStats->GetCurMaxPercentDancePoints();
if( m_bApplyScoreDisplayOptions )
{
switch( m_pPlayerState->m_PlayerOptions.GetCurrent().m_ScoreDisplay )
{
case PlayerOptions::SCORING_ADD:
// nothing to do
break;
case PlayerOptions::SCORING_SUBTRACT:
fPercentDancePoints = 1.0f - ( fCurMaxPercentDancePoints - fPercentDancePoints );
break;
case PlayerOptions::SCORING_AVERAGE:
if( fCurMaxPercentDancePoints == 0.0f ) // don't divide by zero fats
fPercentDancePoints = 0.0f;
else
fPercentDancePoints = fPercentDancePoints / fCurMaxPercentDancePoints;
break;
}
}
// clamp percentage - feedback is that negative numbers look weird here. // clamp percentage - feedback is that negative numbers look weird here.
CLAMP( fPercentDancePoints, 0.f, 1.f ); CLAMP( fPercentDancePoints, 0.f, 1.f );
+1 -1
View File
@@ -1375,7 +1375,7 @@ void Player::DrawPrimitives()
// May have both players in doubles (for battle play); only draw primary player. // May have both players in doubles (for battle play); only draw primary player.
if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_OnePlayerTwoSides && if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_OnePlayerTwoSides &&
pn != GAMESTATE->m_MasterPlayerNumber ) pn != GAMESTATE->GetMasterPlayerNumber() )
return; return;
// Draw these below everything else. // Draw these below everything else.
-7
View File
@@ -45,7 +45,6 @@ void PlayerOptions::Init()
ZERO( m_bTransforms ); ZERO( m_bTransforms );
m_bMuteOnError = false; m_bMuteOnError = false;
m_FailType = FAIL_IMMEDIATE; m_FailType = FAIL_IMMEDIATE;
m_ScoreDisplay = SCORING_ADD;
m_sNoteSkin = ""; m_sNoteSkin = "";
} }
@@ -85,7 +84,6 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
for( int i=0; i<NUM_TRANSFORMS; i++ ) for( int i=0; i<NUM_TRANSFORMS; i++ )
DO_COPY( m_bTransforms[i] ); DO_COPY( m_bTransforms[i] );
DO_COPY( m_bMuteOnError ); DO_COPY( m_bMuteOnError );
DO_COPY( m_ScoreDisplay );
DO_COPY( m_FailType ); DO_COPY( m_FailType );
DO_COPY( m_sNoteSkin ); DO_COPY( m_sNoteSkin );
#undef APPROACH #undef APPROACH
@@ -439,9 +437,6 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
GAMESTATE->GetDefaultPlayerOptions( po ); GAMESTATE->GetDefaultPlayerOptions( po );
m_FailType = po.m_FailType; m_FailType = po.m_FailType;
} }
else if( sBit == "addscore" ) m_ScoreDisplay = SCORING_ADD;
else if( sBit == "subtractscore" ) m_ScoreDisplay = SCORING_SUBTRACT;
else if( sBit == "averagescore" ) m_ScoreDisplay = SCORING_AVERAGE;
else if( sBit == "muteonerror" ) m_bMuteOnError = on; else if( sBit == "muteonerror" ) m_bMuteOnError = on;
else if( sBit == "random" ) ChooseRandomModifiers(); else if( sBit == "random" ) ChooseRandomModifiers();
// deprecated mods/left in for compatibility // deprecated mods/left in for compatibility
@@ -653,7 +648,6 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
COMPARE(m_fScrollSpeed); COMPARE(m_fScrollSpeed);
COMPARE(m_fScrollBPM); COMPARE(m_fScrollBPM);
COMPARE(m_fRandomSpeed); COMPARE(m_fRandomSpeed);
COMPARE(m_ScoreDisplay);
COMPARE(m_FailType); COMPARE(m_FailType);
COMPARE(m_bMuteOnError); COMPARE(m_bMuteOnError);
COMPARE(m_fDark); COMPARE(m_fDark);
@@ -798,7 +792,6 @@ RString PlayerOptions::GetSavedPrefsString() const
SAVE( m_bTransforms[TRANSFORM_NOSTRETCH] ); SAVE( m_bTransforms[TRANSFORM_NOSTRETCH] );
SAVE( m_bTransforms[TRANSFORM_NOLIFTS] ); SAVE( m_bTransforms[TRANSFORM_NOLIFTS] );
SAVE( m_bTransforms[TRANSFORM_NOFAKES] ); SAVE( m_bTransforms[TRANSFORM_NOFAKES] );
SAVE( m_ScoreDisplay );
SAVE( m_bMuteOnError ); SAVE( m_bMuteOnError );
SAVE( m_sNoteSkin ); SAVE( m_sNoteSkin );
#undef SAVE #undef SAVE
+1 -9
View File
@@ -34,8 +34,7 @@ public:
m_fSkew(0), m_SpeedfSkew(1.0f), m_fSkew(0), m_SpeedfSkew(1.0f),
m_fPassmark(0), m_SpeedfPassmark(1.0f), m_fPassmark(0), m_SpeedfPassmark(1.0f),
m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f), m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f),
m_bMuteOnError(false), m_FailType(FAIL_IMMEDIATE), m_bMuteOnError(false), m_FailType(FAIL_IMMEDIATE)
m_ScoreDisplay(SCORING_ADD)
{ {
m_sNoteSkin = ""; m_sNoteSkin = "";
ZERO( m_fAccels ); ONE( m_SpeedfAccels ); ZERO( m_fAccels ); ONE( m_SpeedfAccels );
@@ -151,12 +150,6 @@ public:
SCROLL_CENTERED, SCROLL_CENTERED,
NUM_SCROLLS NUM_SCROLLS
}; };
enum ScoreDisplay {
SCORING_ADD=0,
SCORING_SUBTRACT,
SCORING_AVERAGE,
NUM_SCOREDISPLAYS
};
float GetReversePercentForColumn( int iCol ) const; // accounts for all Directions float GetReversePercentForColumn( int iCol ) const; // accounts for all Directions
@@ -198,7 +191,6 @@ public:
}; };
/** @brief The method for which a player can fail a song. */ /** @brief The method for which a player can fail a song. */
FailType m_FailType; FailType m_FailType;
ScoreDisplay m_ScoreDisplay;
/** /**
* @brief The Noteskin to use. * @brief The Noteskin to use.
+1 -1
View File
@@ -162,7 +162,7 @@ void PlayerState::RebuildPlayerOptionsFromActiveAttacks()
so.FromString( m_ActiveAttacks[s].sModifiers ); so.FromString( m_ActiveAttacks[s].sModifiers );
} }
m_PlayerOptions.Assign( ModsLevel_Song, po ); m_PlayerOptions.Assign( ModsLevel_Song, po );
if( m_PlayerNumber == GAMESTATE->m_MasterPlayerNumber ) if( m_PlayerNumber == GAMESTATE->GetMasterPlayerNumber() )
GAMESTATE->m_SongOptions.Assign( ModsLevel_Song, so ); GAMESTATE->m_SongOptions.Assign( ModsLevel_Song, so );
int iSumOfAttackLevels = GetSumOfActiveAttackLevels(); int iSumOfAttackLevels = GetSumOfActiveAttackLevels();
+2
View File
@@ -64,6 +64,8 @@ static void InitNames()
g_mapNamesToString[KEY_RSUPER] = "right super"; g_mapNamesToString[KEY_RSUPER] = "right super";
g_mapNamesToString[KEY_MENU] = "menu"; g_mapNamesToString[KEY_MENU] = "menu";
g_mapNamesToString[KEY_FN] = "function";
g_mapNamesToString[KEY_NUMLOCK] = "num lock"; g_mapNamesToString[KEY_NUMLOCK] = "num lock";
g_mapNamesToString[KEY_SCRLLOCK] = "scroll lock"; g_mapNamesToString[KEY_SCRLLOCK] = "scroll lock";
g_mapNamesToString[KEY_CAPSLOCK] = "caps lock"; g_mapNamesToString[KEY_CAPSLOCK] = "caps lock";
+2
View File
@@ -222,6 +222,8 @@ enum DeviceButton
KEY_RSUPER, KEY_RSUPER,
KEY_MENU, KEY_MENU,
KEY_FN, // Laptop function keys.
KEY_NUMLOCK, KEY_NUMLOCK,
KEY_SCRLLOCK, KEY_SCRLLOCK,
KEY_CAPSLOCK, KEY_CAPSLOCK,
-30
View File
@@ -46,36 +46,6 @@ void ScoreDisplayNormal::SetScore( int iNewScore )
{ {
float fScore = (float)iNewScore; float fScore = (float)iNewScore;
// TODO: Remove use of PlayerNumber.
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
// Play some games to display the correct score -- the actual internal
// score does not change at all but the displayed one can (ie: displayed
// score for subtractive is MaxScore - score).
int iMaxScore = STATSMAN->m_CurStageStats.m_player[pn].m_iMaxScore;
int iCurMaxScore = STATSMAN->m_CurStageStats.m_player[pn].m_iCurMaxScore;
switch( m_pPlayerState->m_PlayerOptions.GetCurrent().m_ScoreDisplay )
{
case PlayerOptions::SCORING_ADD:
// nothing to do
break;
case PlayerOptions::SCORING_SUBTRACT:
fScore = iMaxScore - ( iCurMaxScore - fScore );
break;
case PlayerOptions::SCORING_AVERAGE:
if( iCurMaxScore == 0 ) // don't divide by zero fats
{
fScore = 0;
}
else
{
float fScoreRatio = fScore / (float)iCurMaxScore;
fScore = fScoreRatio * iMaxScore;
}
}
m_text.SetTargetNumber( fScore ); m_text.SetTargetNumber( fScore );
} }
+10 -10
View File
@@ -16,7 +16,7 @@ void ScoreKeeperShared::Load(
const vector<Steps*> &apSteps, const vector<Steps*> &apSteps,
const vector<AttackArray> &asModifiers ) const vector<AttackArray> &asModifiers )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::Load( apSongs, apSteps, asModifiers ); ScoreKeeperNormal::Load( apSongs, apSteps, asModifiers );
} }
@@ -24,63 +24,63 @@ void ScoreKeeperShared::Load(
// These ScoreKeepers don't get to draw. // These ScoreKeepers don't get to draw.
void ScoreKeeperShared::DrawPrimitives() void ScoreKeeperShared::DrawPrimitives()
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::DrawPrimitives(); ScoreKeeperNormal::DrawPrimitives();
} }
void ScoreKeeperShared::Update( float fDelta ) void ScoreKeeperShared::Update( float fDelta )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::Update( fDelta ); ScoreKeeperNormal::Update( fDelta );
} }
void ScoreKeeperShared::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) void ScoreKeeperShared::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::OnNextSong( iSongInCourseIndex, pSteps, pNoteData ); ScoreKeeperNormal::OnNextSong( iSongInCourseIndex, pSteps, pNoteData );
} }
void ScoreKeeperShared::HandleTapScore( const TapNote &tn ) void ScoreKeeperShared::HandleTapScore( const TapNote &tn )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::HandleTapScore( tn ); ScoreKeeperNormal::HandleTapScore( tn );
} }
void ScoreKeeperShared::HandleTapRowScore( const NoteData &nd, int iRow ) void ScoreKeeperShared::HandleTapRowScore( const NoteData &nd, int iRow )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::HandleTapRowScore( nd, iRow ); ScoreKeeperNormal::HandleTapRowScore( nd, iRow );
} }
void ScoreKeeperShared::HandleHoldScore( const TapNote &tn ) void ScoreKeeperShared::HandleHoldScore( const TapNote &tn )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::HandleHoldScore( tn ); ScoreKeeperNormal::HandleHoldScore( tn );
} }
void ScoreKeeperShared::HandleHoldActiveSeconds( float fMusicSecondsHeld ) void ScoreKeeperShared::HandleHoldActiveSeconds( float fMusicSecondsHeld )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::HandleHoldActiveSeconds( fMusicSecondsHeld ); ScoreKeeperNormal::HandleHoldActiveSeconds( fMusicSecondsHeld );
} }
void ScoreKeeperShared::HandleHoldCheckpointScore( const NoteData &nd, int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow ) void ScoreKeeperShared::HandleHoldCheckpointScore( const NoteData &nd, int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow )
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::HandleHoldCheckpointScore( nd, iRow, iNumHoldsHeldThisRow, iNumHoldsMissedThisRow ); ScoreKeeperNormal::HandleHoldCheckpointScore( nd, iRow, iNumHoldsHeldThisRow, iNumHoldsMissedThisRow );
} }
void ScoreKeeperShared::HandleTapScoreNone() void ScoreKeeperShared::HandleTapScoreNone()
{ {
if( m_pPlayerState->m_PlayerNumber != GAMESTATE->m_MasterPlayerNumber ) if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() )
return; return;
ScoreKeeperNormal::HandleTapScoreNone(); ScoreKeeperNormal::HandleTapScoreNone();
} }
+3 -3
View File
@@ -598,8 +598,8 @@ class DebugLineAutoplay : public IDebugLine
virtual bool IsEnabled() { return GamePreferences::m_AutoPlay.Get() != PC_HUMAN; } virtual bool IsEnabled() { return GamePreferences::m_AutoPlay.Get() != PC_HUMAN; }
virtual void DoAndLog( RString &sMessageOut ) virtual void DoAndLog( RString &sMessageOut )
{ {
ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ); ASSERT( GAMESTATE->GetMasterPlayerNumber() != PLAYER_INVALID );
PlayerController pc = GAMESTATE->m_pPlayerState[GAMESTATE->m_MasterPlayerNumber]->m_PlayerController; PlayerController pc = GAMESTATE->m_pPlayerState[GAMESTATE->GetMasterPlayerNumber()]->m_PlayerController;
bool bHoldingShift = bool bHoldingShift =
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT) ) || INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT) ) ||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT) ); INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT) );
@@ -639,7 +639,7 @@ class DebugLineAssist : public IDebugLine
virtual bool IsEnabled() { return GAMESTATE->m_SongOptions.GetSong().m_bAssistClap || GAMESTATE->m_SongOptions.GetSong().m_bAssistMetronome; } virtual bool IsEnabled() { return GAMESTATE->m_SongOptions.GetSong().m_bAssistClap || GAMESTATE->m_SongOptions.GetSong().m_bAssistMetronome; }
virtual void DoAndLog( RString &sMessageOut ) virtual void DoAndLog( RString &sMessageOut )
{ {
ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ); ASSERT( GAMESTATE->GetMasterPlayerNumber() != PLAYER_INVALID );
bool bHoldingShift = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT) ); bool bHoldingShift = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT) );
bool b; bool b;
if( bHoldingShift ) if( bHoldingShift )
+2 -2
View File
@@ -99,7 +99,7 @@ void ScreenEvaluation::Init()
ss.m_Stage = Stage_1st; ss.m_Stage = Stage_1st;
enum_add( ss.m_Stage, rand()%3 ); enum_add( ss.m_Stage, rand()%3 );
ss.m_EarnedExtraStage = (EarnedExtraStage)(rand() % NUM_EarnedExtraStage); ss.m_EarnedExtraStage = (EarnedExtraStage)(rand() % NUM_EarnedExtraStage);
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() ); GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() );
ss.m_vpPlayedSongs.push_back( GAMESTATE->m_pCurSong ); ss.m_vpPlayedSongs.push_back( GAMESTATE->m_pCurSong );
ss.m_vpPossibleSongs.push_back( GAMESTATE->m_pCurSong ); ss.m_vpPossibleSongs.push_back( GAMESTATE->m_pCurSong );
@@ -635,7 +635,7 @@ void ScreenEvaluation::Init()
{ {
case PLAY_MODE_BATTLE: case PLAY_MODE_BATTLE:
{ {
bool bWon = GAMESTATE->GetStageResult(GAMESTATE->m_MasterPlayerNumber) == RESULT_WIN; bool bWon = GAMESTATE->GetStageResult(GAMESTATE->GetMasterPlayerNumber()) == RESULT_WIN;
if( bWon ) if( bWon )
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation win") ); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation win") );
else else
+3 -3
View File
@@ -776,7 +776,7 @@ void ScreenGameplay::InitSongQueues()
ASSERT( pCourse ); ASSERT( pCourse );
m_apSongsQueue.clear(); m_apSongsQueue.clear();
PlayerNumber pnMaster = GAMESTATE->m_MasterPlayerNumber; PlayerNumber pnMaster = GAMESTATE->GetMasterPlayerNumber();
Trail *pTrail = GAMESTATE->m_pCurTrail[pnMaster]; Trail *pTrail = GAMESTATE->m_pCurTrail[pnMaster];
ASSERT( pTrail ); ASSERT( pTrail );
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e ) FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
@@ -1227,7 +1227,7 @@ void ScreenGameplay::LoadNextSong()
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{ {
RageSoundReader *pPlayerSound = m_AutoKeysounds.GetPlayerSound(pi->m_pn); RageSoundReader *pPlayerSound = m_AutoKeysounds.GetPlayerSound(pi->m_pn);
if( pPlayerSound == NULL && pi->m_pn == GAMESTATE->m_MasterPlayerNumber ) if( pPlayerSound == NULL && pi->m_pn == GAMESTATE->GetMasterPlayerNumber() )
pPlayerSound = m_AutoKeysounds.GetSharedSound(); pPlayerSound = m_AutoKeysounds.GetSharedSound();
pi->m_SoundEffectControl.SetSoundReader( pPlayerSound ); pi->m_SoundEffectControl.SetSoundReader( pPlayerSound );
} }
@@ -1393,7 +1393,7 @@ void ScreenGameplay::PlayTicks()
/* TODO: Allow all players to have ticks. Not as simple as it looks. /* TODO: Allow all players to have ticks. Not as simple as it looks.
* If a loop takes place, it could make one player's ticks come later * If a loop takes place, it could make one player's ticks come later
* than intended. Any help here would be appreciated. -Wolfman2000 */ * than intended. Any help here would be appreciated. -Wolfman2000 */
Player &player = *m_vPlayerInfo[0].m_pPlayer; Player &player = *m_vPlayerInfo[GAMESTATE->GetMasterPlayerNumber()].m_pPlayer;
const NoteData &nd = player.GetNoteData(); const NoteData &nd = player.GetNoteData();
m_GameplayAssist.PlayTicks( nd, player.GetPlayerState() ); m_GameplayAssist.PlayTicks( nd, player.GetPlayerState() );
} }
+2 -2
View File
@@ -11,7 +11,7 @@ REGISTER_SCREEN_CLASS( ScreenGameplayShared );
void ScreenGameplayShared::FillPlayerInfo( vector<PlayerInfo> &vPlayerInfoOut ) void ScreenGameplayShared::FillPlayerInfo( vector<PlayerInfo> &vPlayerInfoOut )
{ {
const PlayerNumber master = GAMESTATE->m_MasterPlayerNumber; const PlayerNumber master = GAMESTATE->GetMasterPlayerNumber();
const PlayerNumber other = (master == PLAYER_1? PLAYER_2:PLAYER_1); const PlayerNumber other = (master == PLAYER_1? PLAYER_2:PLAYER_1);
/* The master player is where all of the real work takes place. The other player exists /* The master player is where all of the real work takes place. The other player exists
@@ -23,7 +23,7 @@ void ScreenGameplayShared::FillPlayerInfo( vector<PlayerInfo> &vPlayerInfoOut )
PlayerInfo &ScreenGameplayShared::GetPlayerInfoForInput( const InputEventPlus& iep ) PlayerInfo &ScreenGameplayShared::GetPlayerInfoForInput( const InputEventPlus& iep )
{ {
return m_vPlayerInfo[GAMESTATE->m_MasterPlayerNumber]; return m_vPlayerInfo[GAMESTATE->GetMasterPlayerNumber()];
} }
/* /*
+1 -1
View File
@@ -172,7 +172,7 @@ void ScreenHowToPlay::Init()
// Don't show judgment // Don't show judgment
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions, ModsLevel_Stage, m_fBlind, 1.0f ); PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions, ModsLevel_Stage, m_fBlind, 1.0f );
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
GAMESTATE->m_bDemonstrationOrJukebox = true; GAMESTATE->m_bDemonstrationOrJukebox = true;
} }
+1 -1
View File
@@ -375,7 +375,7 @@ void ScreenInstallOverlay::Update( float fDeltaTime )
GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle, false ); GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyle, false );
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->m_bSideIsJoined[0] = true; GAMESTATE->m_bSideIsJoined[0] = true;
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
GAMESTATE->m_pCurStyle.Set( vpStyle[0] ); GAMESTATE->m_pCurStyle.Set( vpStyle[0] );
GAMESTATE->m_pCurSong.Set( pSong ); GAMESTATE->m_pCurSong.Set( pSong );
GAMESTATE->m_pPreferredSong = pSong; GAMESTATE->m_pPreferredSong = pSong;
+1 -1
View File
@@ -179,7 +179,7 @@ void ScreenJukebox::Init()
// ASSERT( GAMESTATE->m_pCurSong ); // ASSERT( GAMESTATE->m_pCurSong );
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
// choose some cool options // choose some cool options
int Benchmark = 0; int Benchmark = 0;
+1 -1
View File
@@ -107,7 +107,7 @@ void ScreenMiniMenu::AfterChangeValueOrRow( PlayerNumber pn )
OptionRow &optrow = *m_pRows[i]; OptionRow &optrow = *m_pRows[i];
optrow.GetRowDef().m_vEnabledForPlayers.clear(); optrow.GetRowDef().m_vEnabledForPlayers.clear();
if( mr.pfnEnabled() ) if( mr.pfnEnabled() )
optrow.GetRowDef().m_vEnabledForPlayers.insert( GAMESTATE->m_MasterPlayerNumber ); optrow.GetRowDef().m_vEnabledForPlayers.insert( GAMESTATE->GetMasterPlayerNumber() );
} }
m_pRows[i]->UpdateEnabledDisabled(); m_pRows[i]->UpdateEnabledDisabled();
} }
+1 -1
View File
@@ -118,7 +118,7 @@ ScreenNameEntry::ScreenNameEntry()
{ {
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true; GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
StageStats ss; StageStats ss;
+1 -1
View File
@@ -22,7 +22,7 @@ void ScreenNameEntryTraditional::Init()
{ {
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true; GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true; GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
for( int z = 0; z < 3; ++z ) for( int z = 0; z < 3; ++z )
+1 -1
View File
@@ -531,7 +531,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
return; // already transitioning return; // already transitioning
// If the selected option sets a screen, honor it. // If the selected option sets a screen, honor it.
RString sThisScreen = GetNextScreenForFocusedItem( GAMESTATE->m_MasterPlayerNumber ); RString sThisScreen = GetNextScreenForFocusedItem( GAMESTATE->GetMasterPlayerNumber() );
if( sThisScreen != "" ) if( sThisScreen != "" )
m_sNextScreen = sThisScreen; m_sNextScreen = sThisScreen;
+2 -2
View File
@@ -119,7 +119,7 @@ void ScreenOptionsCourseOverview::HandleScreenMessage( const ScreenMessage SM )
} }
else if( SM == SM_GoToNextScreen ) else if( SM == SM_GoToNextScreen )
{ {
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
switch( iRow ) switch( iRow )
{ {
case CourseOverviewRow_Play: case CourseOverviewRow_Play:
@@ -191,7 +191,7 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
switch( iRow ) switch( iRow )
{ {
case CourseOverviewRow_Play: case CourseOverviewRow_Play:
+1 -1
View File
@@ -488,7 +488,7 @@ void ScreenOptionsEditCourse::ProcessMenuStart( const InputEventPlus &input )
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
unsigned iSongCount = GAMESTATE->m_pCurCourse->m_vEntries.size(); unsigned iSongCount = GAMESTATE->m_pCurCourse->m_vEntries.size();
+1 -1
View File
@@ -147,7 +147,7 @@ void ScreenOptionsExportPackage::ProcessMenuStart( const InputEventPlus &input )
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( m_pRows[iCurRow]->GetRowType() == OptionRow::RowType_Exit ) if( m_pRows[iCurRow]->GetRowType() == OptionRow::RowType_Exit )
{ {
ScreenOptions::ProcessMenuStart( input ); ScreenOptions::ProcessMenuStart( input );
+5 -5
View File
@@ -143,18 +143,18 @@ void ScreenOptionsManageCourses::BeginScreen()
if( iter != m_vpCourses.end() ) if( iter != m_vpCourses.end() )
{ {
iIndex = iter - m_vpCourses.begin(); iIndex = iter - m_vpCourses.begin();
this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex ); this->MoveRowAbsolute( GAMESTATE->GetMasterPlayerNumber(), 1 + iIndex );
} }
} }
AfterChangeRow( GAMESTATE->m_MasterPlayerNumber ); AfterChangeRow( GAMESTATE->GetMasterPlayerNumber() );
} }
void ScreenOptionsManageCourses::HandleScreenMessage( const ScreenMessage SM ) void ScreenOptionsManageCourses::HandleScreenMessage( const ScreenMessage SM )
{ {
if( SM == SM_GoToNextScreen ) if( SM == SM_GoToNextScreen )
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( iCurRow == 0 ) // "create new" if( iCurRow == 0 ) // "create new"
{ {
@@ -218,7 +218,7 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus &input )
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( iCurRow == 0 ) // "create new" if( iCurRow == 0 ) // "create new"
{ {
@@ -259,7 +259,7 @@ void ScreenOptionsManageCourses::ExportOptions( int iRow, const vector<PlayerNum
Course *ScreenOptionsManageCourses::GetCourseWithFocus() const Course *ScreenOptionsManageCourses::GetCourseWithFocus() const
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( iCurRow == 0 ) if( iCurRow == 0 )
return NULL; return NULL;
else if( m_pRows[iCurRow]->GetRowType() == OptionRow::RowType_Exit ) else if( m_pRows[iCurRow]->GetRowType() == OptionRow::RowType_Exit )
+3 -3
View File
@@ -125,7 +125,7 @@ void ScreenOptionsManageEditSteps::HandleScreenMessage( const ScreenMessage SM )
{ {
if( SM == SM_GoToNextScreen ) if( SM == SM_GoToNextScreen )
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( iCurRow == 0 ) // "create new" if( iCurRow == 0 ) // "create new"
{ {
@@ -245,7 +245,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus &input
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( iCurRow == 0 ) // "create new" if( iCurRow == 0 ) // "create new"
{ {
@@ -292,7 +292,7 @@ void ScreenOptionsManageEditSteps::ExportOptions( int iRow, const vector<PlayerN
Steps *ScreenOptionsManageEditSteps::GetStepsWithFocus() const Steps *ScreenOptionsManageEditSteps::GetStepsWithFocus() const
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
if( iCurRow == 0 ) if( iCurRow == 0 )
return NULL; return NULL;
else if( m_pRows[iCurRow]->GetRowType() == OptionRow::RowType_Exit ) else if( m_pRows[iCurRow]->GetRowType() == OptionRow::RowType_Exit )
+3 -3
View File
@@ -167,7 +167,7 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM )
{ {
if( SM == SM_GoToNextScreen ) if( SM == SM_GoToNextScreen )
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
OptionRow &row = *m_pRows[iCurRow]; OptionRow &row = *m_pRows[iCurRow];
if( row.GetRowType() == OptionRow::RowType_Exit ) if( row.GetRowType() == OptionRow::RowType_Exit )
{ {
@@ -337,7 +337,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( const InputEventPlus &input
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
OptionRow &row = *m_pRows[iCurRow]; OptionRow &row = *m_pRows[iCurRow];
if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new"
@@ -405,7 +405,7 @@ void ScreenOptionsManageProfiles::ExportOptions( int iRow, const vector<PlayerNu
int ScreenOptionsManageProfiles::GetLocalProfileIndexWithFocus() const int ScreenOptionsManageProfiles::GetLocalProfileIndexWithFocus() const
{ {
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
OptionRow &row = *m_pRows[iCurRow]; OptionRow &row = *m_pRows[iCurRow];
if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new"
+4 -4
View File
@@ -111,7 +111,7 @@ void ScreenOptionsMemoryCard::AfterChangeRow( PlayerNumber pn )
} }
else else
{ {
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
m_textOsMountDir.SetText( m_CurrentUsbStorageDevices[iRow].sOsMountDir ); m_textOsMountDir.SetText( m_CurrentUsbStorageDevices[iRow].sOsMountDir );
} }
} }
@@ -124,7 +124,7 @@ void ScreenOptionsMemoryCard::HandleMessage( const Message &msg )
{ {
/* Remember the old mountpoint. */ /* Remember the old mountpoint. */
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices; const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
RString sOldMountPoint; RString sOldMountPoint;
if( iRow < int(v.size()) ) if( iRow < int(v.size()) )
{ {
@@ -158,7 +158,7 @@ void ScreenOptionsMemoryCard::ExportOptions( int iRow, const vector<PlayerNumber
if( row.GetRowType() == OptionRow::RowType_Exit ) if( row.GetRowType() == OptionRow::RowType_Exit )
return; return;
PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber; PlayerNumber pn = GAMESTATE->GetMasterPlayerNumber();
if( m_iCurrentRow[pn] == iRow ) if( m_iCurrentRow[pn] == iRow )
{ {
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices; const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
@@ -192,7 +192,7 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input )
if( IsTransitioning() ) if( IsTransitioning() )
return; return;
int iCurRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; int iCurRow = m_iCurrentRow[GAMESTATE->GetMasterPlayerNumber()];
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices; const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
if( iCurRow < int(v.size()) ) // a card if( iCurRow < int(v.size()) ) // a card
+1 -1
View File
@@ -155,7 +155,7 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
{ {
LOG->Trace("[ScreenSMOnlineLogin::HandleScreenMessage] GoToNextScreen"); LOG->Trace("[ScreenSMOnlineLogin::HandleScreenMessage] GoToNextScreen");
vector<PlayerNumber> v; vector<PlayerNumber> v;
v.push_back( GAMESTATE->m_MasterPlayerNumber ); v.push_back( GAMESTATE->GetMasterPlayerNumber() );
for( unsigned r=0; r<m_pRows.size(); r++ ) for( unsigned r=0; r<m_pRows.size(); r++ )
ExportOptions( r, v ); ExportOptions( r, v );
+2 -2
View File
@@ -145,8 +145,8 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
* same choice, and if so, call ApplyToAll instead. * same choice, and if so, call ApplyToAll instead.
* TODO: Think of a better way to handle this. * TODO: Think of a better way to handle this.
*/ */
ASSERT( GAMESTATE->m_MasterPlayerNumber != PlayerNumber_Invalid ); ASSERT( GAMESTATE->GetMasterPlayerNumber() != PlayerNumber_Invalid );
int iMastersIndex = this->GetSelectionIndex( GAMESTATE->m_MasterPlayerNumber ); int iMastersIndex = this->GetSelectionIndex( GAMESTATE->GetMasterPlayerNumber() );
bool bAllPlayersChoseTheSame = true; bool bAllPlayersChoseTheSame = true;
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
{ {
+4 -4
View File
@@ -294,7 +294,7 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM )
if( SM == SM_PlayPostSwitchPage ) if( SM == SM_PlayPostSwitchPage )
{ {
int iNewChoice = m_iChoice[ GAMESTATE->m_MasterPlayerNumber ]; int iNewChoice = m_iChoice[ GAMESTATE->GetMasterPlayerNumber() ];
Page newPage = GetPage( iNewChoice ); Page newPage = GetPage( iNewChoice );
Message msg("PostSwitchPage"); Message msg("PostSwitchPage");
@@ -516,7 +516,7 @@ void ScreenSelectMaster::MenuDown( const InputEventPlus &input )
bool ScreenSelectMaster::ChangePage( int iNewChoice ) bool ScreenSelectMaster::ChangePage( int iNewChoice )
{ {
Page oldPage = GetPage( m_iChoice[GAMESTATE->m_MasterPlayerNumber] ); Page oldPage = GetPage( m_iChoice[GAMESTATE->GetMasterPlayerNumber()] );
Page newPage = GetPage( iNewChoice ); Page newPage = GetPage( iNewChoice );
// If anyone has already chosen, don't allow changing of pages // If anyone has already chosen, don't allow changing of pages
@@ -710,8 +710,8 @@ bool ScreenSelectMaster::ChangeSelection( PlayerNumber pn, MenuDir dir, int iNew
PlayerNumber ScreenSelectMaster::GetSharedPlayer() PlayerNumber ScreenSelectMaster::GetSharedPlayer()
{ {
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ) if( GAMESTATE->GetMasterPlayerNumber() != PLAYER_INVALID )
return GAMESTATE->m_MasterPlayerNumber; return GAMESTATE->GetMasterPlayerNumber();
return PLAYER_1; return PLAYER_1;
} }
+4 -4
View File
@@ -68,7 +68,7 @@ void ScreenSelectMusic::Init()
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") ); GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") );
GAMESTATE->JoinPlayer( PLAYER_1 ); GAMESTATE->JoinPlayer( PLAYER_1 );
GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
} }
SAMPLE_MUSIC_DELAY_INIT.Load( m_sName, "SampleMusicDelayInit" ); SAMPLE_MUSIC_DELAY_INIT.Load( m_sName, "SampleMusicDelayInit" );
@@ -1020,7 +1020,7 @@ void ScreenSelectMusic::HandleMessage( const Message &msg )
// TODO: Invalidate the CurSteps only if they are no longer playable. // TODO: Invalidate the CurSteps only if they are no longer playable.
// That way, after music change will clamp to the nearest in the StepsDisplayList. // That way, after music change will clamp to the nearest in the StepsDisplayList.
GAMESTATE->m_pCurSteps[GAMESTATE->m_MasterPlayerNumber].SetWithoutBroadcast( NULL ); GAMESTATE->m_pCurSteps[GAMESTATE->GetMasterPlayerNumber()].SetWithoutBroadcast( NULL );
FOREACH_ENUM( PlayerNumber, p ) FOREACH_ENUM( PlayerNumber, p )
GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL ); GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL );
@@ -1392,7 +1392,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
if( pStyle == NULL ) if( pStyle == NULL )
{ {
StepsType stCurrent; StepsType stCurrent;
PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber; PlayerNumber pn = GAMESTATE->GetMasterPlayerNumber();
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
{ {
ASSERT( GAMESTATE->m_pCurTrail[pn] ); ASSERT( GAMESTATE->m_pCurTrail[pn] );
@@ -1615,7 +1615,7 @@ void ScreenSelectMusic::SwitchToPreferredDifficulty()
if( GAMESTATE->DifficultiesLocked() ) if( GAMESTATE->DifficultiesLocked() )
{ {
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
m_iSelection[p] = m_iSelection[GAMESTATE->m_MasterPlayerNumber]; m_iSelection[p] = m_iSelection[GAMESTATE->GetMasterPlayerNumber()];
} }
} }
+1 -1
View File
@@ -23,7 +23,7 @@ void ScreenSongOptions::Init()
void ScreenSongOptions::ExportOptions( int iRow, const vector<PlayerNumber> &vpns ) void ScreenSongOptions::ExportOptions( int iRow, const vector<PlayerNumber> &vpns )
{ {
PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber; PlayerNumber pn = GAMESTATE->GetMasterPlayerNumber();
PlayerState *pPS = GAMESTATE->m_pPlayerState[pn]; PlayerState *pPS = GAMESTATE->m_pPlayerState[pn];
const PlayerOptions::FailType ft = pPS->m_PlayerOptions.GetPreferred().m_FailType; const PlayerOptions::FailType ft = pPS->m_PlayerOptions.GetPreferred().m_FailType;
+1 -1
View File
@@ -41,7 +41,7 @@
* @brief The internal version of the cache for StepMania. * @brief The internal version of the cache for StepMania.
* *
* Increment this value to invalidate the current cache. */ * Increment this value to invalidate the current cache. */
const int FILE_CACHE_VERSION = 178; const int FILE_CACHE_VERSION = 179;
/** @brief How long does a song sample last by default? */ /** @brief How long does a song sample last by default? */
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;
+3 -1
View File
@@ -927,7 +927,9 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set<StepsType> &vOut )
iNumPlayers = max( iNumPlayers, 1 ); iNumPlayers = max( iNumPlayers, 1 );
const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, iNumPlayers, *st ); const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, iNumPlayers, *st );
bool bEnoughStages = GAMESTATE->IsAnExtraStage() || GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() >= GAMESTATE->GetNumStagesForSongAndStyleType(pSong, pStyle->m_StyleType); bool bEnoughStages = GAMESTATE->IsAnExtraStage() ||
GAMESTATE->GetSmallestNumStagesLeftForAnyHumanPlayer() >=
GAMESTATE->GetNumStagesForSongAndStyleType(pSong, pStyle->m_StyleType);
if( bShowThisStepsType && bEnoughStages ) if( bShowThisStepsType && bEnoughStages )
vOut.insert( *st ); vOut.insert( *st );
+1 -1
View File
@@ -275,7 +275,7 @@ void StatsManager::CommitStatsToProfiles( const StageStats *pSS )
{ {
if( pSS->m_multiPlayer[mp].m_HighScore.IsEmpty() ) if( pSS->m_multiPlayer[mp].m_HighScore.IsEmpty() )
continue; continue;
recent->AppendChild( MakeRecentScoreNode( *pSS, GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber], pSS->m_multiPlayer[mp], mp ) ); recent->AppendChild( MakeRecentScoreNode( *pSS, GAMESTATE->m_pCurTrail[GAMESTATE->GetMasterPlayerNumber()], pSS->m_multiPlayer[mp], mp ) );
} }
} }