Support BGAnimation sound defined in BGAnimation.ini
This commit is contained in:
@@ -51,7 +51,7 @@ void BGAnimation::LoadFromAniDir( CString sAniDir )
|
|||||||
{
|
{
|
||||||
Unload();
|
Unload();
|
||||||
|
|
||||||
if( sAniDir.Right(1) != "/" )
|
if( !sAniDir.empty() && sAniDir.Right(1) != "/" )
|
||||||
sAniDir += "/";
|
sAniDir += "/";
|
||||||
|
|
||||||
ASSERT( IsADirectory(sAniDir) );
|
ASSERT( IsADirectory(sAniDir) );
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "TransitionBGAnimation.h"
|
#include "TransitionBGAnimation.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
|
#include "IniFile.h"
|
||||||
|
|
||||||
|
|
||||||
TransitionBGAnimation::TransitionBGAnimation()
|
TransitionBGAnimation::TransitionBGAnimation()
|
||||||
@@ -23,9 +24,21 @@ TransitionBGAnimation::TransitionBGAnimation()
|
|||||||
|
|
||||||
void TransitionBGAnimation::Load( CString sBGAniDir )
|
void TransitionBGAnimation::Load( CString sBGAniDir )
|
||||||
{
|
{
|
||||||
|
if( !sBGAniDir.empty() && sBGAniDir.Right(1) != "/" )
|
||||||
|
sBGAniDir += "/";
|
||||||
|
|
||||||
m_BGAnimation.LoadFromAniDir( sBGAniDir );
|
m_BGAnimation.LoadFromAniDir( sBGAniDir );
|
||||||
|
|
||||||
m_sound.Load( sBGAniDir );
|
// load sound from file specified by ini, or use the first sound in the directory
|
||||||
|
IniFile ini;
|
||||||
|
ini.SetPath( sBGAniDir+"BGAnimation.ini" );
|
||||||
|
ini.ReadFile();
|
||||||
|
|
||||||
|
CString sSoundFileName;
|
||||||
|
if( ini.GetValue("BGAnimation","Sound",sSoundFileName) )
|
||||||
|
m_sound.Load( sBGAniDir+sSoundFileName );
|
||||||
|
else
|
||||||
|
m_sound.Load( sBGAniDir );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user