#include "global.h" /* * Styles define a set of columns for each player, and information about those * columns, like what Instruments are used play those columns and what track * to use to populate the column's notes. * A "track" is the term used to descibe a particular vertical sting of note * in NoteData. * A "column" is the term used to describe the vertical string of notes that * a player sees on the screen while they're playing. Column notes are * picked from a track, but columns and tracks don't have a 1-to-1 * correspondance. For example, dance-versus has 8 columns but only 4 tracks * because two players place from the same set of 4 tracks. */ #include "Style.h" #include "RageLog.h" #include "RageUtil.h" #include "Game.h" #include "IniFile.h" #include "GameState.h" #include "NoteData.h" void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData* pOriginal, NoteData* pNoteDataOut ) const { int iNewToOriginalTrack[MAX_COLS_PER_PLAYER]; for( int col=0; colLoadTransformed( pOriginal, m_iColsPerPlayer, iNewToOriginalTrack ); } GameInput Style::StyleInputToGameInput( const StyleInput& StyleI ) const { ASSERT_M( StyleI.player < NUM_PLAYERS, ssprintf("P%i", StyleI.player) ); ASSERT_M( StyleI.col < MAX_COLS_PER_PLAYER, ssprintf("C%i", StyleI.col) ); GameController c = m_ColumnInfo[StyleI.player][StyleI.col].controller; GameButton b = m_ColumnInfo[StyleI.player][StyleI.col].button; return GameInput( c, b ); }; StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const { StyleInput SI; FOREACH_PlayerNumber( p ) { for( int t=0; tm_MasterPlayerNumber; return SI; } } } return SI; // Didn't find a match. Return invalid. } PlayerNumber Style::ControllerToPlayerNumber( GameController controller ) const { switch( m_StyleType ) { case ONE_PLAYER_ONE_CREDIT: case TWO_PLAYERS_TWO_CREDITS: return (PlayerNumber)controller; case ONE_PLAYER_TWO_CREDITS: return GAMESTATE->m_MasterPlayerNumber; default: ASSERT(0); return PLAYER_INVALID; } } bool Style::MatchesStepsType( StepsType type ) const { if(type == m_StepsType) return true; return false; } void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const { fMixXOut = +100000; fMaxXOut = -100000; for( int i=0; i