From 0955501855bca765f0f763e08db031531904a6bc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 12 Nov 2006 04:38:44 +0000 Subject: [PATCH] merge code; make DeAutogen private --- stepmania/src/Steps.cpp | 17 ++++++----------- stepmania/src/Steps.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 7f6d615175..4d150d1dbc 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -65,14 +65,7 @@ void Steps::SetNoteData( const NoteData& noteDataNew ) { ASSERT( noteDataNew.GetNumTracks() == GameManager::StepsTypeToNumTracks(m_StepsType) ); - if( parent ) - { - 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; - } + DeAutogen( false ); *m_pNoteData = noteDataNew; m_bNoteDataIsFilled = true; @@ -315,12 +308,13 @@ void Steps::Compress() const /* Copy our parent's data. This is done when we're being changed from autogen * to normal. (needed?) */ -void Steps::DeAutogen() +void Steps::DeAutogen( bool bCopyNoteData ) { if( !parent ) return; /* OK */ - Decompress(); // fills in m_pNoteData with sliding window transform + if( bCopyNoteData ) + Decompress(); // fills in m_pNoteData with sliding window transform m_sDescription = Real()->m_sDescription; m_Difficulty = Real()->m_Difficulty; @@ -329,7 +323,8 @@ void Steps::DeAutogen() parent = NULL; - Compress(); + if( bCopyNoteData ) + Compress(); } void Steps::AutogenFrom( const Steps *parent_, StepsType ntTo ) diff --git a/stepmania/src/Steps.h b/stepmania/src/Steps.h index a523b957ad..9d1f8f6d9c 100644 --- a/stepmania/src/Steps.h +++ b/stepmania/src/Steps.h @@ -28,7 +28,6 @@ public: void Compress() 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? // Use a special value of difficulty @@ -70,6 +69,7 @@ public: StepsType m_StepsType; private: 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 * source. If this is true, m_sNoteDataCompressed will always be empty. */