fix broken autogen in ScreenEditMenu

This commit is contained in:
Chris Danford
2003-03-13 01:26:50 +00:00
parent 767894800b
commit d91d043fa9
4 changed files with 28 additions and 24 deletions
+21 -17
View File
@@ -142,10 +142,13 @@ void Notes::TidyUpData()
void Notes::Decompress() const
{
if(notes) return;
if(parent)
if(notes)
{
return; // already decompressed
}
else if(parent)
{
// get autogen notes
NoteData pdata;
parent->GetNoteData(&pdata);
@@ -158,13 +161,18 @@ void Notes::Decompress() const
return;
}
else if(!notes_comp)
{
return; /* there is no data */
}
else
{
// load from compressed
notes = new NoteData;
notes->SetNumTracks( GameManager::NotesTypeToNumTracks(m_NotesType) );
if(!notes_comp) return; /* no data is no data */
notes = new NoteData;
notes->SetNumTracks( GameManager::NotesTypeToNumTracks(m_NotesType) );
NoteDataUtil::LoadFromSMNoteDataString(*notes, *notes_comp);
NoteDataUtil::LoadFromSMNoteDataString(*notes, *notes_comp);
}
}
void Notes::Compress() const
@@ -186,21 +194,17 @@ void Notes::DeAutogen()
if(!parent)
return; /* OK */
Decompress(); // fills in notes with sliding window transform
m_iMeter = Real()->m_iMeter;
m_sDescription = Real()->m_sDescription;
m_Difficulty = Real()->m_Difficulty;
for(int i = 0; i < NUM_RADAR_CATEGORIES; ++i)
m_fRadarValues[i] = Real()->m_fRadarValues[i];
delete notes;
notes = NULL;
if(!notes_comp)
notes_comp = new CString;
*notes_comp = parent->GetSMNoteData();
parent = NULL;
Compress();
}
void Notes::AutogenFrom( Notes *parent_, NotesType ntTo )