Merge with default

This commit is contained in:
Henrik Andersson
2011-06-02 19:36:32 +02:00
4 changed files with 65 additions and 82 deletions
+5 -3
View File
@@ -522,6 +522,7 @@
<Function name='SetFromCourse'/>
<Function name='SetFromGameState'/>
<Function name='SetFromSong'/>
<Function name='SetFromSteps'/>
</Class>
<Class base='Sprite' name='Banner'>
<Function name='GetPercentScrolling'/>
@@ -627,6 +628,7 @@
<Class name='CryptManager'>
<Function name='MD5File'/>
<Function name='MD5String'/>
<Function name='SHA1File'/>
<Function name='SHA1String'/>
</Class>
<Class base='Sprite' name='DifficultyIcon'>
@@ -1427,8 +1429,8 @@
<Function name='HasBPMChanges'/>
<Function name='HasFakes'/>
<Function name='HasNegativeBPMs'/>
<Function name='HasSpeedChanges'/>
<Function name='HasScrollChanges'/>
<Function name='HasSpeedChanges'/>
<Function name='HasStops'/>
<Function name='HasWarps'/>
</Class>
@@ -2103,6 +2105,6 @@
<Constant name='sGame' value='&apos;dance&apos;'/>
<Constant name='top' value='&apos;VertAlign_Top&apos;'/>
</Constants>
<Version>sm-ssc v1.2.5</Version>
<Date>2011-05-19</Date>
<Version>StepMania 5 v5.0 Preview 1</Version>
<Date>2011-06-02</Date>
</Lua>
+25 -10
View File
@@ -1578,6 +1578,9 @@
The second argument is optional. Apply the GameCommand represented by <code>sCommand</code>
for <code>pn</code>, if given. See <Link class='GameCommand' />.
</Function>
<Function name='ClearStageModifiersIllegalForCourse' return='void' arguments=''>
Removes any stage modifiers that are illegal for course play.
</Function>
<Function name='EnoughCreditsToJoin' return='bool' arguments=''>
Returns <code>true</code> if enough credits have been inserted to join.
</Function>
@@ -1681,12 +1684,18 @@
<Function name='GetHumanPlayers' return='{PlayerNumber}' arguments=''>
Returns an array of <Link class='PlayerNumber' />s corresponding to Human players.
</Function>
<Function name='GetLoadingCourseSongIndex' return='int' arguments=''>
Returns the index of the next song in the course.
</Function>
<Function name='GetMasterPlayerNumber' return='PlayerNumber' arguments=''>
Returns the master player number.
</Function>
<Function name='GetMultiplayer' return='bool' arguments=''>
Returns <code>true</code> if the game is Multiplayer.
</Function>
<Function name='GetMultiPlayerState' return='PlayerState' arguments='MultiPlayer mp'>
Returns the PlayerState for the specified MultiPlayer.
</Function>
<Function name='GetNumMultiplayerNoteFields' return='int' arguments=''>
Returns the number of active multiplayer NoteFields.
</Function>
@@ -1723,21 +1732,27 @@
<Function name='GetPremium' return='Premium' arguments=''>
Returns the current Premium.
</Function>
<Function name='GetSongBeat' return='float' arguments=''>
<!-- XXX: Not exactly sure on this. -->
Returns the current beat of the song.
<Function name='GetSmallestNumStagesLeftForAnyHumanPlayer' return='int' arguments=''>
<!-- Returns the smallest number of stages left for any human player. -->
Kind of does what it says on the tin.
</Function>
<Function name='GetSongBeat' theme='_fallback' return='float' arguments=''>
[01 compat.lua] Returns the current beat of the song.
</Function>
<Function name='GetSongBeatNoOffset' theme='_fallback' return='float' arguments=''>
[01 compat.lua] Returns the current beat of the song without an offset.
</Function>
<Function name='GetSongBeatVisible' return='float' arguments=''>
Returns the current visible beat of the song.
</Function>
<Function name='GetSongBPS' return='float' arguments=''>
Returns the song's current beats per second.
<Function name='GetSongBPS' theme='_fallback' return='float' arguments=''>
[01 compat.lua] Returns the song's current beats per second.
</Function>
<Function name='GetSongDelay' sm-ssc='true' return='bool' arguments=''>
Returns <code>true</code> if a delay is active in the song.
<Function name='GetSongDelay' theme='_fallback' return='bool' arguments=''>
[01 compat.lua] Returns <code>true</code> if a delay is active in the song.
</Function>
<Function name='GetSongFreeze' return='bool' arguments=''>
Returns <code>true</code> if the song is currently in a freeze.
<Function name='GetSongFreeze' theme='_fallback' return='bool' arguments=''>
[01 compat.lua] Returns <code>true</code> if the song is currently in a freeze.
</Function>
<Function name='GetSongOptions' return='string' arguments='ModsLevel ml'>
Returns the song options for the specified ModsLevel as a string.
@@ -1749,7 +1764,7 @@
Returns how much of the song is through at beat <code>fBeat</code>.
</Function>
<Function name='GetSongPosition' sm-ssc='true' return='SongPosition' arguments=''>
<!-- todo -->
Returns the current SongPosition.
</Function>
<Function name='GetSortOrder' return='SortOrder' arguments=''>
Returns the current SortOrder.
+35 -67
View File
@@ -84,20 +84,6 @@ void SMLoader::GetApplicableFiles( const RString &sPath, vector<RString> &out )
GetDirListing( sPath + RString("*.sm"), out );
}
bool SMLoader::LoadTimingFromFile( const RString &fn, TimingData &out )
{
MsdFile msd;
if( !msd.ReadFile( fn, true ) ) // unescape
{
LOG->UserLog( "Song file", fn, "couldn't be loaded: %s", msd.GetError().c_str() );
return false;
}
out.m_sFile = fn;
LoadTimingFromSMFile( msd, out );
return true;
}
void SMLoader::ProcessBGChanges( Song &out, const RString &sValueName, const RString &sPath, const RString &sParam )
{
BackgroundLayer iLayer = BACKGROUND_LAYER_1;
@@ -423,53 +409,6 @@ void SMLoader::ProcessTickcounts( TimingData &out, const RString sParam )
}
}
void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
{
out.m_fBeat0OffsetInSeconds = 0;
out.m_BPMSegments.clear();
out.m_StopSegments.clear();
out.m_WarpSegments.clear();
out.m_vTimeSignatureSegments.clear();
for( unsigned i=0; i<msd.GetNumValues(); i++ )
{
const MsdFile::value_t &sParams = msd.GetValue(i);
RString sValueName = sParams[0];
sValueName.MakeUpper();
if( sValueName=="OFFSET" )
{
out.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] );
}
else if( sValueName=="BPMS" )
{
ProcessBPMs(out, sParams[1]);
}
else if( sValueName=="STOPS" || sValueName=="FREEZES" )
{
ProcessStops(out, sParams[1]);
}
else if( sValueName=="DELAYS" )
{
ProcessDelays(out, sParams[1]);
}
else if( sValueName=="TIMESIGNATURES" )
{
ProcessTimeSignatures(out, sParams[1]);
}
else if( sValueName=="TICKCOUNTS" )
{
ProcessTickcounts(out, sParams[1]);
}
// Ensure all of the warps are handled right.
sort(out.m_WarpSegments.begin(), out.m_WarpSegments.end());
}
}
bool SMLoader::LoadFromBGChangesString( BackgroundChange &change, const RString &sBGChangeExpression )
{
vector<RString> aBGChangeValues;
@@ -568,7 +507,6 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache
}
out.m_SongTiming.m_sFile = sPath;
LoadTimingFromSMFile( msd, out.m_SongTiming );
for( unsigned i=0; i<msd.GetNumValues(); i++ )
{
@@ -620,6 +558,36 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache
else if( sValueName=="MUSIC" )
out.m_sMusicFile = sParams[1];
else if( sValueName=="OFFSET" )
{
out.m_fBeat0OffsetInSeconds = StringToFloat( sParams[1] );
}
else if( sValueName=="BPMS" )
{
ProcessBPMs(out.m_SongTiming, sParams[1]);
}
else if( sValueName=="STOPS" || sValueName=="FREEZES" )
{
ProcessStops(out.m_SongTiming, sParams[1]);
}
else if( sValueName=="DELAYS" )
{
ProcessDelays(out.m_SongTiming, sParams[1]);
}
else if( sValueName=="TIMESIGNATURES" )
{
ProcessTimeSignatures(out.m_SongTiming, sParams[1]);
}
else if( sValueName=="TICKCOUNTS" )
{
ProcessTickcounts(out.m_SongTiming, sParams[1]);
}
else if( sValueName=="INSTRUMENTTRACK" )
{
ProcessInstrumentTracks( out, sParams[1] );
@@ -762,15 +730,15 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache
out.AddSteps( pNewNotes );
}
/*
* We used to check for timing data in this section. That has
* since been moved to a dedicated function.
*/
else if( sValueName=="OFFSET" || sValueName=="BPMS" || sValueName=="STOPS" || sValueName=="FREEZES" || sValueName=="DELAYS" || sValueName=="TIMESIGNATURES" || sValueName=="LEADTRACK" || sValueName=="TICKCOUNTS" )
// XXX: Does anyone know what LEADTRACK is for? -Wolfman2000
else if( sValueName=="LEADTRACK" )
;
else
LOG->UserLog( "Song file", sPath, "has an unexpected value named \"%s\".", sValueName.c_str() );
}
// Ensure all warps from negative time changes are in order.
sort(out.m_SongTiming.m_WarpSegments.begin(), out.m_SongTiming.m_WarpSegments.end());
TidyUpData( out, bFromCache );
return true;
}
-2
View File
@@ -26,8 +26,6 @@ namespace SMLoader
bool LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache = false );
void GetApplicableFiles( const RString &sPath, vector<RString> &out );
bool LoadTimingFromFile( const RString &fn, TimingData &out );
void LoadTimingFromSMFile( const MsdFile &msd, TimingData &out );
bool LoadEditFromFile( RString sEditFilePath, ProfileSlot slot, bool bAddStepsToSong );
bool LoadEditFromBuffer( const RString &sBuffer, const RString &sEditFilePath, ProfileSlot slot );
bool LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath, ProfileSlot slot, bool bAddStepsToSong );