Add AutoActor::IsLoaded.

Don't dereference an unloaded AutoActor.
Add const accessors.
This commit is contained in:
Glenn Maynard
2003-10-31 03:54:46 +00:00
parent d0a3d7ade4
commit 580c5899b0
+5 -2
View File
@@ -54,9 +54,12 @@ class AutoActor
public:
AutoActor() { m_pActor = NULL; }
~AutoActor() { Unload(); }
operator Actor* () { return m_pActor; }
Actor *operator->() { return m_pActor; }
operator const Actor* () const { ASSERT(m_pActor); return m_pActor; }
operator Actor* () { ASSERT(m_pActor); return m_pActor; }
const Actor *operator->() const { ASSERT(m_pActor); return m_pActor; }
Actor *operator->() { ASSERT(m_pActor); return m_pActor; }
void Unload() { if(m_pActor) { delete m_pActor; m_pActor=NULL; } }
bool IsLoaded() const { return m_pActor != NULL; }
void Load( CString sPath )
{
Unload();