CString -> RString

This commit is contained in:
Chris Danford
2006-01-22 01:00:06 +00:00
parent 870ed267fc
commit 7f821e8cfc
578 changed files with 3943 additions and 3946 deletions
+15 -15
View File
@@ -17,7 +17,7 @@ BGAnimation::~BGAnimation()
DeleteAllChildren();
}
static bool CompareLayerNames( const CString& s1, const CString& s2 )
static bool CompareLayerNames( const RString& s1, const RString& s2 )
{
int i1, i2;
int ret;
@@ -29,12 +29,12 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 )
return i1 < i2;
}
void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNode )
void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNode )
{
const CString& sAniDir = _sAniDir;
const RString& sAniDir = _sAniDir;
{
vector<CString> vsLayerNames;
vector<RString> vsLayerNames;
FOREACH_CONST_Child( pNode, pLayer )
{
if( strncmp(pLayer->m_sName, "Layer", 5) == 0 )
@@ -44,16 +44,16 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNo
sort( vsLayerNames.begin(), vsLayerNames.end(), CompareLayerNames );
FOREACH_CONST( CString, vsLayerNames, s )
FOREACH_CONST( RString, vsLayerNames, s )
{
const CString &sLayer = *s;
const RString &sLayer = *s;
const XNode* pKey = pNode->GetChild( sLayer );
ASSERT( pKey );
CString sImportDir;
RString sImportDir;
if( pKey->GetAttrValue("Import", sImportDir) )
{
CString expr;
RString expr;
if( pKey->GetAttrValue("Condition",expr) )
{
if( !LuaHelpers::RunExpressionB( expr ) )
@@ -69,7 +69,7 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNo
ASSERT_M( IsADirectory(sImportDir), sImportDir + " isn't a directory" );
CString sPathToIni = sImportDir + "BGAnimation.ini";
RString sPathToIni = sImportDir + "BGAnimation.ini";
IniFile ini2;
ini2.ReadFile( sPathToIni );
@@ -87,20 +87,20 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNo
}
}
void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
void BGAnimation::LoadFromAniDir( const RString &_sAniDir )
{
DeleteAllChildren();
if( _sAniDir.empty() )
return;
CString sAniDir = _sAniDir;
RString sAniDir = _sAniDir;
if( sAniDir.Right(1) != "/" )
sAniDir += "/";
ASSERT_M( IsADirectory(sAniDir), sAniDir + " isn't a directory" );
CString sPathToIni = sAniDir + "BGAnimation.ini";
RString sPathToIni = sAniDir + "BGAnimation.ini";
if( DoesFileExist(sPathToIni) )
{
@@ -123,7 +123,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
// This is an old style BGAnimation (not using .ini)
// loading a directory of layers
vector<CString> asImagePaths;
vector<RString> asImagePaths;
ASSERT( sAniDir != "" );
GetDirListing( sAniDir+"*.png", asImagePaths, false, true );
@@ -137,7 +137,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
for( unsigned i=0; i<asImagePaths.size(); i++ )
{
const CString sPath = asImagePaths[i];
const RString sPath = asImagePaths[i];
if( Basename(sPath).Left(1) == "_" )
continue; // don't directly load files starting with an underscore
BGAnimationLayer* pLayer = new BGAnimationLayer;
@@ -147,7 +147,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
}
}
void BGAnimation::LoadFromNode( const CString& sDir, const XNode* pNode )
void BGAnimation::LoadFromNode( const RString& sDir, const XNode* pNode )
{
ActorFrame::LoadFromNode( sDir, pNode );