#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 "GameState.h" #include "RageLog.h" #include "RageUtil.h" #include "InputMapper.h" #include "NoteData.h" #include bool Style::GetUsesCenteredArrows() const { switch( m_StyleType ) { case StyleType_OnePlayerTwoSides: case StyleType_TwoPlayersSharedSides: return true; default: return false; } } void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& original, NoteData& noteDataOut ) const { ASSERT( pn >=0 && pn <= NUM_PLAYERS ); int iNewToOriginalTrack[MAX_COLS_PER_PLAYER]; for( int col=0; colGetInputScheme()->m_iButtonsPerController; for( GameButton gb=GAME_BUTTON_NEXT; gb < iButtonsPerController; gb=(GameButton)(gb+1) ) { int iThisInputCol = m_iInputColumn[gc][gb-GAME_BUTTON_NEXT]; if( iThisInputCol == END_MAPPING ) break; if( iThisInputCol == iCol ) return GameInput( gc, gb ); } } FAIL_M( ssprintf("Invalid column number %i for player %i in the style %s", iCol, pn, GAMESTATE->GetCurrentStyle()->m_szName) ); }; int Style::GameInputToColumn( const GameInput &GameI ) const { if( GameI.button < GAME_BUTTON_NEXT ) return Column_Invalid; int iColumnIndex = GameI.button - GAME_BUTTON_NEXT; if( m_iInputColumn[GameI.controller][iColumnIndex] == NO_MAPPING ) return Column_Invalid; for( int i = 0; i <= iColumnIndex; ++i ) if( m_iInputColumn[GameI.controller][i] == END_MAPPING ) return Column_Invalid; return m_iInputColumn[GameI.controller][iColumnIndex]; } void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const { ASSERT( pn != PLAYER_INVALID ); fMixXOut = FLT_MAX; fMaxXOut = FLT_MIN; for( int i=0; iGetInputScheme()->GetGameButtonName(GI.button); } // Lua bindings #include "LuaBinding.h" /** @brief Allow Lua to have access to the Style. */ class LunaStyle: public Luna