From e3876a05bd172318d7fc53392e5aad145aa00c67 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 19 Dec 2001 14:56:22 +0000 Subject: [PATCH] no message --- stepmania/src/Player.cpp | 4 +-- stepmania/src/Song.cpp | 67 ++++++++++++++++++++++++++++++------- stepmania/src/StepMania.cpp | 2 ++ stepmania/src/StepMania.dsp | 8 +++++ stepmania/src/song.h | 5 +++ 5 files changed, 71 insertions(+), 15 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 93c1abb3b6..1bf6c4640d 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -438,8 +438,8 @@ void Player::OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDi // compute what the score should be for the note we stepped on StepScore &stepscore = m_StepScore[iIndexThatWasSteppedOn]; - if( fPercentFromPerfect < 0.20f ) stepscore = perfect; - else if( fPercentFromPerfect < 0.45f ) stepscore = great; + if( fPercentFromPerfect < 0.25f ) stepscore = perfect; + else if( fPercentFromPerfect < 0.50f ) stepscore = great; else if( fPercentFromPerfect < 0.75f ) stepscore = good; else stepscore = boo; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 28e38bfe27..e7d61525ab 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -324,7 +324,9 @@ bool Song::LoadSongInfoFromDWIFile( CString sPath ) { if( m_BPMSegments[b].m_fStartBeat == fFreezeBeat ) { - m_BPMSegments[b].m_fFreezeSeconds = fFreezeSeconds*0.8; + m_BPMSegments[b].m_fFreezeSeconds = fFreezeSeconds; + m_BPMSegments[b].m_fFreezeSeconds *= 0.8; // hack - Why is this needed? + break; } } @@ -393,37 +395,76 @@ void Song::TidyUpData() { CStringArray arrayPossibleMusic; GetDirListing( m_sSongDir + CString("*.mp3"), arrayPossibleMusic ); + GetDirListing( m_sSongDir + CString("*.ogg"), arrayPossibleMusic ); GetDirListing( m_sSongDir + CString("*.wav"), arrayPossibleMusic ); if( arrayPossibleMusic.GetSize() != 0 ) // we found a match m_sMusic = arrayPossibleMusic.GetAt( 0 ); else - RageError( ssprintf("Music could not be found. Please check the Song file '%s' and verify the specified #MUSIC exists.", GetSongFilePath()) ); + m_sMusic = ""; + // RageError( ssprintf("Music could not be found. Please check the Song file '%s' and verify the specified #MUSIC exists.", GetSongFilePath()) ); } if( m_sBanner == "" || !DoesFileExist(GetBannerPath()) ) { + // find the smallest image in the directory + CStringArray arrayPossibleBanners; - GetDirListing( m_sSongDir + CString("*banner*.*"), arrayPossibleBanners ); GetDirListing( m_sSongDir + CString("*.png"), arrayPossibleBanners ); + GetDirListing( m_sSongDir + CString("*.jpg"), arrayPossibleBanners ); GetDirListing( m_sSongDir + CString("*.bmp"), arrayPossibleBanners ); - if( arrayPossibleBanners.GetSize() != 0 ) // we found a match - m_sBanner = arrayPossibleBanners.GetAt( 0 ); + D3DXIMAGE_INFO d3dii; + int iSmallestNumPixelsSoFar = 1024*1024; + CString sSmallestFileNameSoFar = ""; + + for( int i=0; i iBiggestNumPixelsSoFar ) // we have a new leader! + { + iBiggestNumPixelsSoFar = iNumPixels; + sBiggestFileNameSoFar = arrayPossibleBackgrounds[i]; + } + } + } + + if( sBiggestFileNameSoFar != "" ) // we found a match + m_sBackground = sBiggestFileNameSoFar; else - RageError( ssprintf("Banner could not be found. Please check the Song file '%s' and verify the specified #BANNER exists.", GetSongFilePath()) ); + RageError( ssprintf("Background could not be found. Please check the Song file '%s' and verify the specified #BANNER exists.", GetSongFilePath()) ); } } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index adc2088e26..7dd48bd4dc 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -326,6 +326,8 @@ HRESULT CreateObjects( HWND hWnd ) //WM->SetNewWindow( new WindowSandbox ); WM->SetNewWindow( new WindowTitleMenu ); + Sleep(1000); // let the disk operations catch up + DXUtil_Timer( TIMER_START ); // Start the accurate timer diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 87f6bd6a3f..4390c3a4d2 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -192,6 +192,14 @@ SOURCE=.\WindowDancing.h # End Source File # Begin Source File +SOURCE=.\WindowGameOptions.cpp +# End Source File +# Begin Source File + +SOURCE=.\WindowGameOptions.h +# End Source File +# Begin Source File + SOURCE=.\WindowIntroCovers.cpp # End Source File # Begin Source File diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 0a51ae68be..20817de944 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -54,6 +54,11 @@ public: CString GetBackgroundPath() {return m_sSongDir + m_sBackground; }; // Steps& GetStepsAt( int iIndex ) {return arraySteps[iIndex]; }; + bool HasMusic() {return m_sMusic != "" && DoesFileExist(GetMusicPath()); }; + bool HasBanner() {return m_sBanner != "" && DoesFileExist(GetBannerPath()); }; + bool HasBackground() {return m_sBackground != "" && DoesFileExist(GetBackgroundPath()); }; + + CString GetTitle() {return m_sTitle; }; CString GetArtist() {return m_sArtist; }; CString GetCreator() {return m_sCreator; };