From eb764177f1dbd9c1ddc939eeab63c0189b434a6a Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 9 Jul 2006 21:51:04 +0000 Subject: [PATCH] Overlapping NoteFields is not an option. Revert. --- stepmania/src/NoteField.cpp | 29 ++++++++------------------ stepmania/src/NoteField.h | 2 -- stepmania/src/Player.cpp | 6 ------ stepmania/src/Player.h | 1 - stepmania/src/ScreenGameplay.cpp | 3 --- stepmania/src/ScreenGameplayShared.cpp | 11 +++++----- 6 files changed, 14 insertions(+), 38 deletions(-) diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 65b4df0979..bf7498a25b 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -23,7 +23,6 @@ NoteField::NoteField() { m_pNoteData = NULL; - m_pSharedNoteField = NULL; m_pCurDisplay = NULL; m_textMeasureNumber.LoadFromFont( THEME->GetPathF("Common","normal") ); @@ -53,7 +52,6 @@ void NoteField::Unload() delete it->second; m_NoteDisplays.clear(); m_pCurDisplay = NULL; - m_pSharedNoteField = NULL; memset( m_pDisplays, 0, sizeof(m_pDisplays) ); } @@ -216,8 +214,6 @@ float NoteField::GetWidth() const void NoteField::DrawBeatBar( const float fBeat ) { - if( m_pSharedNoteField ) - return; bool bIsMeasure = fmodf( fBeat, (float)BEATS_PER_MEASURE ) == 0; int iMeasureIndex = (int)fBeat / BEATS_PER_MEASURE; int iMeasureNoDisplay = iMeasureIndex+1; @@ -273,8 +269,6 @@ void NoteField::DrawBeatBar( const float fBeat ) void NoteField::DrawMarkerBar( int iBeat ) { - if( m_pSharedNoteField ) - return; float fBeat = NoteRowToBeat( iBeat ); const float fYOffset = ArrowEffects::GetYOffset( m_pPlayerState, 0, fBeat ); const float fYPos = ArrowEffects::GetYPos( m_pPlayerState, 0, fYOffset, m_fYReverseOffsetPixels ); @@ -458,11 +452,9 @@ void NoteField::DrawPrimitives() ArrowEffects::Update(); NoteDisplayCols *cur = m_pCurDisplay; - if( !m_pSharedNoteField ) - cur->m_ReceptorArrowRow.Draw(); // This will be handled by the shared NoteField - const NoteField &nf = m_pSharedNoteField ? *m_pSharedNoteField : *this; + cur->m_ReceptorArrowRow.Draw(); - const PlayerOptions ¤t_po = nf.m_pPlayerState->m_CurrentPlayerOptions; + const PlayerOptions ¤t_po = m_pPlayerState->m_CurrentPlayerOptions; // // Adjust draw range depending on some effects @@ -720,7 +712,7 @@ void NoteField::DrawPrimitives() if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) bIsInSelectionRange = (m_iBeginMarker <= iStartRow && iEndRow < m_iEndMarker); - NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? nf.m_pCurDisplay : nf.m_pDisplays[tn.pn]; + NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; displayCols->display[c].DrawHold( tn, c, iStartRow, bIsHoldingNote, bIsActive, Result, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, false, m_fYReverseOffsetPixels, (float) iFirstPixelToDraw, (float) iLastPixelToDraw ); } @@ -781,7 +773,7 @@ void NoteField::DrawPrimitives() bool bIsAddition = (tn.source == TapNote::addition); bool bIsMine = (tn.type == TapNote::mine); bool bIsAttack = (tn.type == TapNote::attack); - NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? nf.m_pCurDisplay : nf.m_pDisplays[tn.pn]; + NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; if( bIsAttack ) { @@ -797,8 +789,7 @@ void NoteField::DrawPrimitives() } } - if( !m_pSharedNoteField ) - cur->m_GhostArrowRow.Draw(); + cur->m_GhostArrowRow.Draw(); } void NoteField::FadeToFail() @@ -806,12 +797,10 @@ void NoteField::FadeToFail() m_fPercentFadeToFail = max( 0.0f, m_fPercentFadeToFail ); // this will slowly increase every Update() // don't fade all over again if this is called twice } -#define nf (m_pSharedNoteField ? *m_pSharedNoteField : *this) -void NoteField::Step( int iCol, TapNoteScore score ) { nf.m_pCurDisplay->m_ReceptorArrowRow.Step( iCol, score ); } -void NoteField::SetPressed( int iCol ) { nf.m_pCurDisplay->m_ReceptorArrowRow.SetPressed( iCol ); } -void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { nf.m_pCurDisplay->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); } -void NoteField::DidHoldNote( int iCol, HoldNoteScore score, bool bBright ) { nf.m_pCurDisplay->m_GhostArrowRow.DidHoldNote( iCol, score, bBright ); } -#undef nf +void NoteField::Step( int iCol, TapNoteScore score ) { m_pCurDisplay->m_ReceptorArrowRow.Step( iCol, score ); } +void NoteField::SetPressed( int iCol ) { m_pCurDisplay->m_ReceptorArrowRow.SetPressed( iCol ); } +void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { m_pCurDisplay->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); } +void NoteField::DidHoldNote( int iCol, HoldNoteScore score, bool bBright ) { m_pCurDisplay->m_GhostArrowRow.DidHoldNote( iCol, score, bBright ); } /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/NoteField.h b/stepmania/src/NoteField.h index 509cb2f6f0..2910d95936 100644 --- a/stepmania/src/NoteField.h +++ b/stepmania/src/NoteField.h @@ -39,7 +39,6 @@ public: void DidHoldNote( int iCol, HoldNoteScore score, bool bBright ); const PlayerState *GetPlayerState() const { return m_pPlayerState; } - void SetSharedNoteField( NoteField *nf ) { m_pSharedNoteField = nf; } int m_iBeginMarker, m_iEndMarker; // only used with MODE_EDIT @@ -59,7 +58,6 @@ protected: float GetWidth() const; const NoteData *m_pNoteData; - const NoteField *m_pSharedNoteField; float m_fPercentFadeToFail; // -1 if not fading to fail diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 3e26e4422b..df3aac7f15 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -443,12 +443,6 @@ void Player::Load( const NoteData& noteData ) } } -void Player::SetSharedNoteField( Player *pPlayer ) -{ - ASSERT( m_pNoteField ); - m_pNoteField->SetSharedNoteField( pPlayer->m_pNoteField ); -} - void Player::Update( float fDeltaTime ) { // Don't update if we havn't been loaded yet. diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 45bfc332c4..3a76ca2b73 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -75,7 +75,6 @@ public: NoteData m_NoteData; bool HasNoteField() { return m_pNoteField != NULL; } - void SetSharedNoteField( Player *pPlayer ); protected: void HandleStep( int col, const RageTimer &tm, bool bHeld ); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 64559e390a..80273bfc43 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -962,9 +962,6 @@ void ScreenGameplay::SetupSong( int iSongIndex ) pi->GetPlayerState()->Update(0); } - if( pi->m_pn != PLAYER_INVALID ) - NoteDataUtil::RemoveAllButPlayer( ndTransformed, pi->m_pn ); - // load player { NoteData nd = ndTransformed; diff --git a/stepmania/src/ScreenGameplayShared.cpp b/stepmania/src/ScreenGameplayShared.cpp index 1838a3d7be..b45b5cbdd3 100644 --- a/stepmania/src/ScreenGameplayShared.cpp +++ b/stepmania/src/ScreenGameplayShared.cpp @@ -7,20 +7,16 @@ REGISTER_SCREEN_CLASS( ScreenGameplayShared ); void ScreenGameplayShared::FillPlayerInfo( vector &vPlayerInfoOut ) { - PlayerNumber mpn = GAMESTATE->m_MasterPlayerNumber; + //PlayerNumber mpn = GAMESTATE->m_MasterPlayerNumber; vPlayerInfoOut.resize( NUM_PLAYERS ); FOREACH_PlayerNumber( pn ) vPlayerInfoOut[pn].Load( pn, MultiPlayer_INVALID, true ); - FOREACH_PlayerNumber( pn ) - { - if( pn != mpn ) - vPlayerInfoOut[pn].m_pPlayer->SetSharedNoteField( vPlayerInfoOut[mpn].m_pPlayer ); - } } PlayerInfo &ScreenGameplayShared::GetPlayerInfoForInput( const InputEventPlus& iep ) { +#if 0 const float fPositionSeconds = GAMESTATE->m_fMusicSeconds - iep.DeviceI.ts.Ago(); const float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ); const int row = BeatToNoteRow( fSongBeat ); @@ -39,6 +35,9 @@ PlayerInfo &ScreenGameplayShared::GetPlayerInfoForInput( const InputEventPlus& i index = i; } return m_vPlayerInfo[index]; +#else + return ScreenGameplay::GetPlayerInfoForInput( iep ); +#endif } /*