From 8e926829fc8224c95a7f9e3d347286aaa5ed421d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Sep 2005 00:19:21 +0000 Subject: [PATCH] deep copy AutoActors --- stepmania/src/AutoActor.cpp | 17 +++++++++++++++++ stepmania/src/AutoActor.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/stepmania/src/AutoActor.cpp b/stepmania/src/AutoActor.cpp index 500f28b45e..f1a0946023 100644 --- a/stepmania/src/AutoActor.cpp +++ b/stepmania/src/AutoActor.cpp @@ -10,6 +10,23 @@ void AutoActor::Unload() m_pActor=NULL; } +AutoActor::AutoActor( const AutoActor &cpy ) +{ + if( cpy.m_pActor == NULL ) + m_pActor = NULL; + else + m_pActor = cpy.m_pActor->Copy(); +} + +AutoActor &AutoActor::operator=( const AutoActor &cpy ) +{ + if( cpy.m_pActor == NULL ) + m_pActor = NULL; + else + m_pActor = cpy.m_pActor->Copy(); + return *this; +} + void AutoActor::Load( const CString &sPath ) { Unload(); diff --git a/stepmania/src/AutoActor.h b/stepmania/src/AutoActor.h index 3ad868b2ce..a68c952f09 100644 --- a/stepmania/src/AutoActor.h +++ b/stepmania/src/AutoActor.h @@ -13,6 +13,8 @@ class AutoActor public: AutoActor() { m_pActor = NULL; } ~AutoActor() { Unload(); } + AutoActor( const AutoActor &cpy ); + AutoActor &operator =( const AutoActor &cpy ); operator const Actor* () const { return m_pActor; } operator Actor* () { return m_pActor; } const Actor *operator->() const { return m_pActor; }