quantize rows when reading from BMSs so that we don't end up with 2MB cache files
This commit is contained in:
@@ -1290,7 +1290,7 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteTyp
|
|||||||
case NOTE_TYPE_32ND: fSnapInterval2 = 1/8.0f; break;
|
case NOTE_TYPE_32ND: fSnapInterval2 = 1/8.0f; break;
|
||||||
case NOTE_TYPE_48TH: fSnapInterval2 = 1/12.0f; break;
|
case NOTE_TYPE_48TH: fSnapInterval2 = 1/12.0f; break;
|
||||||
case NOTE_TYPE_64TH: fSnapInterval2 = 1/16.0f; break;
|
case NOTE_TYPE_64TH: fSnapInterval2 = 1/16.0f; break;
|
||||||
case -1: fSnapInterval2 = 10000; break; // nothing will ever snap to this. That's what we want!
|
case NOTE_TYPE_INVALID: fSnapInterval2 = 10000; break; // nothing will ever snap to this. That's what we want!
|
||||||
default: ASSERT( false ); return;
|
default: ASSERT( false ); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,10 @@ namespace NoteDataUtil
|
|||||||
|
|
||||||
void SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
|
void SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
|
||||||
|
|
||||||
inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( inout, nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
|
inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, float fBeginBeat, float fEndBeat )
|
||||||
|
{
|
||||||
|
SnapToNearestNoteType( inout, nt, NOTE_TYPE_INVALID, fBeginBeat, fEndBeat );
|
||||||
|
}
|
||||||
|
|
||||||
void FixImpossibleRows( NoteData &inout, StepsType st );
|
void FixImpossibleRows( NoteData &inout, StepsType st );
|
||||||
|
|
||||||
|
|||||||
@@ -310,8 +310,13 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Steps &out, const map<CSt
|
|||||||
{
|
{
|
||||||
float fPercentThroughMeasure = (float)j/(float)uNumNotesInThisMeasure;
|
float fPercentThroughMeasure = (float)j/(float)uNumNotesInThisMeasure;
|
||||||
|
|
||||||
const int row = (int) ( (iMeasureNo + fPercentThroughMeasure)
|
int row = (int) ( (iMeasureNo + fPercentThroughMeasure)
|
||||||
* BEATS_PER_MEASURE * ROWS_PER_BEAT );
|
* BEATS_PER_MEASURE * ROWS_PER_BEAT );
|
||||||
|
|
||||||
|
// some BMS files seem to have funky alignment, causing us to write gigantic cache files.
|
||||||
|
// Try to correct for this by quantizing.
|
||||||
|
row = froundf( row, ROWS_PER_MEASURE/64 );
|
||||||
|
|
||||||
BmsTrack bmsTrack;
|
BmsTrack bmsTrack;
|
||||||
bool bIsHold;
|
bool bIsHold;
|
||||||
if( ConvertRawTrackToTapNote(iRawTrackNum, bmsTrack, bIsHold) )
|
if( ConvertRawTrackToTapNote(iRawTrackNum, bmsTrack, bIsHold) )
|
||||||
|
|||||||
Reference in New Issue
Block a user