[splittiming] and a merge

This commit is contained in:
Thai Pangsakulyanont
2011-05-10 20:04:47 +07:00
3 changed files with 59 additions and 12 deletions
+49 -21
View File
@@ -684,6 +684,8 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat
Song* pSong = NULL;
Steps* pNewNotes = NULL;
bool bSSCFormat = false;
bool bHasOwnTiming = false;
TimingData stepsTiming;
for( unsigned i=0; i<msd.GetNumValues(); i++ )
{
@@ -774,32 +776,54 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat
bSSCFormat = true;
}
// TimingData for Steps isn't set yet, but still prepare for it.
else if( sValueName=="BPMS" )
{
bSSCFormat = true;
}
else if( sValueName=="STOPS" )
{
bSSCFormat = true;
}
else if( sValueName=="DELAYS" )
{
bSSCFormat = true;
}
else if( sValueName=="TIMESIGNATURES" )
{
bSSCFormat = true;
}
else if( sValueName=="TICKCOUNTS" )
{
bSSCFormat = true;
}
else if( sValueName=="COMBOS" )
{
if( SMLoader::ProcessBPMs(stepsTiming, sParams[1]) )
bHasOwnTiming = true;
bSSCFormat = true;
}
else if( sValueName=="STOPS" )
{
SMLoader::ProcessStops(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="DELAYS" )
{
SMLoader::ProcessDelays(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="TIMESIGNATURES" )
{
SMLoader::ProcessTimeSignatures(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="TICKCOUNTS" )
{
SMLoader::ProcessTickcounts(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="COMBOS" )
{
ProcessCombos(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="WARPS" )
{
ProcessWarps(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="LABELS" )
{
ProcessLabels(stepsTiming, sParams[1]);
bSSCFormat = true;
}
else if( sValueName=="NOTES" )
{
if( pSong == NULL )
@@ -819,6 +843,10 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat
if( bSSCFormat )
{
if ( bHasOwnTiming )
{
pNewNotes->m_Timing = stepsTiming;
}
pNewNotes->SetSMNoteData( sParams[1] );
pNewNotes->TidyUpData();
pSong->AddSteps( pNewNotes );
+28 -9
View File
@@ -1,12 +1,3 @@
/*
* SongPosition.cpp
* stepmania
*
* Created by [Full Username] on 5/10/11.
* Copyright 2011 [Organization Name]. All rights reserved.
*
*/
#include "SongPosition.h"
void SongPosition::UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer &timestamp )
@@ -54,3 +45,31 @@ void SongPosition::UpdateSongPosition( float fPositionSeconds, const TimingData
*/
}
/**
* @file
* @author Thai Pangsakulyanont (c) 2011
* @section LICENSE
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+1 -1
View File
@@ -40,7 +40,7 @@ class SongPosition
/**
* @file
* @author Chris Danford, Glenn Maynard (c) 2001-2004
* @author Thai Pangsakulyanont (c) 2011
* @section LICENSE
* All rights reserved.
*