Pass release to Step(). Doesn't do anything yet.

This commit is contained in:
Steve Checkoway
2006-08-14 09:09:24 +00:00
parent a839f8cfa6
commit 45db2de31d
4 changed files with 43 additions and 39 deletions
+8 -5
View File
@@ -572,7 +572,7 @@ void Player::Update( float fDeltaTime )
if( tn.HoldResult.fLife >= 0.5f )
continue;
Step( iTrack, iSongRow, now, false );
Step( iTrack, iSongRow, now, false, false );
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY )
STATSMAN->m_CurStageStats.bUsedAutoplay = true;
}
@@ -923,8 +923,11 @@ int Player::GetClosestNote( int col, int iNoteRow, int iMaxRowsAhead, int iMaxRo
return iNextIndex;
}
void Player::Step( int col, int row, const RageTimer &tm, bool bHeld )
void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease )
{
// XXX: Ignore for now.
if( bRelease )
return;
// If we're playing on oni and we've died, do nothing.
if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType == SongOptions::LIFE_BATTERY && m_pPlayerStageStats && m_pPlayerStageStats->bFailed )
return;
@@ -1464,7 +1467,7 @@ void Player::CrossedRow( int iNoteRow, const RageTimer &now )
const TapNote &tn = m_NoteData.GetTapNote( t, iNoteRow );
if( tn.type != TapNote::empty && tn.result.tns == TNS_None )
{
Step( t, iNoteRow, now );
Step( t, iNoteRow, now, false, false );
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY )
STATSMAN->m_CurStageStats.bUsedAutoplay = true;
}
@@ -1487,13 +1490,13 @@ void Player::CrossedMineRow( int iNoteRow, const RageTimer &now )
{
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI, m_pPlayerState->m_mp );
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
Step( t, -1, now+(-PREFSMAN->m_fPadStickSeconds), true );
Step( t, -1, now+(-PREFSMAN->m_fPadStickSeconds), true, false );
}
else
{
bool bIsDown = INPUTMAPPER->IsButtonDown( StyleI, m_pPlayerState->m_mp );
if( bIsDown )
Step( t, iNoteRow, now, true );
Step( t, iNoteRow, now, true, false );
}
}
}
+1 -1
View File
@@ -113,7 +113,7 @@ public:
void Load();
void CrossedRow( int iNoteRow, const RageTimer &now );
void CrossedMineRow( int iNoteRow, const RageTimer &now );
void Step( int col, int row, const RageTimer &tm, bool bHeld = false );
void Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease );
void RandomizeNotes( int iNoteRow );
void FadeToFail();
void CacheAllUsedNoteSkins();
+30 -26
View File
@@ -2014,37 +2014,36 @@ void ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton Edit
void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
{
if( input.type != IET_FIRST_PRESS )
return;
switch( EditB )
if( input.type == IET_FIRST_PRESS )
{
case EDIT_BUTTON_RETURN_TO_EDIT:
/* When exiting play mode manually, leave the cursor where it is. */
m_fBeatToReturnTo = GAMESTATE->m_fSongBeat;
TransitionEditState( STATE_EDITING );
break;
case EDIT_BUTTON_TOGGLE_ASSIST_TICK:
SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_bAssistTick, !GAMESTATE->m_SongOptions.GetStage().m_bAssistTick );
break;
case EDIT_BUTTON_TOGGLE_AUTOPLAY:
switch( EditB )
{
case EDIT_BUTTON_RETURN_TO_EDIT:
/* When exiting play mode manually, leave the cursor where it is. */
m_fBeatToReturnTo = GAMESTATE->m_fSongBeat;
TransitionEditState( STATE_EDITING );
break;
case EDIT_BUTTON_TOGGLE_ASSIST_TICK:
SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_bAssistTick, !GAMESTATE->m_SongOptions.GetStage().m_bAssistTick );
break;
case EDIT_BUTTON_TOGGLE_AUTOPLAY:
{
PREFSMAN->m_AutoPlay.Set( PREFSMAN->m_AutoPlay!=PC_HUMAN ? PC_HUMAN:PC_AUTOPLAY );
FOREACH_HumanPlayer( p )
GAMESTATE->m_pPlayerState[p]->m_PlayerController = PREFSMAN->m_AutoPlay;
}
break;
case EDIT_BUTTON_OFFSET_UP:
case EDIT_BUTTON_OFFSET_DOWN:
break;
case EDIT_BUTTON_OFFSET_UP:
case EDIT_BUTTON_OFFSET_DOWN:
{
float fOffsetDelta;
switch( EditB )
{
DEFAULT_FAIL( EditB );
case EDIT_BUTTON_OFFSET_DOWN: fOffsetDelta = -0.020f; break;
case EDIT_BUTTON_OFFSET_UP: fOffsetDelta = +0.020f; break;
DEFAULT_FAIL( EditB );
case EDIT_BUTTON_OFFSET_DOWN: fOffsetDelta = -0.020f; break;
case EDIT_BUTTON_OFFSET_UP: fOffsetDelta = +0.020f; break;
}
if( EditIsBeingPressed( EDIT_BUTTON_ADJUST_FINE ) )
{
fOffsetDelta /= 20; /* 1ms */
@@ -2053,21 +2052,26 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
{
switch( input.type )
{
case IET_SLOW_REPEAT: fOffsetDelta *= 10; break;
case IET_FAST_REPEAT: fOffsetDelta *= 40; break;
case IET_SLOW_REPEAT: fOffsetDelta *= 10; break;
case IET_FAST_REPEAT: fOffsetDelta *= 40; break;
}
}
m_pSong->m_Timing.m_fBeat0OffsetInSeconds += fOffsetDelta;
}
break;
break;
}
}
else if( input.type != IET_RELEASE )
{
return;
}
switch( input.StyleI.player )
{
case PLAYER_1:
if( PREFSMAN->m_AutoPlay == PC_HUMAN )
m_Player->Step( input.StyleI.col, -1, input.DeviceI.ts );
m_Player->Step( input.StyleI.col, -1, input.DeviceI.ts, false, input.type == IET_RELEASE );
break;
}
+4 -7
View File
@@ -2144,11 +2144,8 @@ void ScreenGameplay::Input( const InputEventPlus &input )
return;
}
}
/* Nothing below cares about releases. */
if( input.type == IET_RELEASE )
return;
bool bRelease = input.type == IET_RELEASE;
if( GAMESTATE->m_bMultiplayer )
{
@@ -2157,7 +2154,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
input.StyleI.IsValid() &&
GAMESTATE->IsMultiPlayerEnabled(input.mp) )
{
m_vPlayerInfo[input.mp].m_pPlayer->Step( input.StyleI.col, -1, input.DeviceI.ts );
m_vPlayerInfo[input.mp].m_pPlayer->Step( input.StyleI.col, -1, input.DeviceI.ts, false, bRelease );
}
}
else
@@ -2174,7 +2171,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
if( PREFSMAN->m_AutoPlay == PC_HUMAN )
{
PlayerInfo& pi = GetPlayerInfoForInput( input );
pi.m_pPlayer->Step( input.StyleI.col, -1, input.DeviceI.ts );
pi.m_pPlayer->Step( input.StyleI.col, -1, input.DeviceI.ts, false, bRelease );
}
}
}