deep copy AutoActors

This commit is contained in:
Glenn Maynard
2005-09-22 00:19:21 +00:00
parent fb49d6a41a
commit 8e926829fc
2 changed files with 19 additions and 0 deletions
+17
View File
@@ -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();
+2
View File
@@ -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; }