Move some player-specific data out of the bloated GameState class.

Have gameplay objects hold a PlayerState pointer instead of a PlayerNumber and indexing back into GameState.
This will simplify off-screen players (e.g. CPU ghosts, network replicated human players, >2 players using one NoteField)
This commit is contained in:
Chris Danford
2004-12-20 06:25:59 +00:00
parent 52545966e6
commit f840c014a9
70 changed files with 977 additions and 655 deletions
+5 -4
View File
@@ -16,6 +16,7 @@
#include "ScreenManager.h"
#include "PrefsManager.h"
#include "StageStats.h"
#include "PlayerState.h"
#define SCROLL_DELAY THEME->GetMetricF("ScreenEnding","ScrollDelay")
@@ -152,11 +153,11 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa
GAMESTATE->m_pCurSteps[PLAYER_2] = GAMESTATE->m_pCurSong->GetAllSteps()[0];
g_CurStageStats.vpSteps[PLAYER_1].push_back( GAMESTATE->m_pCurSteps[PLAYER_1] );
g_CurStageStats.vpSteps[PLAYER_2].push_back( GAMESTATE->m_pCurSteps[PLAYER_2] );
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fScrollSpeed = 2;
GAMESTATE->m_PlayerOptions[PLAYER_2].m_fScrollSpeed = 2;
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.m_fScrollSpeed = 2;
GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions.m_fScrollSpeed = 2;
GAMESTATE->m_iCurrentStageIndex = 0;
GAMESTATE->m_PlayerOptions[PLAYER_1].ChooseRandomMofifiers();
GAMESTATE->m_PlayerOptions[PLAYER_2].ChooseRandomMofifiers();
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.ChooseRandomMofifiers();
GAMESTATE->m_pPlayerState[PLAYER_2]->m_PlayerOptions.ChooseRandomMofifiers();
for( float f = 0; f < 100.0f; f += 1.0f )
{