diff --git a/stepmania/src/arch/Dialog/Dialog.cpp b/stepmania/src/arch/Dialog/Dialog.cpp index 75f62da893..72050b1125 100644 --- a/stepmania/src/arch/Dialog/Dialog.cpp +++ b/stepmania/src/arch/Dialog/Dialog.cpp @@ -19,6 +19,7 @@ static DialogDriver *g_pImpl = NULL; static DialogDriverNull g_pNullDriver; static bool g_bWindowed = false; +static bool g_bIsShowingDialog = false; void Dialog::Init() { @@ -59,6 +60,11 @@ void Dialog::Shutdown() g_pImpl = NULL; } +bool Dialog::IsShowingDialog() +{ + return g_bIsShowingDialog; +} + static bool MessageIsIgnored( CString ID ) { vector list; @@ -100,7 +106,11 @@ void Dialog::Error( CString sMessage, CString ID ) if( ID != "" && MessageIsIgnored( ID ) ) return; + g_bIsShowingDialog = true; + g_pImpl->Error( sMessage, ID ); + + g_bIsShowingDialog = false; } void Dialog::SetWindowed( bool bWindowed ) @@ -115,11 +125,15 @@ void Dialog::OK( CString sMessage, CString ID ) if( ID != "" && MessageIsIgnored( ID ) ) return; + g_bIsShowingDialog = true; + // only show Dialog if windowed if( !g_bWindowed ) g_pNullDriver.OK( sMessage, ID ); else g_pImpl->OK( sMessage, ID ); // call derived version + + g_bIsShowingDialog = false; } Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString ID ) @@ -129,11 +143,15 @@ Dialog::Result Dialog::AbortRetryIgnore( CString sMessage, CString ID ) if( ID != "" && MessageIsIgnored( ID ) ) return g_pNullDriver.AbortRetryIgnore( sMessage, ID ); + g_bIsShowingDialog = true; + // only show Dialog if windowed if( !g_bWindowed ) return g_pNullDriver.AbortRetryIgnore( sMessage, ID ); else return g_pImpl->AbortRetryIgnore( sMessage, ID ); // call derived version + + g_bIsShowingDialog = false; } Dialog::Result Dialog::RetryCancel( CString sMessage, CString ID ) @@ -143,11 +161,15 @@ Dialog::Result Dialog::RetryCancel( CString sMessage, CString ID ) if( ID != "" && MessageIsIgnored( ID ) ) return g_pNullDriver.RetryCancel( sMessage, ID ); + g_bIsShowingDialog = true; + // only show Dialog if windowed if( !g_bWindowed ) return g_pNullDriver.RetryCancel( sMessage, ID ); else return g_pImpl->RetryCancel( sMessage, ID ); // call derived version + + g_bIsShowingDialog = false; } /* diff --git a/stepmania/src/arch/Dialog/Dialog.h b/stepmania/src/arch/Dialog/Dialog.h index c99453dc9e..d770efdf80 100644 --- a/stepmania/src/arch/Dialog/Dialog.h +++ b/stepmania/src/arch/Dialog/Dialog.h @@ -9,6 +9,7 @@ namespace Dialog void Shutdown(); void SetWindowed( bool bWindowed ); + bool IsShowingDialog(); enum Result { abort, retry, ignore, cancel }; void Error( CString error, CString ID = "" ); diff --git a/stepmania/src/arch/Threads/Threads_Win32.cpp b/stepmania/src/arch/Threads/Threads_Win32.cpp index ce46773323..ad6d1437fd 100644 --- a/stepmania/src/arch/Threads/Threads_Win32.cpp +++ b/stepmania/src/arch/Threads/Threads_Win32.cpp @@ -188,12 +188,14 @@ void SemaImpl_Win32::Post() bool SemaImpl_Win32::Wait() { - int len = 15000; + int len = 60000; int tries = 2; while( tries-- ) { - /* Wait for fifteen seconds. If it takes longer than that, we're probably deadlocked. */ + /* Wait for 60 seconds. In debug builds, some screens may take longer + * than 15 seconds to load. If it takes longer than that, we're + * probably deadlocked. */ if( SimpleWaitForSingleObject( sem, len ) ) { --m_iCounter;