From b003670ff3749ef66ff913e70f71db684eae2da5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 26 Feb 2005 09:55:34 +0000 Subject: [PATCH] AutoActor::LoadFromNode --- stepmania/src/AutoActor.cpp | 7 +++++++ stepmania/src/AutoActor.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/stepmania/src/AutoActor.cpp b/stepmania/src/AutoActor.cpp index 73de0b039a..67eb35f766 100644 --- a/stepmania/src/AutoActor.cpp +++ b/stepmania/src/AutoActor.cpp @@ -16,6 +16,13 @@ void AutoActor::Load( const CString &sPath ) m_pActor = ActorUtil::MakeActor( sPath ); } +void AutoActor::LoadFromNode( const CString &sDir, const XNode* pNode ) +{ + Unload(); + + m_pActor = ActorUtil::LoadFromActorFile( sDir, pNode ); +} + void AutoActor::LoadAndSetName( const CString &sScreenName, const CString &sActorName ) { Load( THEME->GetPathG(sScreenName,sActorName) ); diff --git a/stepmania/src/AutoActor.h b/stepmania/src/AutoActor.h index b7878addd1..3ad868b2ce 100644 --- a/stepmania/src/AutoActor.h +++ b/stepmania/src/AutoActor.h @@ -4,6 +4,7 @@ #define AutoActor_H class Actor; +struct XNode; // creates the appropriate Actor derivitive on load and // automatically deletes Actor on deconstruction. @@ -19,6 +20,7 @@ public: void Unload(); bool IsLoaded() const { return m_pActor != NULL; } void Load( const CString &sPath ); + void LoadFromNode( const CString &sDir, const XNode* pNode ); void LoadAndSetName( const CString &sScreenName, const CString &sActorName ); protected: