update textinfo after each keypress, so changes don't appear lagged
This commit is contained in:
@@ -455,7 +455,19 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
if(m_EditMode == MODE_PLAYING && PlayTicks())
|
if(m_EditMode == MODE_PLAYING && PlayTicks())
|
||||||
m_soundAssistTick.Play();
|
m_soundAssistTick.Play();
|
||||||
|
|
||||||
|
static float fUpdateCounter = 0;
|
||||||
|
fUpdateCounter -= fDeltaTime;
|
||||||
|
if( fUpdateCounter < 0 )
|
||||||
|
{
|
||||||
|
fUpdateCounter = 0.5;
|
||||||
|
UpdateTextInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenEdit::UpdateTextInfo()
|
||||||
|
{
|
||||||
|
int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes();
|
||||||
|
int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes();
|
||||||
|
|
||||||
CString sNoteType;
|
CString sNoteType;
|
||||||
switch( m_SnapDisplay.GetNoteType() )
|
switch( m_SnapDisplay.GetNoteType() )
|
||||||
@@ -469,16 +481,6 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
default: ASSERT(0);
|
default: ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static float fUpdateCounter = 0.5;
|
|
||||||
fUpdateCounter -= fDeltaTime;
|
|
||||||
if( fUpdateCounter < 0 )
|
|
||||||
{
|
|
||||||
fUpdateCounter = 0.5;
|
|
||||||
|
|
||||||
int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes();
|
|
||||||
int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes();
|
|
||||||
|
|
||||||
CString sText;
|
CString sText;
|
||||||
sText += ssprintf( "Current Beat:\n %.2f\n", GAMESTATE->m_fSongBeat );
|
sText += ssprintf( "Current Beat:\n %.2f\n", GAMESTATE->m_fSongBeat );
|
||||||
sText += ssprintf( "Snap to:\n %s\n", sNoteType.GetString() );
|
sText += ssprintf( "Snap to:\n %s\n", sNoteType.GetString() );
|
||||||
@@ -494,10 +496,8 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
sText += ssprintf( "Preview Length:\n %.2f secs\n",m_pSong->m_fMusicSampleLengthSeconds );
|
sText += ssprintf( "Preview Length:\n %.2f secs\n",m_pSong->m_fMusicSampleLengthSeconds );
|
||||||
|
|
||||||
m_textInfo.SetText( sText );
|
m_textInfo.SetText( sText );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScreenEdit::DrawPrimitives()
|
void ScreenEdit::DrawPrimitives()
|
||||||
{
|
{
|
||||||
// m_rectRecordBack.Draw();
|
// m_rectRecordBack.Draw();
|
||||||
@@ -942,6 +942,10 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
HandleAreaMenuChoice( delete_and_shift, NULL );
|
HandleAreaMenuChoice( delete_and_shift, NULL );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure the displayed time is up-to-date after possibly changing something,
|
||||||
|
* so it doesn't feel lagged. */
|
||||||
|
UpdateTextInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ protected:
|
|||||||
void TransitionToEdit();
|
void TransitionToEdit();
|
||||||
bool PlayTicks() const;
|
bool PlayTicks() const;
|
||||||
void PlayPreviewMusic();
|
void PlayPreviewMusic();
|
||||||
|
void UpdateTextInfo();
|
||||||
|
|
||||||
void OnSnapModeChange();
|
void OnSnapModeChange();
|
||||||
void MenuItemGainFocus( BitmapText* menuitem );
|
void MenuItemGainFocus( BitmapText* menuitem );
|
||||||
|
|||||||
Reference in New Issue
Block a user