Style cleanup.
This commit is contained in:
@@ -14,40 +14,41 @@
|
||||
#include "NoteTypes.h"
|
||||
|
||||
/* BMS encoding: tap-hold
|
||||
4&8panel: Player1 Player2
|
||||
Left 11-51 21-61
|
||||
Down 13-53 23-63
|
||||
Up 15-55 25-65
|
||||
Right 16-56 26-66
|
||||
|
||||
6panel: Player1
|
||||
Left 11-51
|
||||
Left+Up 12-52
|
||||
Down 13-53
|
||||
Up 14-54
|
||||
Up+Right 15-55
|
||||
Right 16-56
|
||||
|
||||
Notice that 15 and 25 have double meanings! What were they thinking???
|
||||
While reading in, use the 6 panel mapping. After reading in, detect if
|
||||
only 4 notes are used. If so, shift the Up+Right column back to the Up
|
||||
column
|
||||
|
||||
BMSes are used for games besides dance and so we're borking up BMSes that are for popn/beat/etc.
|
||||
|
||||
popn-nine: 11-15,22-25
|
||||
popn-five: 13-15,21-22
|
||||
beat-single5: 11-16
|
||||
beat-double5: 11-16,21-26
|
||||
beat-single7: 11-16,18-19
|
||||
beat-double7: 11-16,18-19,21-26,28-29
|
||||
|
||||
So the magics for these are:
|
||||
popn-nine: nothing >5, with 12, 14, 22 and/or 24
|
||||
popn-five: nothing >5, with 14 and/or 22
|
||||
beat-*: can't tell difference between beat-single and dance-solo
|
||||
18/19 marks beat-single7, 28/29 marks beat-double7
|
||||
beat-double uses 21-26. */
|
||||
* 4&8panel: Player1 Player2
|
||||
* Left 11-51 21-61
|
||||
* Down 13-53 23-63
|
||||
* Up 15-55 25-65
|
||||
* Right 16-56 26-66
|
||||
*
|
||||
* 6panel: Player1
|
||||
* Left 11-51
|
||||
* Left+Up 12-52
|
||||
* Down 13-53
|
||||
* Up 14-54
|
||||
* Up+Right 15-55
|
||||
* Right 16-56
|
||||
*
|
||||
* Notice that 15 and 25 have double meanings! What were they thinking???
|
||||
* While reading in, use the 6 panel mapping. After reading in, detect if
|
||||
* only 4 notes are used. If so, shift the Up+Right column back to the Up
|
||||
* column
|
||||
*
|
||||
* BMSes are used for games besides dance and so we're borking up BMSes that are for popn/beat/etc.
|
||||
*
|
||||
* popn-nine: 11-15,22-25
|
||||
* popn-five: 13-15,21-22
|
||||
* beat-single5: 11-16
|
||||
* beat-double5: 11-16,21-26
|
||||
* beat-single7: 11-16,18-19
|
||||
* beat-double7: 11-16,18-19,21-26,28-29
|
||||
*
|
||||
* So the magics for these are:
|
||||
* popn-nine: nothing >5, with 12, 14, 22 and/or 24
|
||||
* popn-five: nothing >5, with 14 and/or 22
|
||||
* beat-*: can't tell difference between beat-single and dance-solo
|
||||
* 18/19 marks beat-single7, 28/29 marks beat-double7
|
||||
* beat-double uses 21-26.
|
||||
*/
|
||||
|
||||
enum BmsTrack
|
||||
{
|
||||
@@ -120,7 +121,7 @@ static bool ConvertRawTrackToTapNote( int iRawTrack, BmsTrack &bmsTrackOut, bool
|
||||
}
|
||||
|
||||
// Find the largest common substring at the start of both strings.
|
||||
static RString FindLargestInitialSubstring( RString string1, RString string2 )
|
||||
static RString FindLargestInitialSubstring( const RString &string1, const RString &string2 )
|
||||
{
|
||||
// First see if the whole first string matches an appropriately-sized
|
||||
// substring of the second, then keep chopping off the last character of
|
||||
@@ -162,11 +163,11 @@ static StepsType DetermineStepsType( int iPlayer, const NoteData &nd )
|
||||
{
|
||||
case 1: // "1 player"
|
||||
/* Track counts:
|
||||
4 - dance 4-panel
|
||||
5 - pop 5-key
|
||||
6 - dance 6-panel, beat 5-key
|
||||
8 - beat 7-key
|
||||
9 - popn 9-key */
|
||||
* 4 - dance 4-panel
|
||||
* 5 - pop 5-key
|
||||
* 6 - dance 6-panel, beat 5-key
|
||||
* 8 - beat 7-key
|
||||
* 9 - popn 9-key */
|
||||
switch( iNumNonEmptyTracks )
|
||||
{
|
||||
case 4: return STEPS_TYPE_DANCE_SINGLE;
|
||||
@@ -185,9 +186,9 @@ static StepsType DetermineStepsType( int iPlayer, const NoteData &nd )
|
||||
return STEPS_TYPE_DANCE_COUPLE;
|
||||
case 3: // double
|
||||
/* Track counts:
|
||||
8 - dance Double
|
||||
12 - beat Double 5-key
|
||||
16 - beat Double 7-key */
|
||||
* 8 - dance Double
|
||||
* 12 - beat Double 5-key
|
||||
* 16 - beat Double 7-key */
|
||||
switch( iNumNonEmptyTracks )
|
||||
{
|
||||
case 8: return STEPS_TYPE_BEAT_SINGLE7;
|
||||
@@ -207,15 +208,11 @@ float BMSLoader::GetBeatsPerMeasure( const MeasureToTimeSig_t &sigs, int iMeasur
|
||||
|
||||
float fRet = 4.0f;
|
||||
if( time_sig != sigs.end() )
|
||||
{
|
||||
fRet *= time_sig->second;
|
||||
}
|
||||
|
||||
time_sig = m_TimeSigAdjustments.find( iMeasure );
|
||||
if( time_sig != m_TimeSigAdjustments.end() )
|
||||
{
|
||||
fRet *= time_sig->second;
|
||||
}
|
||||
|
||||
return fRet;
|
||||
}
|
||||
@@ -575,8 +572,10 @@ bool BMSLoader::GetCommonTagFromMapList( const vector<NameToData_t> &aBMSData, c
|
||||
sCommonTag = sTag;
|
||||
}
|
||||
else
|
||||
{
|
||||
sCommonTag = FindLargestInitialSubstring( sCommonTag, sTag );
|
||||
}
|
||||
}
|
||||
|
||||
return bFoundOne;
|
||||
}
|
||||
@@ -718,7 +717,9 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->Warn( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BMS_TRACK_STOP:
|
||||
@@ -737,7 +738,9 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
|
||||
LOG->Trace( "Inserting new Freeze at beat %f, secs %f", fBeat, newSeg.m_fStopSeconds );
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->Warn( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -770,7 +773,9 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->Warn( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -920,7 +925,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
sTag.MakeLower();
|
||||
|
||||
// XXX: We should do this with filenames too, I have plenty of examples.
|
||||
// however, filenames will be trickier, as stuffs at the beginning AND
|
||||
// however, filenames will be trickier, as stuff at the beginning AND
|
||||
// end change per-file, so we'll need a fancier FindLargestInitialSubstring()
|
||||
|
||||
// XXX: This matches (double), but I haven't seen it used. Again, MORE EXAMPLES NEEDED
|
||||
|
||||
Reference in New Issue
Block a user