escape # in first keysound entry, fixed ADPCM reader and make PMS load more correctly.

- [NoteField] fix build warnings, and change the maximum number of displayed notes
  after the receptor to 64.
- [Player] fix build warnings.
- [NotesLoaderSSC, NotesWriterSSC] The MSD file reader seems to treat # that comes
  directly after : as new tag, and as many PMS and BMS files has keysounds which filename
  starts with #, so it looks like this: #KEYSOUNDS:#bgm.wav,01.wav,02.wav,..
  The MSD parser will see it as 2 different tags. So I added a backslash in front of the
  # sign if it's at the start when saving and remove it when loading.
- [RageSoundReader_WAV] ADPCM now works very well and doesn't return error when
  end of file is reached anymore.
- [Steps] Use BMS loader when loading the note data.
This commit is contained in:
Thai Pangsakulyanont
2011-11-11 18:40:34 +07:00
parent a4c7355c78
commit 248504f275
6 changed files with 21 additions and 15 deletions
+5 -5
View File
@@ -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;