From 3ca9b23f4030e349cfa4d6117b27f68843003836 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 25 Jun 2003 05:35:14 +0000 Subject: [PATCH] Fix autoplay weirdness in editor --- stepmania/src/Player.cpp | 3 ++- stepmania/src/ScreenEdit.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 7cce41bb3d..72c5a96db0 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -88,7 +88,8 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi m_pScore = pScore; m_pInventory = pInventory; m_pScoreKeeper = pScoreKeeper; - m_iRowLastCrossed = -1; + m_iRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; + // m_iRowLastCrossed = -1; /* Ensure that this is up-to-date. */ GAMESTATE->m_pPosition->Load(pn); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 787c2b59f0..fb3a852972 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1461,15 +1461,17 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers ) m_EditMode = MODE_PLAYING; + /* Give a 1 measure lead-in. Set this before loading Player, so it knows + * where we're starting. */ + GAMESTATE->m_fSongBeat = m_NoteFieldEdit.m_fBeginMarker - 4; + m_Player.Load( PLAYER_1, (NoteData*)&m_NoteFieldEdit, NULL, NULL, NULL, NULL ); GAMESTATE->m_PlayerController[PLAYER_1] = PREFSMAN->m_bAutoPlay?PC_AUTOPLAY:PC_HUMAN; m_rectRecordBack.StopTweening(); m_rectRecordBack.BeginTweening( 0.5f ); m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0.8f) ); - - GAMESTATE->m_fSongBeat = m_NoteFieldEdit.m_fBeginMarker - 4; // give a 1 measure lead-in - float fStartSeconds = m_pSong->GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat) ; + const float fStartSeconds = m_pSong->GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat) ; LOG->Trace( "Starting playback at %f", fStartSeconds ); m_soundMusic.SetPlaybackRate( GAMESTATE->m_SongOptions.m_fMusicRate ); m_soundMusic.SetPositionSeconds( fStartSeconds );