fix saving and copying of tap attack notes
This commit is contained in:
@@ -92,7 +92,18 @@ void NoteData::CopyRange( const NoteData* pFrom, int iFromIndexBegin, int iFromI
|
|||||||
while( f<=iFromIndexEnd )
|
while( f<=iFromIndexEnd )
|
||||||
{
|
{
|
||||||
for( int c=0; c<m_iNumTracks; c++ )
|
for( int c=0; c<m_iNumTracks; c++ )
|
||||||
To.SetTapNote(c, t, From.GetTapNote(c, f));
|
{
|
||||||
|
TapNote tn = From.GetTapNote(c, f);
|
||||||
|
if( IsTapAttack(tn) )
|
||||||
|
{
|
||||||
|
Attack attack = From.GetAttackAt(c,f);
|
||||||
|
To.SetTapAttackNote( c, t, attack );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
To.SetTapNote(c, t, tn);
|
||||||
|
}
|
||||||
|
}
|
||||||
f++;
|
f++;
|
||||||
t++;
|
t++;
|
||||||
}
|
}
|
||||||
@@ -113,6 +124,7 @@ void NoteData::CopyAll( const NoteData* pFrom )
|
|||||||
for( int c=0; c<m_iNumTracks; c++ )
|
for( int c=0; c<m_iNumTracks; c++ )
|
||||||
m_TapNotes[c] = pFrom->m_TapNotes[c];
|
m_TapNotes[c] = pFrom->m_TapNotes[c];
|
||||||
m_HoldNotes = pFrom->m_HoldNotes;
|
m_HoldNotes = pFrom->m_HoldNotes;
|
||||||
|
m_AttackMap = pFrom->m_AttackMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::AddHoldNote( HoldNote add )
|
void NoteData::AddHoldNote( HoldNote add )
|
||||||
@@ -174,7 +186,7 @@ void NoteData::RemoveHoldNote( int iHoldIndex )
|
|||||||
m_HoldNotes.erase(m_HoldNotes.begin()+iHoldIndex, m_HoldNotes.begin()+iHoldIndex+1);
|
m_HoldNotes.erase(m_HoldNotes.begin()+iHoldIndex, m_HoldNotes.begin()+iHoldIndex+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::AddAttackNote( int track, int row, Attack attack )
|
void NoteData::SetTapAttackNote( int track, int row, Attack attack )
|
||||||
{
|
{
|
||||||
PruneUnusedAttacksFromMap();
|
PruneUnusedAttacksFromMap();
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class NoteData
|
|||||||
void LoadOverlapped( const NoteData* pOriginal, int iNewNumTracks );
|
void LoadOverlapped( const NoteData* pOriginal, int iNewNumTracks );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/* Set up to hold the data in From; same number of tracks, same
|
/* Set up to hold the data in From; same number of tracks, same
|
||||||
* divisor. Doesn't allocate or copy anything. */
|
* divisor. Doesn't allocate or copy anything. */
|
||||||
void Config( const NoteData &From );
|
void Config( const NoteData &From );
|
||||||
@@ -46,6 +47,10 @@ public:
|
|||||||
int GetNumTracks() const;
|
int GetNumTracks() const;
|
||||||
void SetNumTracks( int iNewNumTracks );
|
void SetNumTracks( int iNewNumTracks );
|
||||||
|
|
||||||
|
// TODO: Think of better accessors
|
||||||
|
const map<TapNote,Attack>& GetAttackMap() const { return m_AttackMap; }
|
||||||
|
map<TapNote,Attack>& GetAttackMap() { return m_AttackMap; }
|
||||||
|
|
||||||
/* Return the note at the given track and row. Row may be out of
|
/* Return the note at the given track and row. Row may be out of
|
||||||
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
|
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
|
||||||
inline TapNote GetTapNote(unsigned track, int row) const
|
inline TapNote GetTapNote(unsigned track, int row) const
|
||||||
@@ -144,7 +149,7 @@ public:
|
|||||||
HoldNote &GetHoldNote( int index ) { return m_HoldNotes[index]; }
|
HoldNote &GetHoldNote( int index ) { return m_HoldNotes[index]; }
|
||||||
const HoldNote &GetHoldNote( int index ) const { return m_HoldNotes[index]; }
|
const HoldNote &GetHoldNote( int index ) const { return m_HoldNotes[index]; }
|
||||||
|
|
||||||
void AddAttackNote( int track, int row, Attack attack );
|
void SetTapAttackNote( int track, int row, Attack attack );
|
||||||
void PruneUnusedAttacksFromMap(); // slow
|
void PruneUnusedAttacksFromMap(); // slow
|
||||||
const Attack& GetAttackAt( int track, int row );
|
const Attack& GetAttackAt( int track, int row );
|
||||||
// remove Attacks with SetTapNote(TAP_EMPTY)
|
// remove Attacks with SetTapNote(TAP_EMPTY)
|
||||||
|
|||||||
@@ -52,8 +52,13 @@ NoteType NoteDataUtil::GetSmallestNoteTypeForMeasure( const NoteData &n, int iMe
|
|||||||
return nt;
|
return nt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData )
|
void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData, CString sSMAttackData )
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Load note data
|
||||||
|
//
|
||||||
|
|
||||||
/* Clear notes, but keep the same number of tracks. */
|
/* Clear notes, but keep the same number of tracks. */
|
||||||
int iNumTracks = out.GetNumTracks();
|
int iNumTracks = out.GetNumTracks();
|
||||||
out.Init();
|
out.Init();
|
||||||
@@ -97,8 +102,8 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData
|
|||||||
const float fBeat = (m + fPercentIntoMeasure) * BEATS_PER_MEASURE;
|
const float fBeat = (m + fPercentIntoMeasure) * BEATS_PER_MEASURE;
|
||||||
const int iIndex = BeatToNoteRow( fBeat );
|
const int iIndex = BeatToNoteRow( fBeat );
|
||||||
|
|
||||||
// if( m_iNumTracks != sMeasureLine.GetLength() )
|
// if( m_iNumTracks != sMeasureLine.GetLength() )
|
||||||
// RageException::Throw( "Actual number of note columns (%d) is different from the StepsType (%d).", m_iNumTracks, sMeasureLine.GetLength() );
|
// RageException::Throw( "Actual number of note columns (%d) is different from the StepsType (%d).", m_iNumTracks, sMeasureLine.GetLength() );
|
||||||
|
|
||||||
for( int c=0; c<min(sMeasureLine.GetLength(),out.GetNumTracks()); c++ )
|
for( int c=0; c<min(sMeasureLine.GetLength(),out.GetNumTracks()); c++ )
|
||||||
{
|
{
|
||||||
@@ -109,35 +114,85 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData
|
|||||||
case '1': t = TAP_TAP; break;
|
case '1': t = TAP_TAP; break;
|
||||||
case '2': t = TAP_HOLD_HEAD; break;
|
case '2': t = TAP_HOLD_HEAD; break;
|
||||||
case '3': t = TAP_HOLD_TAIL; break;
|
case '3': t = TAP_HOLD_TAIL; break;
|
||||||
// case 'm':
|
// case 'm':
|
||||||
// Don't be loose with the definition. Use only 'M' since
|
// Don't be loose with the definition. Use only 'M' since
|
||||||
// that's what we've been writing to disk. -Chris
|
// that's what we've been writing to disk. -Chris
|
||||||
case 'M': t = TAP_MINE; break;
|
case 'M': t = TAP_MINE; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if( sMeasureLine[c] >= 'a' && sMeasureLine[c] <= 'z' )
|
||||||
|
{
|
||||||
|
t = sMeasureLine[c];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* Invalid data. We don't want to assert, since there might
|
/* Invalid data. We don't want to assert, since there might
|
||||||
* simply be invalid data in an .SM, and we don't want to die
|
* simply be invalid data in an .SM, and we don't want to die
|
||||||
* due to invalid data. We should probably check for this when
|
* due to invalid data. We should probably check for this when
|
||||||
* we load SM data for the first time ... */
|
* we load SM data for the first time ... */
|
||||||
// ASSERT(0);
|
// ASSERT(0);
|
||||||
t = TAP_EMPTY; break;
|
t = TAP_EMPTY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
out.SetTapNote(c, iIndex, t);
|
out.SetTapNote(c, iIndex, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.Convert2sAnd3sToHoldNotes();
|
out.Convert2sAnd3sToHoldNotes();
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Load attack data
|
||||||
|
//
|
||||||
|
CStringArray asLines;
|
||||||
|
split( sSMAttackData, ",", asLines, true );
|
||||||
|
|
||||||
|
for( int i=0; i<asLines.size(); i++ )
|
||||||
|
{
|
||||||
|
CString& sLine = asLines[i];
|
||||||
|
TrimLeft( sLine );
|
||||||
|
TrimRight( sLine );
|
||||||
|
|
||||||
|
if( sLine.empty() )
|
||||||
|
continue; // skip
|
||||||
|
|
||||||
|
CStringArray asBits;
|
||||||
|
split( sLine, "=", asBits, true );
|
||||||
|
|
||||||
|
if( asBits.size() < 3 )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( asBits[0].empty() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
TapNote tn = asBits[0][0];
|
||||||
|
|
||||||
|
Attack attack;
|
||||||
|
attack.level = ATTACK_LEVEL_1;
|
||||||
|
attack.sModifier = asBits[1];
|
||||||
|
attack.sModifier.Replace( '.', ',' ); // we couldn't use comma here because the map item separator is a comma
|
||||||
|
attack.fSecsRemaining = atof( asBits[2] );
|
||||||
|
|
||||||
|
out.GetAttackMap()[tn] = attack;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteDataUtil::GetSMNoteDataString( const NoteData &in_, CString &out )
|
void NoteDataUtil::GetSMNoteDataString( const NoteData &in_, CString ¬es_out, CString &attacks_out )
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Get note data
|
||||||
|
//
|
||||||
NoteData in;
|
NoteData in;
|
||||||
in.To2sAnd3s( in_ );
|
in.To2sAnd3s( in_ );
|
||||||
|
|
||||||
float fLastBeat = in.GetLastBeat();
|
float fLastBeat = in.GetLastBeat();
|
||||||
int iLastMeasure = int( fLastBeat/BEATS_PER_MEASURE );
|
int iLastMeasure = int( fLastBeat/BEATS_PER_MEASURE );
|
||||||
|
|
||||||
CString &sRet = out;
|
CString &sRet = notes_out;
|
||||||
|
|
||||||
sRet = "\n"; /* data begins on a new line when written to disk */
|
sRet = "\n"; /* data begins on a new line when written to disk */
|
||||||
sRet.reserve( 1024*32 );
|
sRet.reserve( 1024*32 );
|
||||||
@@ -169,7 +224,17 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in_, CString &out )
|
|||||||
case TAP_HOLD_HEAD: c = '2'; break;
|
case TAP_HOLD_HEAD: c = '2'; break;
|
||||||
case TAP_HOLD_TAIL: c = '3'; break;
|
case TAP_HOLD_TAIL: c = '3'; break;
|
||||||
case TAP_MINE: c = 'M'; break;
|
case TAP_MINE: c = 'M'; break;
|
||||||
default: ASSERT(0); c = '0'; break;
|
default:
|
||||||
|
if( IsTapAttack(tn) )
|
||||||
|
{
|
||||||
|
c = tn;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ASSERT(0);
|
||||||
|
c = '0';
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
sRet.append(1, c);
|
sRet.append(1, c);
|
||||||
}
|
}
|
||||||
@@ -179,6 +244,27 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in_, CString &out )
|
|||||||
|
|
||||||
sRet.append(1, ',');
|
sRet.append(1, ',');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Get attack data
|
||||||
|
//
|
||||||
|
CStringArray asLines;
|
||||||
|
|
||||||
|
for( map<TapNote,Attack>::const_iterator iter = in_.GetAttackMap().begin();
|
||||||
|
iter != in_.GetAttackMap().end();
|
||||||
|
iter++ )
|
||||||
|
{
|
||||||
|
TapNote tn = iter->first;
|
||||||
|
Attack attack = iter->second;
|
||||||
|
attack.sModifier.Replace( ',', '.' ); // comma is the map item separator
|
||||||
|
|
||||||
|
asLines.push_back( ssprintf("%c=%s=%f,\n", tn, attack.sModifier.c_str(), attack.fSecsRemaining) );
|
||||||
|
}
|
||||||
|
|
||||||
|
attacks_out = join( ",", asLines );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float NoteDataUtil::GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds )
|
float NoteDataUtil::GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds )
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ struct PlayerOptions;
|
|||||||
namespace NoteDataUtil
|
namespace NoteDataUtil
|
||||||
{
|
{
|
||||||
NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex );
|
NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex );
|
||||||
void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData );
|
void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData, CString sSMAttackData );
|
||||||
void GetSMNoteDataString( const NoteData &in, CString &out );
|
void GetSMNoteDataString( const NoteData &in, CString ¬es_out, CString &attacks_out );
|
||||||
|
|
||||||
float GetStreamRadarValue( const NoteData &in, float fSongSeconds );
|
float GetStreamRadarValue( const NoteData &in, float fSongSeconds );
|
||||||
float GetVoltageRadarValue( const NoteData &in, float fSongSeconds );
|
float GetVoltageRadarValue( const NoteData &in, float fSongSeconds );
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ void SMLoader::LoadFromSMTokens(
|
|||||||
CString sMeter,
|
CString sMeter,
|
||||||
CString sRadarValues,
|
CString sRadarValues,
|
||||||
CString sNoteData,
|
CString sNoteData,
|
||||||
|
CString sAttackData,
|
||||||
Steps &out
|
Steps &out
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -47,7 +48,7 @@ void SMLoader::LoadFromSMTokens(
|
|||||||
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
|
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
|
||||||
out.SetRadarValue(r, (float)atof(saValues[r]));
|
out.SetRadarValue(r, (float)atof(saValues[r]));
|
||||||
|
|
||||||
out.SetSMNoteData(sNoteData);
|
out.SetSMNoteData(sNoteData, sAttackData);
|
||||||
|
|
||||||
out.TidyUpData();
|
out.TidyUpData();
|
||||||
}
|
}
|
||||||
@@ -277,14 +278,14 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
|||||||
ASSERT( pNewNotes );
|
ASSERT( pNewNotes );
|
||||||
out.m_apNotes.push_back( pNewNotes );
|
out.m_apNotes.push_back( pNewNotes );
|
||||||
|
|
||||||
if( iNumParams != 7 )
|
if( iNumParams < 7 )
|
||||||
{
|
{
|
||||||
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath.c_str(), iNumParams, 7 );
|
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have at least %d.", sPath.c_str(), iNumParams, 7 );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadFromSMTokens(
|
LoadFromSMTokens(
|
||||||
sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6],
|
sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], (iNumParams>=8)?sParams[7]:"",
|
||||||
*pNewNotes);
|
*pNewNotes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class SMLoader: public NotesLoader {
|
|||||||
CString sMeter,
|
CString sMeter,
|
||||||
CString sRadarValues,
|
CString sRadarValues,
|
||||||
CString sNoteData,
|
CString sNoteData,
|
||||||
|
CString sAttackData,
|
||||||
Steps &out);
|
Steps &out);
|
||||||
|
|
||||||
bool FromCache;
|
bool FromCache;
|
||||||
|
|||||||
@@ -109,7 +109,16 @@ void NotesWriterSM::WriteSMNotesTag( const Steps &in, FILE* fp )
|
|||||||
* newline and they'll accumulate. */
|
* newline and they'll accumulate. */
|
||||||
fprintf( fp, " %s:", join(",",asRadarValues).c_str() );
|
fprintf( fp, " %s:", join(",",asRadarValues).c_str() );
|
||||||
|
|
||||||
fprintf( fp, "%s;\n", in.GetSMNoteData().c_str() );
|
CString sNoteData;
|
||||||
|
CString sAttackData;
|
||||||
|
in.GetSMNoteData( sNoteData, sAttackData );
|
||||||
|
|
||||||
|
fprintf( fp, "%s", sNoteData.c_str() );
|
||||||
|
|
||||||
|
if( sAttackData.empty() )
|
||||||
|
fprintf( fp, ";\n" );
|
||||||
|
else
|
||||||
|
fprintf( fp, ":\n%s;\n", sAttackData.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
|
bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache)
|
||||||
|
|||||||
@@ -1282,7 +1282,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
attack.fSecsRemaining = g_fLastInsertAttackDurationSeconds;
|
attack.fSecsRemaining = g_fLastInsertAttackDurationSeconds;
|
||||||
attack.sModifier = sMods;
|
attack.sModifier = sMods;
|
||||||
|
|
||||||
m_NoteFieldEdit.AddAttackNote( g_iLastInsertAttackTrack, iSongIndex, attack );
|
m_NoteFieldEdit.SetTapAttackNote( g_iLastInsertAttackTrack, iSongIndex, attack );
|
||||||
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
|
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -550,7 +550,11 @@ static void DeleteDuplicateSteps( Song *song, vector<Steps*> &vSteps )
|
|||||||
if( s1->GetMeter() != s2->GetMeter() )
|
if( s1->GetMeter() != s2->GetMeter() )
|
||||||
continue;
|
continue;
|
||||||
/* Compare, ignoring whitespace. */
|
/* Compare, ignoring whitespace. */
|
||||||
if( RemoveInitialWhitespace(s1->GetSMNoteData()) != RemoveInitialWhitespace(s2->GetSMNoteData()) )
|
CString sSMNoteData1, sSMAttackData1;
|
||||||
|
s1->GetSMNoteData( sSMNoteData1, sSMAttackData1 );
|
||||||
|
CString sSMNoteData2, sSMAttackData2;
|
||||||
|
s2->GetSMNoteData( sSMNoteData2, sSMAttackData2 );
|
||||||
|
if( RemoveInitialWhitespace(sSMNoteData1) != RemoveInitialWhitespace(sSMNoteData2) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
LOG->Trace("Removed %p duplicate steps in song \"%s\" with description \"%s\" and meter \"%i\"",
|
LOG->Trace("Removed %p duplicate steps in song \"%s\" with description \"%s\" and meter \"%i\"",
|
||||||
|
|||||||
+19
-11
@@ -79,27 +79,35 @@ void Steps::GetNoteData( NoteData* pNoteDataOut ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Steps::SetSMNoteData( const CString &out )
|
void Steps::SetSMNoteData( const CString ¬es_comp_, const CString &attacks_comp_ )
|
||||||
{
|
{
|
||||||
delete notes;
|
delete notes;
|
||||||
notes = NULL;
|
notes = NULL;
|
||||||
|
|
||||||
if(!notes_comp)
|
if(!notes_comp)
|
||||||
notes_comp = new CString;
|
notes_comp = new CompressedNoteData;
|
||||||
|
|
||||||
*notes_comp = out;
|
notes_comp->notes = notes_comp_;
|
||||||
|
notes_comp->attacks = attacks_comp_;
|
||||||
}
|
}
|
||||||
|
|
||||||
CString Steps::GetSMNoteData() const
|
void Steps::GetSMNoteData( CString ¬es_comp_out, CString &attacks_comp_out ) const
|
||||||
{
|
{
|
||||||
if(!notes_comp)
|
if(!notes_comp)
|
||||||
{
|
{
|
||||||
if(!notes) return ""; /* no data is no data */
|
if(!notes)
|
||||||
notes_comp = new CString;
|
{
|
||||||
NoteDataUtil::GetSMNoteDataString( *notes, *notes_comp );
|
/* no data is no data */
|
||||||
|
notes_comp_out = attacks_comp_out = "";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *notes_comp;
|
notes_comp = new CompressedNoteData;
|
||||||
|
NoteDataUtil::GetSMNoteDataString( *notes, notes_comp->notes, notes_comp->attacks );
|
||||||
|
}
|
||||||
|
|
||||||
|
notes_comp_out = notes_comp->notes;
|
||||||
|
attacks_comp_out = notes_comp->attacks;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Steps::TidyUpData()
|
void Steps::TidyUpData()
|
||||||
@@ -177,7 +185,7 @@ void Steps::Decompress() const
|
|||||||
notes = new NoteData;
|
notes = new NoteData;
|
||||||
notes->SetNumTracks( GameManager::NotesTypeToNumTracks(m_StepsType) );
|
notes->SetNumTracks( GameManager::NotesTypeToNumTracks(m_StepsType) );
|
||||||
|
|
||||||
NoteDataUtil::LoadFromSMNoteDataString(*notes, *notes_comp);
|
NoteDataUtil::LoadFromSMNoteDataString(*notes, notes_comp->notes, notes_comp->attacks );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,8 +194,8 @@ void Steps::Compress() const
|
|||||||
if(!notes_comp)
|
if(!notes_comp)
|
||||||
{
|
{
|
||||||
if(!notes) return; /* no data is no data */
|
if(!notes) return; /* no data is no data */
|
||||||
notes_comp = new CString;
|
notes_comp = new CompressedNoteData;
|
||||||
NoteDataUtil::GetSMNoteDataString( *notes, *notes_comp );
|
NoteDataUtil::GetSMNoteDataString( *notes, notes_comp->notes, notes_comp->attacks );
|
||||||
}
|
}
|
||||||
|
|
||||||
delete notes;
|
delete notes;
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ public:
|
|||||||
|
|
||||||
void GetNoteData( NoteData* pNoteDataOut ) const;
|
void GetNoteData( NoteData* pNoteDataOut ) const;
|
||||||
void SetNoteData( const NoteData* pNewNoteData );
|
void SetNoteData( const NoteData* pNewNoteData );
|
||||||
void SetSMNoteData( const CString &out );
|
void SetSMNoteData( const CString ¬es_comp, const CString &attacks_comp );
|
||||||
CString GetSMNoteData() const;
|
void GetSMNoteData( CString ¬es_comp_out, CString &attacks_comp_out ) const;
|
||||||
|
|
||||||
|
|
||||||
struct MemCardData
|
struct MemCardData
|
||||||
@@ -115,7 +115,11 @@ protected:
|
|||||||
* Call Compress() to force us to only have notes_comp; otherwise, creation of
|
* Call Compress() to force us to only have notes_comp; otherwise, creation of
|
||||||
* these is transparent. */
|
* these is transparent. */
|
||||||
mutable NoteData *notes;
|
mutable NoteData *notes;
|
||||||
mutable CString *notes_comp;
|
struct CompressedNoteData
|
||||||
|
{
|
||||||
|
CString notes, attacks;
|
||||||
|
};
|
||||||
|
mutable CompressedNoteData *notes_comp;
|
||||||
|
|
||||||
const Steps *Real() const;
|
const Steps *Real() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user