From 378b4383895dd62dc27628f1c4c9cc335f588dcd Mon Sep 17 00:00:00 2001 From: Thai Pangsakulyanont Date: Wed, 11 May 2011 21:22:18 +0700 Subject: [PATCH] [splittiming] screenedit now behaves (just moving around, charting process not tested) some work need to be done on snapping and transitioning between editing and playing. --- src/ScreenEdit.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 60d90a09d9..76ae67a362 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -1142,26 +1142,30 @@ void ScreenEdit::UpdateTextInfo() void ScreenEdit::DrawPrimitives() { - // HACK: Draw using the trailing beat - float fSongBeat = GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat; // save song beat - float fSongBeatNoOffset = GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeatNoOffset; - float fSongBeatVisible = GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeatVisible; - if( !m_pSoundMusic->IsPlaying() ) + if( m_pSoundMusic->IsPlaying() ) { - GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = m_fTrailingBeat; // put trailing beat in effect - GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeatNoOffset = m_fTrailingBeat; // put trailing beat in effect - GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeatVisible = m_fTrailingBeat; // put trailing beat in effect + ScreenWithMenuElements::DrawPrimitives(); + return; } + // HACK: Draw using the trailing beat + PlayerState *pPlayerState = const_cast (m_NoteFieldEdit.GetPlayerState()); + + float fSongBeat = pPlayerState->m_Position.m_fSongBeat; // save song beat + float fSongBeatNoOffset = pPlayerState->m_Position.m_fSongBeatNoOffset; + float fSongBeatVisible = pPlayerState->m_Position.m_fSongBeatVisible; + + pPlayerState->m_Position.m_fSongBeat = m_fTrailingBeat; // put trailing beat in effect + pPlayerState->m_Position.m_fSongBeatNoOffset = m_fTrailingBeat; // put trailing beat in effect + pPlayerState->m_Position.m_fSongBeatVisible = m_fTrailingBeat; // put trailing beat in effect + ScreenWithMenuElements::DrawPrimitives(); - if( !m_pSoundMusic->IsPlaying() ) - { - GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = fSongBeat; // restore real song beat - GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeatNoOffset = fSongBeatNoOffset; - GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeatVisible = fSongBeatVisible; - } + pPlayerState->m_Position.m_fSongBeat = fSongBeat; // restore real song beat + pPlayerState->m_Position.m_fSongBeatNoOffset = fSongBeatNoOffset; + pPlayerState->m_Position.m_fSongBeatVisible = fSongBeatVisible; + } void ScreenEdit::Input( const InputEventPlus &input )