diff --git a/Themes/_fallback/Fonts/ScreenReloadSongs LoadingText.redir b/Themes/_fallback/Fonts/InGameLoadingWindow LoadingText.redir similarity index 100% rename from Themes/_fallback/Fonts/ScreenReloadSongs LoadingText.redir rename to Themes/_fallback/Fonts/InGameLoadingWindow LoadingText.redir diff --git a/Themes/_fallback/Graphics/Progressbar Indeterminate.png b/Themes/_fallback/Graphics/Progressbar Indeterminate.png new file mode 100644 index 0000000000..c781e5d06e Binary files /dev/null and b/Themes/_fallback/Graphics/Progressbar Indeterminate.png differ diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 75e0cfdf1b..4bdf6c7716 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1662,6 +1662,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/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index fbe2913e32..7aed8f48e3 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -1661,6 +1661,8 @@ AAFF41A40F5BD4AD00FFDB67 /* ScreenOptionsExportPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = AAFF41A20F5BD4AD00FFDB67 /* ScreenOptionsExportPackage.h */; }; AAFF41A50F5BD4AD00FFDB67 /* ScreenOptionsExportPackage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAFF41A10F5BD4AD00FFDB67 /* ScreenOptionsExportPackage.cpp */; }; AAFF41A60F5BD4AD00FFDB67 /* ScreenOptionsExportPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = AAFF41A20F5BD4AD00FFDB67 /* ScreenOptionsExportPackage.h */; }; + B71A60C0139B41DB00183A27 /* InGameLoadingWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B71A60BE139B41DB00183A27 /* InGameLoadingWindow.cpp */; }; + B71A60C1139B41DB00183A27 /* InGameLoadingWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = B71A60BF139B41DB00183A27 /* InGameLoadingWindow.h */; }; B75CE3B5137963350076A82D /* SongPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = B75CE3B3137963350076A82D /* SongPosition.h */; }; B75CE3B6137963350076A82D /* SongPosition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B75CE3B4137963350076A82D /* SongPosition.cpp */; }; EE2153A910A75BEE0074B01B /* NotesLoaderPMS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EE2153A710A75BEE0074B01B /* NotesLoaderPMS.cpp */; }; @@ -3056,6 +3058,8 @@ AAFF55220549F43A00D02EE9 /* ComboGraph.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = ComboGraph.h; path = ../src/ComboGraph.h; sourceTree = ""; }; AAFF5541054E736D00D02EE9 /* Attack.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; name = Attack.cpp; path = ../src/Attack.cpp; sourceTree = ""; }; AAFF5542054E736D00D02EE9 /* Attack.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = Attack.h; path = ../src/Attack.h; sourceTree = ""; }; + B71A60BE139B41DB00183A27 /* InGameLoadingWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InGameLoadingWindow.cpp; path = ../src/InGameLoadingWindow.cpp; sourceTree = ""; }; + B71A60BF139B41DB00183A27 /* InGameLoadingWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InGameLoadingWindow.h; path = ../src/InGameLoadingWindow.h; sourceTree = ""; }; B75CE3B3137963350076A82D /* SongPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SongPosition.h; path = ../src/SongPosition.h; sourceTree = SOURCE_ROOT; }; B75CE3B4137963350076A82D /* SongPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SongPosition.cpp; path = ../src/SongPosition.cpp; sourceTree = SOURCE_ROOT; }; EE2153A710A75BEE0074B01B /* NotesLoaderPMS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NotesLoaderPMS.cpp; path = ../src/NotesLoaderPMS.cpp; sourceTree = SOURCE_ROOT; }; @@ -4094,6 +4098,8 @@ AA6EFE9104770E7C005F316C /* GrooveRadar.h */, AA6EFE9404770E7C005F316C /* HelpDisplay.cpp */, AA6EFE9504770E7C005F316C /* HelpDisplay.h */, + B71A60BE139B41DB00183A27 /* InGameLoadingWindow.cpp */, + B71A60BF139B41DB00183A27 /* InGameLoadingWindow.h */, AA729C460599B54D00779F33 /* MemoryCardDisplay.cpp */, AA729C470599B54D00779F33 /* MemoryCardDisplay.h */, AA6EFE9A04770E7C005F316C /* MenuTimer.cpp */, @@ -5148,6 +5154,7 @@ 2B9C2E8E137A138B004C92F3 /* NotesLoaderJson.h in Headers */, 2B9C2E90137A138B004C92F3 /* NotesWriterJson.h in Headers */, 2B43509513949F37006FA051 /* TimingSegments.h in Headers */, + B71A60C1139B41DB00183A27 /* InGameLoadingWindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -6489,6 +6496,7 @@ 2BD06FF2137242680018CB9F /* json_value.cpp in Sources */, 2BD06FF4137242680018CB9F /* json_writer.cpp in Sources */, 2B43509613949F37006FA051 /* TimingSegments.cpp in Sources */, + B71A60C0139B41DB00183A27 /* InGameLoadingWindow.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/CommandLineActions.cpp b/src/CommandLineActions.cpp index ef5f26b10c..3a45380b87 100644 --- a/src/CommandLineActions.cpp +++ b/src/CommandLineActions.cpp @@ -108,7 +108,7 @@ static void Version() #endif // WIN32 } -void CommandLineActions::Handle(LoadingWindow* pLW) +void CommandLineActions::Handle() { CommandLineArgs args; for(int i=0; iGetPathF(m_sName, "LoadingText") ); + m_Text.SetXY(0,0); + AddChild(&m_Text); +} + +InGameLoadingWindow::~InGameLoadingWindow() { + RemoveChild(&m_Text); +} + +void InGameLoadingWindow::SetText( RString str ) { + textChanged=true; + currentText=str; +} + +void InGameLoadingWindow::Update(float delta) { + if(textChanged) { + m_Text.SetText( currentText ); + textChanged=false; + } +} diff --git a/src/InGameLoadingWindow.h b/src/InGameLoadingWindow.h new file mode 100644 index 0000000000..431be5119f --- /dev/null +++ b/src/InGameLoadingWindow.h @@ -0,0 +1,21 @@ +#include "arch/LoadingWindow/LoadingWindow.h" +#include "BitmapText.h" +#include "RageTimer.h" +#include "global.h" +#include "ActorFrame.h" + +class InGameLoadingWindow: public LoadingWindow, public ActorFrame { + +public: + InGameLoadingWindow(); + ~InGameLoadingWindow(); + + void SetText( RString str ); + void Update ( float delta ); + +private: + bool textChanged; + RString currentText; + BitmapText m_Text; +}; + 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 ); diff --git a/src/ScreenInstallOverlay.cpp b/src/ScreenInstallOverlay.cpp index c9840ea7a0..25561e7d8d 100644 --- a/src/ScreenInstallOverlay.cpp +++ b/src/ScreenInstallOverlay.cpp @@ -360,7 +360,7 @@ void ScreenInstallOverlay::Update( float fDeltaTime ) } if( playAfterLaunchInfo.bAnySongChanged ) - SONGMAN->Reload( false, NULL ); + SONGMAN->Reload( false ); if( !playAfterLaunchInfo.sSongDir.empty() ) { diff --git a/src/ScreenReloadSongs.cpp b/src/ScreenReloadSongs.cpp index 0129f1a645..7cd7360355 100644 --- a/src/ScreenReloadSongs.cpp +++ b/src/ScreenReloadSongs.cpp @@ -6,38 +6,8 @@ #include "RageLog.h" #include "ThemeManager.h" #include "ScreenDimensions.h" - #include "arch/LoadingWindow/LoadingWindow.h" - -static const int DrawFrameRate = 20; -class ScreenReloadSongsLoadingWindow: public LoadingWindow -{ - RageTimer m_LastDraw; - BitmapText &m_BitmapText; - -public: - ScreenReloadSongsLoadingWindow( BitmapText &bt ): - m_BitmapText(bt) - { - } - - void SetText( RString str ) - { - m_BitmapText.SetText( str ); - Paint(); - } - - void Paint() - { - /* We load songs much faster than we draw frames. Cap the draw rate, - * so we don't slow down the reload. */ - if( m_LastDraw.PeekDeltaTime() < 1.0f/DrawFrameRate ) - return; - m_LastDraw.GetDeltaTime(); - - SCREENMAN->Draw(); - } -}; +#include "InGameLoadingWindow.h" /* This could be cleaned up: show progress, for example. Let's not use * this for the initial load, since we don't want to start up the display @@ -45,39 +15,40 @@ public: * computer while songs load. */ REGISTER_SCREEN_CLASS( ScreenReloadSongs ); +ScreenReloadSongs::ScreenReloadSongs() {} + void ScreenReloadSongs::Init() { Screen::Init(); - m_iUpdates = 0; + loadWin=new InGameLoadingWindow( ); - m_Loading.SetName("LoadingText"); - m_Loading.LoadFromFont( THEME->GetPathF(m_sName, "LoadingText") ); - m_Loading.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y ); - this->AddChild( &m_Loading ); + AddChild( loadWin ); - m_LoadingWindow = new ScreenReloadSongsLoadingWindow( m_Loading ); + loadWin->SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y ); + + pLoadingWindow=loadWin; + + m_loadingThread.SetName("Song reload work thread"); + m_loadingThread.Create(loadingThreadProc,this); } ScreenReloadSongs::~ScreenReloadSongs() { - delete m_LoadingWindow; + m_loadingThread.Wait(); + RemoveChild(loadWin); + delete loadWin; } +int ScreenReloadSongs::loadingThreadProc(void *thisAsVoidPtr) { -void ScreenReloadSongs::Update( float fDeltaTime ) -{ - Screen::Update( fDeltaTime ); + ScreenReloadSongs *self=(ScreenReloadSongs *)thisAsVoidPtr; - /* Start the reload on the second update. On the first (0), SCREENMAN->Draw won't draw. */ - ++m_iUpdates; - if( m_iUpdates != 2 ) - return; - ASSERT( !IsFirstUpdate() ); - - SONGMAN->Reload( false, m_LoadingWindow ); + SONGMAN->Reload( false ); SCREENMAN->PostMessageToTopScreen( SM_GoToNextScreen, 0 ); + + return 0; } /* diff --git a/src/ScreenReloadSongs.h b/src/ScreenReloadSongs.h index 860bdd28f7..39676e8dff 100644 --- a/src/ScreenReloadSongs.h +++ b/src/ScreenReloadSongs.h @@ -2,20 +2,20 @@ #define SCREEN_RELOAD_SONGS_H #include "Screen.h" -#include "BitmapText.h" -class LoadingWindow; +#include "RageThreads.h" + +class InGameLoadingWindow; class ScreenReloadSongs: public Screen { public: + ScreenReloadSongs(); virtual void Init(); ~ScreenReloadSongs(); - void Update( float fDeltaTime ); - private: - int m_iUpdates; - LoadingWindow *m_LoadingWindow; - BitmapText m_Loading; + InGameLoadingWindow *loadWin; + RageThread m_loadingThread; + static int loadingThreadProc(void *thisAsVoidPtr); }; #endif diff --git a/src/SongManager.cpp b/src/SongManager.cpp index e25374c739..56afe8f93e 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -88,16 +88,19 @@ SongManager::~SongManager() FreeSongs(); } -void SongManager::InitAll( LoadingWindow *ld ) +void SongManager::InitAll() { - InitSongsFromDisk( ld ); - InitCoursesFromDisk( ld ); + InitSongsFromDisk(); + + InitCoursesFromDisk(); InitAutogenCourses(); InitRandomAttacks(); } static LocalizedString RELOADING ( "SongManager", "Reloading..." ); -void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld ) +static LocalizedString UNLOADING_SONGS ( "SongManager", "Unloading songs..." ); +static LocalizedString UNLOADING_COURSES ( "SongManager", "Unloading courses..." ); +void SongManager::Reload( bool bAllowFastLoad ) { FILEMAN->FlushDirCache( SpecialFiles::SONGS_DIR ); FILEMAN->FlushDirCache( ADDITIONAL_SONGS_DIR ); @@ -105,20 +108,26 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld ) FILEMAN->FlushDirCache( ADDITIONAL_COURSES_DIR ); FILEMAN->FlushDirCache( EDIT_SUBDIR ); - if( ld ) - ld->SetText( RELOADING ); + if( pLoadingWindow ) + pLoadingWindow->SetText( RELOADING ); // 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; if( !bAllowFastLoad ) PREFSMAN->m_bFastLoad.Set( false ); - InitAll( ld ); + InitAll(); // reload scores and unlocks afterward PROFILEMAN->LoadMachineProfile(); @@ -130,14 +139,14 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld ) UpdatePreferredSort(); } -void SongManager::InitSongsFromDisk( LoadingWindow *ld ) +void SongManager::InitSongsFromDisk() { RageTimer tm; - LoadStepManiaSongDir( SpecialFiles::SONGS_DIR, ld ); + LoadStepManiaSongDir( SpecialFiles::SONGS_DIR); const bool bOldVal = PREFSMAN->m_bFastLoad; PREFSMAN->m_bFastLoad.Set( PREFSMAN->m_bFastLoadAdditionalSongs ); - LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR, ld ); + LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR ); PREFSMAN->m_bFastLoad.Set( bOldVal ); LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() ); @@ -224,7 +233,7 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName ) } static LocalizedString LOADING_SONGS ( "SongManager", "Loading songs..." ); -void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) +void SongManager::LoadStepManiaSongDir( RString sDir ) { // Make sure sDir has a trailing slash. if( sDir.Right(1) != "/" ) @@ -236,11 +245,16 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) SortRStringArray( arrayGroupDirs ); StripCvsAndSvn( arrayGroupDirs ); StripMacResourceForks( arrayGroupDirs ); - + + vector< vector > arrayGroupSongDirs; + int groupIndex, songCount, songIndex; + + groupIndex = 0; + songCount = 0; FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/ { + RString sGroupDirName = *s; - SanityCheckGroupDir(sDir+sGroupDirName); // Find all Song folders in this group directory @@ -249,6 +263,25 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) StripCvsAndSvn( arraySongDirs ); StripMacResourceForks( arraySongDirs ); SortRStringArray( arraySongDirs ); + + arrayGroupSongDirs.push_back(arraySongDirs); + songCount += arraySongDirs.size(); + + } + + if( songCount==0 ) return; + + if( pLoadingWindow ) { + pLoadingWindow->SetIndeterminate( false ); + pLoadingWindow->SetTotalWork( songCount ); + } + + groupIndex = 0; + songIndex = 0; + FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/ + { + RString sGroupDirName = *s; + vector &arraySongDirs = arrayGroupSongDirs[groupIndex++]; LOG->Trace("Attempting to load %i songs from \"%s\"", int(arraySongDirs.size()), (sDir+sGroupDirName).c_str() ); @@ -261,12 +294,12 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) RString sSongDirName = arraySongDirs[j]; // this is a song directory. Load a new song. - if( ld ) + if( pLoadingWindow ) { - ld->SetText( LOADING_SONGS.GetValue()+ssprintf("\n%s\n%s", + pLoadingWindow->SetProgress(songIndex); + pLoadingWindow->SetText( LOADING_SONGS.GetValue()+ssprintf("\n%s\n%s", Basename(sGroupDirName).c_str(), Basename(sSongDirName).c_str())); - ld->Paint(); } Song* pNewSong = new Song; if( !pNewSong->LoadFromSongDir( sSongDirName ) ) @@ -279,6 +312,7 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) m_pSongs.push_back( pNewSong ); index_entry.push_back( pNewSong ); loaded++; + songIndex++; } LOG->Trace("Loaded %i songs from \"%s\"", loaded, (sDir+sGroupDirName).c_str() ); @@ -296,6 +330,10 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) LoadGroupSymLinks(sDir, sGroupDirName); } + if( pLoadingWindow ) { + pLoadingWindow->SetIndeterminate( true ); + } + LoadEnabledSongsFromPref(); } @@ -720,7 +758,7 @@ RString SongManager::ShortenGroupName( RString sLongGroupName ) } static LocalizedString LOADING_COURSES ( "SongManager", "Loading courses..." ); -void SongManager::InitCoursesFromDisk( LoadingWindow *ld ) +void SongManager::InitCoursesFromDisk() { LOG->Trace( "Loading courses." ); @@ -750,12 +788,11 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld ) FOREACH_CONST( RString, vsCoursePaths, sCoursePath ) { - if( ld ) + if( pLoadingWindow ) { - ld->SetText( LOADING_COURSES.GetValue()+ssprintf("\n%s\n%s", + pLoadingWindow->SetText( LOADING_COURSES.GetValue()+ssprintf("\n%s\n%s", Basename(*sCourseGroup).c_str(), Basename(*sCoursePath).c_str())); - ld->Paint(); } Course* pCourse = new Course; diff --git a/src/SongManager.h b/src/SongManager.h index 1c48792e30..4df49feae7 100644 --- a/src/SongManager.h +++ b/src/SongManager.h @@ -1,7 +1,6 @@ #ifndef SONGMANAGER_H #define SONGMANAGER_H -class LoadingWindow; class Song; class Style; class Steps; @@ -31,7 +30,7 @@ public: SongManager(); ~SongManager(); - void InitSongsFromDisk( LoadingWindow *ld ); + void InitSongsFromDisk(); void FreeSongs(); void Cleanup(); @@ -49,7 +48,7 @@ public: void LoadGroupSymLinks( RString sDir, RString sGroupFolder ); - void InitCoursesFromDisk( LoadingWindow *ld ); + void InitCoursesFromDisk(); void InitAutogenCourses(); void InitRandomAttacks(); void FreeCourses(); @@ -59,8 +58,8 @@ public: void DeleteAutogenCourses(); void InvalidateCachedTrails(); - void InitAll( LoadingWindow *ld ); // songs, courses, groups - everything. - void Reload( bool bAllowFastLoad, LoadingWindow *ld=NULL ); // songs, courses, groups - everything. + void InitAll(); // songs, courses, groups - everything. + void Reload( bool bAllowFastLoad); // songs, courses, groups - everything. void PreloadSongImages(); RString GetSongGroupBannerPath( RString sSongGroup ) const; @@ -166,7 +165,7 @@ public: void PushSelf( lua_State *L ); protected: - void LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ); + void LoadStepManiaSongDir( RString sDir ); void LoadDWISongDir( RString sDir ); bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut ); void SanityCheckGroupDir( RString sDir ) const; diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index bcc20ea4b9..4498df5d04 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -81,7 +81,7 @@ + + diff --git a/src/StepMania-net2010.vcxproj b/src/StepMania-net2010.vcxproj index c1aef5d7d2..c350d25de4 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)\ @@ -149,7 +149,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) ../Program/StepMania-debug.exe true ..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories) @@ -216,7 +216,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) ../Program/StepMania.exe true ..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories) @@ -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 @@ -280,7 +280,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;avcodec.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) ../Program/StepMania-fastdebug.exe true ..\extern\libpng\lib;ffmpeg\modern_working\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\;%(AdditionalLibraryDirectories) @@ -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" @@ -349,7 +349,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) ..\Program/StepMania-SSE2.exe true ..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories) @@ -643,6 +643,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) + @@ -1689,6 +1690,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) + @@ -2395,4 +2397,4 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) - + \ No newline at end of file diff --git a/src/StepMania-net2010.vcxproj.filters b/src/StepMania-net2010.vcxproj.filters index 0d28f9a2c7..7c21d06c80 100644 --- a/src/StepMania-net2010.vcxproj.filters +++ b/src/StepMania-net2010.vcxproj.filters @@ -1629,6 +1629,9 @@ Data Structures + + Actors used in Menus + @@ -3026,6 +3029,9 @@ Data Structures + + Actors used in Menus + @@ -3154,4 +3160,4 @@ BaseClasses - + \ No newline at end of file diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 97a897820a..e72f6f621d 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -1011,7 +1011,7 @@ int main(int argc, char* argv[]) GAMESTATE = new GameState; // This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. - LoadingWindow *pLoadingWindow = LoadingWindow::Create(); + pLoadingWindow = LoadingWindow::Create(); if(pLoadingWindow == NULL) RageException::Throw("%s", COULDNT_OPEN_LOADING_WINDOW.GetValue().c_str()); @@ -1037,7 +1037,7 @@ int main(int argc, char* argv[]) // Switch to the last used game type, and set up the theme and announcer. SwitchToLastPlayedGame(); - CommandLineActions::Handle(pLoadingWindow); + CommandLineActions::Handle(); if( GetCommandlineArgument("dopefish") ) GAMESTATE->m_bDopefish = true; @@ -1054,40 +1054,57 @@ int main(int argc, char* argv[]) if( PREFSMAN->m_iSoundWriteAhead ) LOG->Info( "Sound writeahead has been overridden to %i", PREFSMAN->m_iSoundWriteAhead.Get() ); + + pLoadingWindow->SetText("Starting sound subsystem..."); SOUNDMAN = new RageSoundManager; SOUNDMAN->Init(); SOUNDMAN->SetMixVolume(); SOUND = new GameSoundManager; + pLoadingWindow->SetText("Initializing bookkeeper..."); BOOKKEEPER = new Bookkeeper; + pLoadingWindow->SetText("Starting lights subsystem..."); LIGHTSMAN = new LightsManager; INPUTFILTER = new InputFilter; INPUTMAPPER = new InputMapper; + pLoadingWindow->SetText("Loading game type..."); StepMania::ChangeCurrentGame( GAMESTATE->GetCurrentGame() ); INPUTQUEUE = new InputQueue; + pLoadingWindow->SetText("Building song cache index..."); SONGINDEX = new SongCacheIndex; + pLoadingWindow->SetText("Loading banner cache..."); BANNERCACHE = new BannerCache; //BACKGROUNDCACHE = new BackgroundCache; // depends on SONGINDEX: SONGMAN = new SongManager; - SONGMAN->InitAll( pLoadingWindow ); // this takes a long time + SONGMAN->InitAll(); // this takes a long time CRYPTMAN = new CryptManager; // need to do this before ProfileMan if( PREFSMAN->m_bSignProfileData ) CRYPTMAN->GenerateGlobalKeys(); + pLoadingWindow->SetText("Initializing memory card system..."); MEMCARDMAN = new MemoryCardManager; + pLoadingWindow->SetText("Initializing character system..."); CHARMAN = new CharacterManager; + pLoadingWindow->SetText("Initializing profile system..."); PROFILEMAN = new ProfileManager; PROFILEMAN->Init(); // must load after SONGMAN UNLOCKMAN = new UnlockManager; + pLoadingWindow->SetText("Updating popular song list..."); SONGMAN->UpdatePopular(); SONGMAN->UpdatePreferredSort(); NSMAN = new NetworkSyncManager( pLoadingWindow ); + pLoadingWindow->SetText("Initializing message system..."); MESSAGEMAN = new MessageManager; + pLoadingWindow->SetText("Initializing statics manager..."); STATSMAN = new StatsManager; + // Initialize which courses are ranking courses here. + pLoadingWindow->SetText("Updating cource rankings..."); + SONGMAN->UpdateRankingCourses(); + SAFE_DELETE( pLoadingWindow ); // destroy this before init'ing Display /* If the user has tried to quit during the loading, do it before creating @@ -1127,9 +1144,6 @@ int main(int argc, char* argv[]) CodeDetector::RefreshCacheItems(); - // Initialize which courses are ranking courses here. - SONGMAN->UpdateRankingCourses(); - if( GetCommandlineArgument("netip") ) NSMAN->DisplayStartupStatus(); // If we're using networking show what happened diff --git a/src/ThemeManager.cpp b/src/ThemeManager.cpp index 0b3841869f..0e5764c4a6 100644 --- a/src/ThemeManager.cpp +++ b/src/ThemeManager.cpp @@ -8,6 +8,7 @@ #include "RageTimer.h" #include "FontCharAliases.h" #include "arch/ArchHooks/ArchHooks.h" +#include "arch/LoadingWindow/LoadingWindow.h" #include "arch/Dialog/Dialog.h" #include "RageFile.h" #if !defined(SMPACKAGE) @@ -397,6 +398,8 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt if( bNothingChanging && !bForceThemeReload ) return; + if(pLoadingWindow) pLoadingWindow->SetText("Loading theme & language..."); + m_bPseudoLocalize = bPseudoLocalize; // Load theme metrics. If only the language is changing, this is all diff --git a/src/arch/LoadingWindow/LoadingWindow.cpp b/src/arch/LoadingWindow/LoadingWindow.cpp index 2002e81f45..c96afbff84 100644 --- a/src/arch/LoadingWindow/LoadingWindow.cpp +++ b/src/arch/LoadingWindow/LoadingWindow.cpp @@ -47,12 +47,17 @@ LoadingWindow *LoadingWindow::Create() } } - if( ret ) + if( ret ) { LOG->Info( "Loading window: %s", Driver.c_str() ); + ret->SetIndeterminate(true); + } + return ret; } +LoadingWindow *pLoadingWindow; + /* * (c) 2002-2005 Glenn Maynard * All rights reserved. diff --git a/src/arch/LoadingWindow/LoadingWindow.h b/src/arch/LoadingWindow/LoadingWindow.h index 888a265e39..4cc23cd097 100644 --- a/src/arch/LoadingWindow/LoadingWindow.h +++ b/src/arch/LoadingWindow/LoadingWindow.h @@ -11,11 +11,20 @@ public: virtual RString Init() { return RString(); } virtual ~LoadingWindow() { } - virtual void Paint() { } virtual void SetText( RString str ) = 0; virtual void SetIcon( const RageSurface *pIcon ) { } + virtual void SetProgress( const int progress ) { m_progress=progress; } + virtual void SetTotalWork( const int totalWork ) { m_totalWork=totalWork; } + virtual void SetIndeterminate( bool indeterminate ) { m_indeterminate=indeterminate; } + +protected: + int m_progress; + int m_totalWork; + bool m_indeterminate; }; +extern LoadingWindow *pLoadingWindow; + #endif /** diff --git a/src/arch/LoadingWindow/LoadingWindow_MacOSX.h b/src/arch/LoadingWindow/LoadingWindow_MacOSX.h index 29636eb7c0..3a521a3170 100644 --- a/src/arch/LoadingWindow/LoadingWindow_MacOSX.h +++ b/src/arch/LoadingWindow/LoadingWindow_MacOSX.h @@ -9,6 +9,9 @@ public: LoadingWindow_MacOSX(); ~LoadingWindow_MacOSX(); void SetText( RString str ); + void SetProgress( const int progress ); + void SetTotalWork( const int totalWork ); + void SetIndeterminate( bool indeterminate ); }; #define USE_LOADING_WINDOW_MACOSX diff --git a/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm b/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm index 4f26434a41..356d3cc638 100644 --- a/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm +++ b/src/arch/LoadingWindow/LoadingWindow_MacOSX.mm @@ -10,8 +10,12 @@ NSWindow *m_Window; NSTextView *m_Text; NSAutoreleasePool *m_Pool; + NSProgressIndicator *m_ProgressIndicator; } - (void) setupWindow:(NSImage *)image; +- (void) setProgress:(NSNumber *)progress; +- (void) setTotalWork:(NSNumber *)totalWork; +- (void) setIndeterminate:(NSNumber *)indeterminate; @end @implementation LoadingWindowHelper @@ -21,14 +25,25 @@ NSRect viewRect, windowRect; float height = 0.0f; + NSRect progressIndicatorRect; + progressIndicatorRect = NSMakeRect(0, 0, size.width, 0); + m_ProgressIndicator = [[NSProgressIndicator alloc] initWithFrame:progressIndicatorRect]; + [m_ProgressIndicator sizeToFit]; + [m_ProgressIndicator setIndeterminate:YES]; + [m_ProgressIndicator setMinValue:0]; + [m_ProgressIndicator setMaxValue:1]; + [m_ProgressIndicator setDoubleValue:0]; + progressIndicatorRect = [m_ProgressIndicator frame]; + float progressHeight = progressIndicatorRect.size.height; + NSFont *font = [NSFont systemFontOfSize:0.0f]; NSRect textRect; // Just give it a size until it is created. - textRect = NSMakeRect( 0, 0, size.width, size.height ); + textRect = NSMakeRect( 0, progressHeight, size.width, size.height ); m_Text = [[NSTextView alloc] initWithFrame:textRect]; [m_Text setFont:font]; height = [[m_Text layoutManager] defaultLineHeightForFont:font]*3 + 4; - textRect = NSMakeRect( 0, 0, size.width, height ); + textRect = NSMakeRect( 0, progressHeight, size.width, height ); [m_Text setFrame:textRect]; [m_Text setEditable:NO]; @@ -40,12 +55,12 @@ [m_Text setVerticallyResizable:NO]; [m_Text setString:@"Initializing Hardware..."]; - viewRect = NSMakeRect( 0, height, size.width, size.height ); + viewRect = NSMakeRect( 0, height + progressHeight, size.width, size.height ); NSImageView *iView = [[NSImageView alloc] initWithFrame:viewRect]; [iView setImage:image]; [iView setImageFrameStyle:NSImageFrameNone]; - windowRect = NSMakeRect( 0, 0, size.width, size.height + height ); + windowRect = NSMakeRect( 0, 0, size.width, size.height + height + progressHeight); m_Window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered @@ -66,10 +81,27 @@ [view addSubview:iView]; [m_Text release]; [iView release]; + [view addSubview:m_ProgressIndicator]; // Display the window. [m_Window makeKeyAndOrderFront:nil]; } + +- (void) setProgress:(NSNumber *)progress +{ + [m_ProgressIndicator setDoubleValue:[progress doubleValue]]; +} + +- (void) setTotalWork:(NSNumber *)totalWork +{ + [m_ProgressIndicator setMaxValue:[totalWork doubleValue]]; +} + +- (void) setIndeterminate:(NSNumber *)indeterminate +{ + [m_ProgressIndicator setIndeterminate:([indeterminate doubleValue] > 0 ? YES : NO)]; +} + @end static LoadingWindowHelper *g_Helper = nil; @@ -124,6 +156,22 @@ void LoadingWindow_MacOSX::SetText( RString str ) [s release]; } +void LoadingWindow_MacOSX::SetProgress( const int progress ) +{ + [g_Helper performSelectorOnMainThread:@selector(setProgress:) withObject:[NSNumber numberWithDouble:(double)progress] waitUntilDone:NO]; +} + +void LoadingWindow_MacOSX::SetTotalWork( const int totalWork ) +{ + [g_Helper performSelectorOnMainThread:@selector(setTotalWork:) withObject:[NSNumber numberWithDouble:(double)totalWork] waitUntilDone:NO]; +} + +void LoadingWindow_MacOSX::SetIndeterminate( bool indeterminate ) +{ + double tmp = indeterminate ? 1 : 0; + [g_Helper performSelectorOnMainThread:@selector(setIndeterminate:) withObject:[NSNumber numberWithDouble:tmp] waitUntilDone:NO]; +} + /* * (c) 2003-2006, 2008 Steve Checkoway * All rights reserved. diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index 4801e0bac7..f152af9b2b 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -7,6 +7,7 @@ #include "archutils/win32/WindowIcon.h" #include "archutils/win32/ErrorStrings.h" #include +#include "CommCtrl.h" #include "RageSurface_Load.h" #include "RageSurface.h" #include "RageSurfaceUtils.h" @@ -17,6 +18,9 @@ #include "RageSurfaceUtils_Zoom.h" static HBITMAP g_hBitmap = NULL; +#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") + + /* Load a RageSurface into a GDI surface. */ static HBITMAP LoadWin32Surface( RageSurface *&s ) { @@ -76,8 +80,18 @@ static HBITMAP LoadWin32Surface( RString sFile, HWND hWnd ) return ret; } -BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) +INT_PTR CALLBACK LoadingWindow_Win32::DlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { + + LoadingWindow_Win32 *self; + + if(msg==WM_INITDIALOG) { + self=(LoadingWindow_Win32 *)lParam; + SetWindowLong(hWnd,DWL_USER,(LONG)self); + } else { + self=(LoadingWindow_Win32 *)GetWindowLong(hWnd,DWL_USER); + } + switch( msg ) { case WM_INITDIALOG: @@ -95,11 +109,25 @@ BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, (WPARAM) IMAGE_BITMAP, (LPARAM) (HANDLE) g_hBitmap ); SetWindowTextA( hWnd, PRODUCT_ID ); + break; + case WM_CLOSE: + return FALSE; + case WM_DESTROY: DeleteObject( g_hBitmap ); g_hBitmap = NULL; + self->runMessageLoop=false; + self->hwnd=NULL; + return TRUE; + break; + + case WM_APP: + DestroyWindow(hWnd); + self->runMessageLoop=false; + ExitThread(0); + return TRUE; break; } @@ -118,34 +146,54 @@ void LoadingWindow_Win32::SetIcon( const RageSurface *pIcon ) LoadingWindow_Win32::LoadingWindow_Win32() { + INITCOMMONCONTROLSEX cceData; + cceData.dwSize=sizeof(INITCOMMONCONTROLSEX); + cceData.dwICC=ICC_PROGRESS_CLASS; + InitCommonControlsEx(&cceData); + m_hIcon = NULL; - hwnd = CreateDialog( handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, WndProc ); + + runMessageLoop=true; + + guiReadyEvent=CreateEvent(NULL,FALSE,FALSE,NULL); + + pumpThread=CreateThread(NULL, NULL, MessagePump, (void *)this, 0, &pumpThreadId); + + WaitForSingleObject(guiReadyEvent,INFINITE); + for( unsigned i = 0; i < 3; ++i ) text[i] = "ABC"; /* always set on first call */ SetText( "" ); - Paint(); } LoadingWindow_Win32::~LoadingWindow_Win32() { - if( hwnd ) - DestroyWindow( hwnd ); + SendMessage(hwnd,WM_APP,0,0); + //SendMessage(hwnd,WM_NULL,0,0); + WaitForSingleObject(pumpThread,INFINITE); + if(guiReadyEvent) + CloseHandle(guiReadyEvent); if( m_hIcon != NULL ) DestroyIcon( m_hIcon ); } -void LoadingWindow_Win32::Paint() +DWORD WINAPI LoadingWindow_Win32::MessagePump(LPVOID thisAsVoidPtr) { - SendMessage( hwnd, WM_PAINT, 0, 0 ); + LoadingWindow_Win32 *self=(LoadingWindow_Win32 *)thisAsVoidPtr; - /* Process all queued messages since the last paint. This allows the window to - * come back if it loses focus during load. */ + self->hwnd = CreateDialogParam( self->handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, DlgProc, (LPARAM)thisAsVoidPtr); + + SetEvent(self->guiReadyEvent); + + // Run the message loop in a separate thread to keep the gui responsive during the loading MSG msg; - while( PeekMessage( &msg, hwnd, 0, 0, PM_NOREMOVE ) ) + while(self->runMessageLoop && GetMessage(&msg, self->hwnd, 0, 0 ) ) { - GetMessage(&msg, hwnd, 0, 0 ); + if(IsDialogMessage(self->hwnd,&msg)) continue; DispatchMessage( &msg ); } + + return msg.wParam; } void LoadingWindow_Win32::SetText( RString sText ) @@ -168,6 +216,35 @@ void LoadingWindow_Win32::SetText( RString sText ) } } +void LoadingWindow_Win32::SetProgress(const int progress) +{ + m_progress=progress; + HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS ); + ::SendMessage(hwndItem,PBM_SETPOS,progress,0); +} + +void LoadingWindow_Win32::SetTotalWork(const int totalWork) +{ + m_totalWork=totalWork; + HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS ); + SendMessage(hwndItem,PBM_SETRANGE32,0,totalWork); +} + +void LoadingWindow_Win32::SetIndeterminate(bool indeterminate) { + m_indeterminate=indeterminate; + + HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS ); + + if(indeterminate) { + SetWindowLong(hwndItem,GWL_STYLE, PBS_MARQUEE | GetWindowLong(hwndItem,GWL_STYLE)); + SendMessage(hwndItem,PBM_SETMARQUEE,1,0); + } else { + SendMessage(hwndItem,PBM_SETMARQUEE,0,0); + SetWindowLong(hwndItem,GWL_STYLE, (~PBS_MARQUEE) & GetWindowLong(hwndItem,GWL_STYLE)); + } + +} + /* * (c) 2001-2004 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.h b/src/arch/LoadingWindow/LoadingWindow_Win32.h index f490392acb..3c45789779 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.h +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.h @@ -14,16 +14,25 @@ public: ~LoadingWindow_Win32(); void SetText( RString sText ); - void Paint(); void SetIcon( const RageSurface *pIcon ); + void SetProgress( const int progress ); + void SetTotalWork( const int totalWork ); + void SetIndeterminate( bool indeterminate ); private: AppInstance handle; HWND hwnd; RString text[3]; HICON m_hIcon; + HANDLE pumpThread; + DWORD pumpThreadId; + HANDLE guiReadyEvent; - static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); + volatile bool runMessageLoop; + + static DWORD WINAPI MessagePump(LPVOID thisAsVoidPtr); + + static INT_PTR CALLBACK DlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); }; #define USE_LOADING_WINDOW_WIN32 diff --git a/src/archutils/Win32/WindowsResources.h b/src/archutils/Win32/WindowsResources.h index 348f2ffdb0..be6ceda5c4 100644 --- a/src/archutils/Win32/WindowsResources.h +++ b/src/archutils/Win32/WindowsResources.h @@ -29,7 +29,6 @@ #define IDC_BUTTON_CLOSE 1011 #define IDC_VIEW_LOG 1012 #define IDC_STATIC_MESSAGE3 1013 -#define IDC_PROGRESS1 1014 #define IDC_PROGRESS 1014 #define IDC_HUSH 1016 #define IDC_MESSAGE 1017 diff --git a/src/archutils/Win32/WindowsResources.rc b/src/archutils/Win32/WindowsResources.rc index fea25b16fb..94d881bd34 100644 --- a/src/archutils/Win32/WindowsResources.rc +++ b/src/archutils/Win32/WindowsResources.rc @@ -13,13 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -43,14 +41,17 @@ BEGIN CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,0,34,332,1 END -IDD_LOADING_DIALOG DIALOG 0, 0, 312, 82 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE -FONT 8, "MS Sans Serif" +IDD_LOADING_DIALOG DIALOGEX 0, 0, 317, 94 +STYLE DS_SETFONT | DS_CENTER | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Stepmania" +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - CTEXT "line1",IDC_STATIC_MESSAGE1,0,41,310,10,SS_NOPREFIX | SS_CENTERIMAGE - CTEXT "line2",IDC_STATIC_MESSAGE2,0,54,310,10,SS_NOPREFIX | SS_CENTERIMAGE - CTEXT "line3",IDC_STATIC_MESSAGE3,0,65,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CTEXT "line1",IDC_STATIC_MESSAGE1,0,67,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CTEXT "line2",IDC_STATIC_MESSAGE2,0,76,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CTEXT "line3",IDC_STATIC_MESSAGE3,0,84,310,10,SS_NOPREFIX | SS_CENTERIMAGE CONTROL "",IDC_SPLASH,"Static",SS_BITMAP,0,0,310,25 + CONTROL "",IDC_PROGRESS,"msctls_progress32",0x0,7,51,298,14 END IDD_DISASM_CRASH DIALOGEX 0, 0, 332, 114 @@ -102,14 +103,14 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_LOADING_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 305 + RIGHTMARGIN, 310 TOPMARGIN, 7 - BOTTOMMARGIN, 75 + BOTTOMMARGIN, 87 END IDD_DISASM_CRASH, DIALOG @@ -212,7 +213,7 @@ BEGIN END END -#endif // English (U.S.) resources +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/archutils/Win32/arch_setup.h b/src/archutils/Win32/arch_setup.h index 983aa3868d..c403f26b4c 100644 --- a/src/archutils/Win32/arch_setup.h +++ b/src/archutils/Win32/arch_setup.h @@ -66,7 +66,7 @@ C4355: 'this' : used in base member initializer list /* Pull in NT-only definitions. Note that we support Win98 and WinME; you can * make NT calls, but be sure to fall back on 9x if they're not supported. */ -#define _WIN32_WINNT 0x0400 +#define _WIN32_WINNT 0x0501 #define _WIN32_IE 0x0400 // If this isn't defined to 0, VC fails to define things like stat and alloca.