diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 664f5701e3..05a344690d 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -673,7 +673,7 @@ void NoteField::DrawBGChangeText( const float fBeat, const RString sNewBGName ) m_textMeasureNumber.Draw(); } -CacheNoteStat GetNumNotesFromBeginning( const PlayerState *pPlayerState, float beat ) +static CacheNoteStat GetNumNotesFromBeginning( const PlayerState *pPlayerState, float beat ) { // XXX: I realized that I have copied and pasted my binary search code 3 times already. // how can we abstract this? @@ -700,7 +700,7 @@ CacheNoteStat GetNumNotesFromBeginning( const PlayerState *pPlayerState, float b return dummy; } -int GetNumNotesRange( const PlayerState* pPlayerState, float fLow, float fHigh ) +static int GetNumNotesRange( const PlayerState* pPlayerState, float fLow, float fHigh ) { CacheNoteStat low = GetNumNotesFromBeginning( pPlayerState, fLow ); CacheNoteStat high = GetNumNotesFromBeginning( pPlayerState, fHigh ); @@ -720,7 +720,7 @@ float FindFirstDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistance } const int NUM_ITERATIONS = 24; - const int MAX_NOTES_AFTER = 32; + const int MAX_NOTES_AFTER = 64; float fFirstBeatToDraw = fLow; diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index eb8d76ca8f..4106ab24cc 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -432,7 +432,11 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach else if( sValueName=="KEYSOUNDS" ) { - split( sParams[1], ",", out.m_vsKeysoundFile ); + RString keysounds = sParams[1]; + if( keysounds.length() >= 2 && keysounds.substr(0, 2) == "\\#" ) + keysounds = keysounds.substr(1); + split( keysounds, ",", out.m_vsKeysoundFile ); + fprintf(stderr, "%s : %d\n", sPath.c_str(), out.m_vsKeysoundFile.size()); } // Attacks loaded from file diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index ea39240dce..4bcdf794d6 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -303,6 +303,12 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.Write( "#KEYSOUNDS:" ); for( unsigned i=0; i 0 && out.m_vsKeysoundFile[i][0] == '#' ) + f.Write("\\"); f.Write( out.m_vsKeysoundFile[i] ); if( i != out.m_vsKeysoundFile.size()-1 ) f.Write( "," ); diff --git a/src/Player.cpp b/src/Player.cpp index 6f4b111c2b..a02c11ceac 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -1441,7 +1441,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) { - float factor = (tn.subType == TapNote::hold_head_roll ? 2.0 * fLifeFraction : 10.0f * fLifeFraction - 8.5f); + float factor = (tn.subType == TapNote::hold_head_roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f); // todo: Make sure the player's volume settings are respected. -aj m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor))); } diff --git a/src/RageSoundReader_WAV.cpp b/src/RageSoundReader_WAV.cpp index e1edf87262..d1b689f7f9 100644 --- a/src/RageSoundReader_WAV.cpp +++ b/src/RageSoundReader_WAV.cpp @@ -250,6 +250,10 @@ public: ASSERT_M( m_iBufferUsed == m_iBufferAvail, ssprintf("%i", m_iBufferUsed) ); m_iBufferUsed = m_iBufferAvail = 0; + m_sError = ""; + + if( m_File.Tell() >= m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos || m_File.AtEOF() ) + return true; /* past the data chunk */ int8_t iPredictor[2]; int16_t iDelta[2], iSamp1[2], iSamp2[2]; @@ -265,9 +269,6 @@ public: if( m_sError.size() != 0 ) return false; - if( m_File.Tell() >= m_WavData.m_iDataChunkSize+m_WavData.m_iDataChunkPos || m_File.AtEOF() ) - return true; /* past the data chunk */ - float *pBuffer = m_pBuffer; int iCoef1[2], iCoef2[2]; for( int i = 0; i < m_WavData.m_iChannels; ++i ) @@ -410,7 +411,7 @@ public: { const int iByte = iBlock*m_WavData.m_iBlockAlign; - if( iByte > m_WavData.m_iDataChunkSize ) + if( iByte >= m_WavData.m_iDataChunkSize ) { /* Past EOF. */ SetEOF(); @@ -419,7 +420,6 @@ public: m_File.Seek( iByte+m_WavData.m_iDataChunkPos ); } - m_sError = ""; // please forget my errors, let's read again if( !DecodeADPCMBlock() ) return -1; diff --git a/src/Steps.cpp b/src/Steps.cpp index fddc50cf3c..eeec462ce3 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -130,14 +130,10 @@ bool Steps::GetNoteDataFromSimfile() { return KSFLoader::LoadNoteDataFromSimfile(stepFile, *this); } - else if (extension == "bms" || extension == "bml" || extension == "bme") + else if (extension == "bms" || extension == "bml" || extension == "bme" || extension == "pms") { return BMSLoader::LoadNoteDataFromSimfile(stepFile, *this); } - else if (extension == "pms") - { - return PMSLoader::LoadNoteDataFromSimfile(stepFile, *this); - } return false; }