karaoke prototype (disabled)

This commit is contained in:
Chris Danford
2008-03-12 23:17:39 +00:00
parent ecbe89179e
commit 5e87c2e81a
82 changed files with 13322 additions and 31 deletions
+37 -4
View File
@@ -41,6 +41,9 @@
#include "GameCommand.h"
#include "LocalizedString.h"
#include "AdjustSync.h"
/* XXX
#include "PitchDetectionTest.h"
*/
// Helper class to ensure that each row is only judged once without taking too much memory.
class JudgedRows
@@ -611,7 +614,11 @@ void Player::Update( float fDeltaTime )
float fHoldJudgeYPos = SCALE( fPercentReverse, 0.f, 1.f, HOLD_JUDGMENT_Y_STANDARD, HOLD_JUDGMENT_Y_REVERSE );
// float fGrayYPos = SCALE( fPercentReverse, 0.f, 1.f, GRAY_ARROWS_Y_STANDARD, GRAY_ARROWS_Y_REVERSE );
const float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );
float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );
/* XXX
if( PitchDetectionTest::s_ms.bVoiced )
fX += ArrowEffects::GetXOffset( m_pPlayerState, m_pPlayerState->m_fWrappedMidiNote );
*/
const float fZ = ArrowEffects::GetZPos( m_pPlayerState, c, 0 );
m_vpHoldJudgment[c]->SetX( fX );
@@ -895,8 +902,22 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
}
else
{
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
bIsHoldingButton &= INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
if( GAMESTATE->m_pCurGame->m_szName == RString("karaoke") )
{
int8_t iMidiNote = trtn->pTN->iMidiNote;
ASSERT( iMidiNote != MIDI_NOTE_INVALID );
/* XXX
const float fMidiNoteMaxAllowedError = 0.25;
bIsHoldingButton &=
PitchDetectionTest::s_ms.bVoiced &&
fabsf( m_pPlayerState->m_fWrappedMidiNote - iMidiNote) < fMidiNoteMaxAllowedError;
*/
}
else
{
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
bIsHoldingButton &= INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
}
}
}
@@ -2359,7 +2380,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
Step( iTrack, iRow, now, false, false );
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY )
{
STATSMAN->m_CurStageStats.m_bUsedAutoplay = true;
if( m_pPlayerStageStats )
m_pPlayerStageStats->m_bDisqualified = true;
}
@@ -2433,6 +2454,18 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
}
m_iFirstUncrossedRow = iLastRowCrossed+1;
{
// find the next note and fill in m_fUpcomingMidiNote
NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( iLastRowCrossed+1, MAX_NOTE_ROW );
for( ; !iter.IsAtEnd(); ++iter )
{
TapNote &tn = *iter;
if( tn.iMidiNote != MIDI_NOTE_INVALID )
m_pPlayerState->m_fUpcomingMidiNote = tn.iMidiNote;
break;
}
}
}
void Player::RandomizeNotes( int iNoteRow )