merge code; make DeAutogen private
This commit is contained in:
@@ -65,14 +65,7 @@ void Steps::SetNoteData( const NoteData& noteDataNew )
|
|||||||
{
|
{
|
||||||
ASSERT( noteDataNew.GetNumTracks() == GameManager::StepsTypeToNumTracks(m_StepsType) );
|
ASSERT( noteDataNew.GetNumTracks() == GameManager::StepsTypeToNumTracks(m_StepsType) );
|
||||||
|
|
||||||
if( parent )
|
DeAutogen( false );
|
||||||
{
|
|
||||||
copy( parent->m_CachedRadarValues, parent->m_CachedRadarValues + NUM_PLAYERS, m_CachedRadarValues );
|
|
||||||
m_sDescription = parent->m_sDescription;
|
|
||||||
m_Difficulty = parent->m_Difficulty;
|
|
||||||
m_iMeter = parent->m_iMeter;
|
|
||||||
parent = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
*m_pNoteData = noteDataNew;
|
*m_pNoteData = noteDataNew;
|
||||||
m_bNoteDataIsFilled = true;
|
m_bNoteDataIsFilled = true;
|
||||||
@@ -315,11 +308,12 @@ void Steps::Compress() const
|
|||||||
|
|
||||||
/* Copy our parent's data. This is done when we're being changed from autogen
|
/* Copy our parent's data. This is done when we're being changed from autogen
|
||||||
* to normal. (needed?) */
|
* to normal. (needed?) */
|
||||||
void Steps::DeAutogen()
|
void Steps::DeAutogen( bool bCopyNoteData )
|
||||||
{
|
{
|
||||||
if( !parent )
|
if( !parent )
|
||||||
return; /* OK */
|
return; /* OK */
|
||||||
|
|
||||||
|
if( bCopyNoteData )
|
||||||
Decompress(); // fills in m_pNoteData with sliding window transform
|
Decompress(); // fills in m_pNoteData with sliding window transform
|
||||||
|
|
||||||
m_sDescription = Real()->m_sDescription;
|
m_sDescription = Real()->m_sDescription;
|
||||||
@@ -329,6 +323,7 @@ void Steps::DeAutogen()
|
|||||||
|
|
||||||
parent = NULL;
|
parent = NULL;
|
||||||
|
|
||||||
|
if( bCopyNoteData )
|
||||||
Compress();
|
Compress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ public:
|
|||||||
|
|
||||||
void Compress() const;
|
void Compress() const;
|
||||||
void Decompress() const;
|
void Decompress() const;
|
||||||
void DeAutogen(); /* If this Steps is autogenerated, make it a real Steps. */
|
|
||||||
bool IsAutogen() const { return parent != NULL; } // Was created by autogen?
|
bool IsAutogen() const { return parent != NULL; } // Was created by autogen?
|
||||||
|
|
||||||
// Use a special value of difficulty
|
// Use a special value of difficulty
|
||||||
@@ -70,6 +69,7 @@ public:
|
|||||||
StepsType m_StepsType;
|
StepsType m_StepsType;
|
||||||
private:
|
private:
|
||||||
inline const Steps *Real() const { return parent ? parent : this; }
|
inline const Steps *Real() const { return parent ? parent : this; }
|
||||||
|
void DeAutogen( bool bCopyNoteData = true ); /* If this Steps is autogenerated, make it a real Steps. */
|
||||||
|
|
||||||
/* If this Steps is autogenerated, this will point to the autogen
|
/* If this Steps is autogenerated, this will point to the autogen
|
||||||
* source. If this is true, m_sNoteDataCompressed will always be empty. */
|
* source. If this is true, m_sNoteDataCompressed will always be empty. */
|
||||||
|
|||||||
Reference in New Issue
Block a user