Style cleanup.

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