From 881a6534e82b45b2e22f1449039b163a9d35bf33 Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sun, 5 Jun 2011 15:37:22 +0200 Subject: [PATCH 1/3] [loading window] Unloading should be reported as well. --- Themes/_fallback/Languages/en.ini | 2 ++ src/SongManager.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 1884302235..81723d3615 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1657,6 +1657,8 @@ Error adding file '%s'.=Error adding file '%s'. Loading courses...=Loading courses... Loading songs...=Loading songs... Reloading...=Reloading... +Unloading songs...=Unloading songs... +Unloading courses...=Unloading courses... The folder "%s" appears to be a song folder. All song folders must reside in a group folder. For example, "Songs/Originals/My Song".=The folder "%s" appears to be a song folder. All song folders must reside in a group folder. For example, "Songs/Originals/My Song" will contain the music file (MP3, OGG...), the steps file (.sm, .dwi, .ksf...) and other related files. [SongUtil] diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 8b1ca6b2a6..804bc2aa5b 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -98,6 +98,8 @@ void SongManager::InitAll() } static LocalizedString RELOADING ( "SongManager", "Reloading..." ); +static LocalizedString UNLOADING_SONGS ( "SongManager", "Unloading songs..." ); +static LocalizedString UNLOADING_COURSES ( "SongManager", "Unloading courses..." ); void SongManager::Reload( bool bAllowFastLoad ) { FILEMAN->FlushDirCache( SpecialFiles::SONGS_DIR ); @@ -112,7 +114,13 @@ void SongManager::Reload( bool bAllowFastLoad ) // save scores before unloading songs, of the scores will be lost PROFILEMAN->SaveMachineProfile(); + if( pLoadingWindow ) + pLoadingWindow->SetText( UNLOADING_COURSES ); + FreeCourses(); + + if( pLoadingWindow ) + pLoadingWindow->SetText( UNLOADING_SONGS ); FreeSongs(); const bool OldVal = PREFSMAN->m_bFastLoad; From 6d0f3f9db451280ae0d69c870389ed590c1cd863 Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sun, 5 Jun 2011 15:40:41 +0200 Subject: [PATCH 2/3] [loading window] Might as well expose thread specific versions too. --- src/RageThreads.cpp | 11 +++++++++++ src/RageThreads.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index 5b86d22999..1396fb869b 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -322,6 +322,17 @@ int RageThread::Wait() return ret; } +void RageThread::Halt(bool Kill) { + ASSERT( m_pSlot != NULL ); + ASSERT( m_pSlot->m_pImpl != NULL ); + m_pSlot->m_pImpl->Halt(Kill); +} + +void RageThread::Resume() { + ASSERT( m_pSlot != NULL ); + ASSERT( m_pSlot->m_pImpl != NULL ); + m_pSlot->m_pImpl->Resume(); +} void RageThread::HaltAllThreads( bool Kill ) { diff --git a/src/RageThreads.h b/src/RageThreads.h index 5f43ccc330..1fc7c7f49f 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -15,6 +15,9 @@ public: RString GetName() const { return m_sName; } void Create( int (*fn)(void *), void *data ); + void Halt( bool Kill=false); + void Resume(); + /* For crash handlers: kill or suspend all threads (except for * the running one) immediately. */ static void HaltAllThreads( bool Kill=false ); From 17814f36387de002d74c42292637bc8a67cd0eeb Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sun, 5 Jun 2011 15:41:20 +0200 Subject: [PATCH 3/3] [loading window] Oops, forgot to add the new files to the project. --- src/StepMania-net2010.vcxproj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/StepMania-net2010.vcxproj b/src/StepMania-net2010.vcxproj index 9f314df1dc..2dc4b6b9ca 100644 --- a/src/StepMania-net2010.vcxproj +++ b/src/StepMania-net2010.vcxproj @@ -76,7 +76,7 @@ false $(TargetDir) $(SolutionDir)/build-$(SolutionName)/$(ProjectName)/$(Configuration)\ - false + true true $(SolutionDir)$(Configuration)\ $(Configuration)\ @@ -268,7 +268,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) true ProgramDatabase 4063;4100;4127;4201;4244;4275;4355;4505;4512;4702;4786;4996;%(DisableSpecificWarnings) - true + false AnySuitable true Speed @@ -295,7 +295,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) SendErrorReport - UseLinkTimeCodeGeneration + Default archutils\Win32\mapconv "$(IntDir)$(TargetName).map" "$(TargetDir)\StepMania-fastdebug.vdi" @@ -371,6 +371,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) + @@ -1689,6 +1690,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) +