cleanup
This commit is contained in:
@@ -13,10 +13,10 @@
|
|||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
|
||||||
|
|
||||||
BGAnimation::BGAnimation( bool Generic )
|
BGAnimation::BGAnimation( bool bGeneric )
|
||||||
{
|
{
|
||||||
/* See BGAnimationLayer::BGAnimationLayer for explanation. */
|
/* See BGAnimationLayer::BGAnimationLayer for explanation. */
|
||||||
m_bGeneric = Generic;
|
m_bGeneric = bGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
BGAnimation::~BGAnimation()
|
BGAnimation::~BGAnimation()
|
||||||
@@ -50,7 +50,7 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 )
|
|||||||
return i1 < i2;
|
return i1 < i2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo, bool Generic )
|
void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo )
|
||||||
{
|
{
|
||||||
if( _sAniDir.empty() )
|
if( _sAniDir.empty() )
|
||||||
return;
|
return;
|
||||||
@@ -105,12 +105,12 @@ void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo,
|
|||||||
// import a whole BGAnimation
|
// import a whole BGAnimation
|
||||||
sImportDir = sAniDir + sImportDir;
|
sImportDir = sAniDir + sImportDir;
|
||||||
CollapsePath( sImportDir );
|
CollapsePath( sImportDir );
|
||||||
AddLayersFromAniDir( sImportDir, layersAddTo, Generic );
|
AddLayersFromAniDir( sImportDir, layersAddTo );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// import as a single layer
|
// import as a single layer
|
||||||
BGAnimationLayer* pLayer = new BGAnimationLayer( Generic );
|
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
|
||||||
pLayer->LoadFromNode( sAniDir, *pKey );
|
pLayer->LoadFromNode( sAniDir, *pKey );
|
||||||
layersAddTo.push_back( pLayer );
|
layersAddTo.push_back( pLayer );
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
|
|||||||
if( DoesFileExist(sPathToIni) )
|
if( DoesFileExist(sPathToIni) )
|
||||||
{
|
{
|
||||||
// This is a new style BGAnimation (using .ini)
|
// This is a new style BGAnimation (using .ini)
|
||||||
AddLayersFromAniDir( sAniDir, m_SubActors, m_bGeneric ); // TODO: Check for circular load
|
AddLayersFromAniDir( sAniDir, m_SubActors ); // TODO: Check for circular load
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.ReadFile( sPathToIni );
|
ini.ReadFile( sPathToIni );
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public:
|
|||||||
void LoadFromNode( const CString &sDir, const XNode& node );
|
void LoadFromNode( const CString &sDir, const XNode& node );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo );
|
||||||
bool m_bGeneric;
|
bool m_bGeneric;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -29,32 +29,14 @@ const float SPIRAL_MIN_ZOOM = 0.3f;
|
|||||||
#define FullScreenRectF RectF(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM)
|
#define FullScreenRectF RectF(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM)
|
||||||
|
|
||||||
|
|
||||||
BGAnimationLayer::BGAnimationLayer( bool Generic )
|
BGAnimationLayer::BGAnimationLayer( bool bGeneric )
|
||||||
{
|
{
|
||||||
/* If Generic is false, this is a layer in a real BGA--one that was loaded
|
/*
|
||||||
* by simply constructing a BGAnimation. These normally have a position
|
* If Generic is false, this is a layer in a real BGA--one that was loaded
|
||||||
* of 0,0 (top-left of the screen). Loaded images are given a default position
|
* by simply constructing a BGAnimation. In this mode, loaded images are given
|
||||||
* of 320x240, centered in the screen. Additionally, the "On" command will
|
* a default position of SCREEN_CENTER_X, SCREEN_CENTER_Y.
|
||||||
* be run automatically. Example:
|
|
||||||
*
|
|
||||||
* BGAnimation bga;
|
|
||||||
* bga.Load( path );
|
|
||||||
* this->AddChind( &bga );
|
|
||||||
*
|
|
||||||
* If Generic is true, then we act like any other actor. We assume we don't
|
|
||||||
* know anything about where we're positioned. Loaded images are given a
|
|
||||||
* default position of 0x0. The "On" command is not run; we'll receive that
|
|
||||||
* from the owner through COMMAND(). Example:
|
|
||||||
*
|
|
||||||
* AutoActor image;
|
|
||||||
* image.Load( path );
|
|
||||||
* ON_COMMAND( image );
|
|
||||||
* this->AddChind( &image );
|
|
||||||
*
|
|
||||||
* TYPE_PARTICLES and TYPE_TILES are currently not supported in this mode.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
m_bGeneric = Generic;
|
m_bGeneric = bGeneric;
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user