From 4a324be6dd6d5796b96899c50c88a005b850f3e2 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 9 Jul 2006 20:14:06 +0000 Subject: [PATCH] GetPlayerInfoForInput allows mapping inputs to PlayerInfos rather than just PlayerNumbers to PlayerInfos. --- stepmania/src/ScreenGameplay.cpp | 3 +-- stepmania/src/ScreenGameplay.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 70175071a0..3388fc411b 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -47,7 +47,6 @@ #include "Player.h" #include "DifficultyIcon.h" #include "DifficultyMeter.h" -#include "InputEventPlus.h" #include "XmlFile.h" #include "Background.h" #include "Foreground.h" @@ -2194,7 +2193,7 @@ void ScreenGameplay::Input( const InputEventPlus &input ) if( PREFSMAN->m_AutoPlay == PC_HUMAN ) { - PlayerInfo& pi = PlayerNumberToPlayerInfo( input.StyleI.player ); + PlayerInfo& pi = GetPlayerInfoForInput( input ); pi.m_pPlayer->Step( input.StyleI.col, input.DeviceI.ts ); } } diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index b42c6a9035..fd780a7586 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -17,7 +17,7 @@ #include "ThemeMetric.h" #include "PlayerStageStats.h" #include "PlayerState.h" -#include "GameInput.h" +#include "InputEventPlus.h" class LyricsLoader; class ActiveAttackList; @@ -221,7 +221,7 @@ protected: vector m_vPlayerInfo; // filled by SGameplay derivatives in Init virtual void FillPlayerInfo( vector &vPlayerInfoOut ) = 0; - virtual PlayerInfo &PlayerNumberToPlayerInfo( PlayerNumber pn ) { return m_vPlayerInfo[pn]; } + virtual PlayerInfo &GetPlayerInfoForInput( const InputEventPlus& iep ) { return m_vPlayerInfo[iep.StyleI.player]; } }; vector::iterator GetNextEnabledPlayerInfo ( vector::iterator iter, vector &v );