ActorScroller::LoadFromIni -> ActorScroller::LoadFromNode

This commit is contained in:
Glenn Maynard
2005-01-15 13:47:02 +00:00
parent 2ecbfae787
commit 4267a5f942
3 changed files with 8 additions and 11 deletions
+3 -3
View File
@@ -39,11 +39,11 @@ void ActorScroller::Load(
m_bLoaded = true; m_bLoaded = true;
} }
void ActorScroller::LoadFromIni( const IniFile &ini, const CString &sKey ) void ActorScroller::LoadFromNode( const CString &sFile, const XNode *pNode )
{ {
#define REQUIRED_GET_VALUE( szName, valueOut ) \ #define REQUIRED_GET_VALUE( szName, valueOut ) \
if( !ini.GetValue( sKey, szName, valueOut ) ) \ if( !pNode->GetAttrValue( szName, valueOut ) ) \
Dialog::OK( ssprintf("File '%s' is missing the value Scroller::%s", ini.GetPath().c_str(), szName) ); Dialog::OK( ssprintf("File '%s' is missing the value Scroller::%s", sFile.c_str(), szName) );
float fSecondsPerItem = 1; float fSecondsPerItem = 1;
float fNumItemsToDraw = 7; float fNumItemsToDraw = 7;
+2 -3
View File
@@ -5,8 +5,7 @@
#include "ActorFrame.h" #include "ActorFrame.h"
class IniFile; struct XNode;
class ActorScroller : public ActorFrame class ActorScroller : public ActorFrame
{ {
public: public:
@@ -23,7 +22,7 @@ public:
virtual void Update( float fDelta ); virtual void Update( float fDelta );
virtual void DrawPrimitives(); // DOES draw virtual void DrawPrimitives(); // DOES draw
void LoadFromIni( const IniFile &ini, const CString &sKey ); void LoadFromNode( const CString &sFile, const XNode *pNode );
void SetDestinationItem( int iItem ) { m_fDestinationItem = float(iItem); } void SetDestinationItem( int iItem ) { m_fDestinationItem = float(iItem); }
void SetCurrentAndDestinationItem( int iItem ) { m_fCurrentItem = m_fDestinationItem = float(iItem); } void SetCurrentAndDestinationItem( int iItem ) { m_fCurrentItem = m_fDestinationItem = float(iItem); }
+3 -5
View File
@@ -149,11 +149,9 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
pBGAnimation = &dummy; pBGAnimation = &dummy;
LoadFromNode( sAniDir, *pBGAnimation ); LoadFromNode( sAniDir, *pBGAnimation );
bool bUseScroller; const XNode* pScrollerNode = ini.GetChild( "Scroller" );
if( ini.GetValue( "BGAnimation", "UseScroller", bUseScroller ) && bUseScroller ) if( pScrollerNode != NULL )
{ ActorScroller::LoadFromNode( ini.GetPath(), pScrollerNode );
ActorScroller::LoadFromIni( ini, "Scroller" );
}
} }
else else
{ {