throw away inputs that queued while the screen was loading

This commit is contained in:
Chris Danford
2005-03-16 23:26:19 +00:00
parent 90f2aeaa1a
commit 9b2b8e73a8
3 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -97,6 +97,8 @@ ScreenOptions::ScreenOptions( CString sClassName ) : ScreenWithMenuElements(sCla
SEPARATE_EXIT_ROW_Y (m_sName,"SeparateExitRowY"),
OPTION_ROW_TYPE (m_sName,"OptionRowType")
{
m_fLockInputSecs = 0.0001f; // always lock for a tiny amount of time so that we throw away any queued inputs during the load.
LOG->Trace( "ScreenOptions::ScreenOptions()" );
}
@@ -484,6 +486,8 @@ void ScreenOptions::Update( float fDeltaTime )
{
//LOG->Trace( "ScreenOptions::Update(%f)", fDeltaTime );
m_fLockInputSecs = max( 0, m_fLockInputSecs-fDeltaTime );
ScreenWithMenuElements::Update( fDeltaTime );
}
@@ -496,7 +500,7 @@ void ScreenOptions::Input( const DeviceInput& DeviceI, const InputEventType sele
{
/* Allow input when transitioning in (m_In.IsTransitioning()), but ignore it
* when we're transitioning out. */
if( m_Back.IsTransitioning() || m_Out.IsTransitioning() )
if( m_Back.IsTransitioning() || m_Out.IsTransitioning() || m_fLockInputSecs > 0 )
return;
if( selectType == IET_RELEASE )