This commit is contained in:
Glenn Maynard
2005-01-15 19:42:47 +00:00
parent c9091a1214
commit 6d64f3aa78
3 changed files with 13 additions and 30 deletions
+6 -6
View File
@@ -13,10 +13,10 @@
#include "Foreach.h"
BGAnimation::BGAnimation( bool Generic )
BGAnimation::BGAnimation( bool bGeneric )
{
/* See BGAnimationLayer::BGAnimationLayer for explanation. */
m_bGeneric = Generic;
m_bGeneric = bGeneric;
}
BGAnimation::~BGAnimation()
@@ -50,7 +50,7 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 )
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() )
return;
@@ -105,12 +105,12 @@ void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo,
// import a whole BGAnimation
sImportDir = sAniDir + sImportDir;
CollapsePath( sImportDir );
AddLayersFromAniDir( sImportDir, layersAddTo, Generic );
AddLayersFromAniDir( sImportDir, layersAddTo );
}
else
{
// import as a single layer
BGAnimationLayer* pLayer = new BGAnimationLayer( Generic );
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
pLayer->LoadFromNode( sAniDir, *pKey );
layersAddTo.push_back( pLayer );
}
@@ -136,7 +136,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
if( DoesFileExist(sPathToIni) )
{
// 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;
ini.ReadFile( sPathToIni );
+1
View File
@@ -24,6 +24,7 @@ public:
void LoadFromNode( const CString &sDir, const XNode& node );
protected:
void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo );
bool m_bGeneric;
};
+6 -24
View File
@@ -29,32 +29,14 @@ const float SPIRAL_MIN_ZOOM = 0.3f;
#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
* of 0,0 (top-left of the screen). Loaded images are given a default position
* of 320x240, centered in the screen. Additionally, the "On" command will
* 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.
*
/*
* If Generic is false, this is a layer in a real BGA--one that was loaded
* by simply constructing a BGAnimation. In this mode, loaded images are given
* a default position of SCREEN_CENTER_X, SCREEN_CENTER_Y.
*/
m_bGeneric = Generic;
m_bGeneric = bGeneric;
Init();
}