[splittiming] Simplify.
This commit is contained in:
+3
-53
@@ -395,59 +395,9 @@ void SMALoader::LoadFromSMATokens(
|
|||||||
Steps &out
|
Steps &out
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// we're loading from disk, so this is by definition already saved:
|
SMLoader::LoadFromSMATokens( sStepsType, sDescription,
|
||||||
out.SetSavedToDisk( true );
|
sDifficulty, sMeter, sRadarValues,
|
||||||
|
sNoteData, out );
|
||||||
Trim( sStepsType );
|
|
||||||
Trim( sDescription );
|
|
||||||
Trim( sDifficulty );
|
|
||||||
Trim( sNoteData );
|
|
||||||
|
|
||||||
// LOG->Trace( "Steps::LoadFromSMTokens()" );
|
|
||||||
|
|
||||||
// insert stepstype hacks from GameManager.cpp here? -aj
|
|
||||||
out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType );
|
|
||||||
out.SetDescription( sDescription );
|
|
||||||
out.SetCredit( sDescription ); // this is often used for both.
|
|
||||||
out.SetDifficulty( StringToDifficulty(sDifficulty) );
|
|
||||||
|
|
||||||
sDescription.MakeLower();
|
|
||||||
|
|
||||||
// Handle hacks that originated back when StepMania didn't have
|
|
||||||
// Difficulty_Challenge. (At least v1.64, possibly v3.0 final...)
|
|
||||||
if( out.GetDifficulty() == Difficulty_Hard )
|
|
||||||
{
|
|
||||||
// HACK: SMANIAC used to be Difficulty_Hard with a special description.
|
|
||||||
if( sDescription == "smaniac" )
|
|
||||||
out.SetDifficulty( Difficulty_Challenge );
|
|
||||||
|
|
||||||
// HACK: CHALLENGE used to be Difficulty_Hard with a special description.
|
|
||||||
if( sDescription == "challenge" )
|
|
||||||
out.SetDifficulty( Difficulty_Challenge );
|
|
||||||
}
|
|
||||||
|
|
||||||
out.SetMeter( StringToInt(sMeter) );
|
|
||||||
vector<RString> saValues;
|
|
||||||
split( sRadarValues, ",", saValues, true );
|
|
||||||
int categories = NUM_RadarCategory - 1; // Fakes aren't counted in the radar values.
|
|
||||||
if( saValues.size() == (unsigned)categories * NUM_PLAYERS )
|
|
||||||
{
|
|
||||||
RadarValues v[NUM_PLAYERS];
|
|
||||||
FOREACH_PlayerNumber( pn )
|
|
||||||
{
|
|
||||||
// Can't use the foreach anymore due to flexible radar lines.
|
|
||||||
for( RadarCategory rc = (RadarCategory)0; rc < categories;
|
|
||||||
enum_add<RadarCategory>( rc, 1 ) )
|
|
||||||
{
|
|
||||||
v[pn][rc] = StringToFloat( saValues[pn*categories + rc] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out.SetCachedRadarValues( v );
|
|
||||||
}
|
|
||||||
|
|
||||||
out.SetSMNoteData( sNoteData );
|
|
||||||
|
|
||||||
out.TidyUpData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMALoader::TidyUpData( Song &song, bool bFromCache )
|
void SMALoader::TidyUpData( Song &song, bool bFromCache )
|
||||||
|
|||||||
+1
-44
@@ -609,50 +609,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach
|
|||||||
|
|
||||||
else if( sValueName=="ATTACKS" )
|
else if( sValueName=="ATTACKS" )
|
||||||
{
|
{
|
||||||
// TODO: Look into Step attacks vs Song Attacks. -Wolfman2000
|
// Step Attacks aren't in yet.
|
||||||
/*
|
|
||||||
// Build the RString vector here so we can write it to file again later
|
|
||||||
for( unsigned s=1; s < sParams.params.size(); ++s )
|
|
||||||
out.m_sAttackString.push_back( sParams[s] );
|
|
||||||
|
|
||||||
Attack attack;
|
|
||||||
float end = -9999;
|
|
||||||
|
|
||||||
for( unsigned j=1; j < sParams.params.size(); ++j )
|
|
||||||
{
|
|
||||||
vector<RString> sBits;
|
|
||||||
split( sParams[j], "=", sBits, false );
|
|
||||||
|
|
||||||
// Need an identifer and a value for this to work
|
|
||||||
if( sBits.size() < 2 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
TrimLeft( sBits[0] );
|
|
||||||
TrimRight( sBits[0] );
|
|
||||||
|
|
||||||
if( !sBits[0].CompareNoCase("TIME") )
|
|
||||||
attack.fStartSecond = strtof( sBits[1], NULL );
|
|
||||||
else if( !sBits[0].CompareNoCase("LEN") )
|
|
||||||
attack.fSecsRemaining = strtof( sBits[1], NULL );
|
|
||||||
else if( !sBits[0].CompareNoCase("END") )
|
|
||||||
end = strtof( sBits[1], NULL );
|
|
||||||
else if( !sBits[0].CompareNoCase("MODS") )
|
|
||||||
{
|
|
||||||
attack.sModifiers = sBits[1];
|
|
||||||
|
|
||||||
if( end != -9999 )
|
|
||||||
{
|
|
||||||
attack.fSecsRemaining = end - attack.fStartSecond;
|
|
||||||
end = -9999;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( attack.fSecsRemaining < 0.0f )
|
|
||||||
attack.fSecsRemaining = 0.0f;
|
|
||||||
|
|
||||||
out.m_Attacks.push_back( attack );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( sValueName=="OFFSET" )
|
else if( sValueName=="OFFSET" )
|
||||||
|
|||||||
Reference in New Issue
Block a user