Added video banner logic in ScreenSelectMusic
Currently, video banners are treated the same as still-image banners, where we assume we need to let the low-res banner fade in before swapping it out with the high-res banner. This isn't the correct way to handle video banners, since we don't make low-res placeholders for them, so we now check the banner's extension to see if it's a video or not, and directly load the video if so.
This commit is contained in:
@@ -1743,6 +1743,15 @@ void ScreenSelectMusic::SwitchToPreferredDifficulty()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsVideoFile(const RString& path) {
|
||||||
|
const RString extension = GetExtension(path);
|
||||||
|
return extension == "mp4" ||
|
||||||
|
extension == "avi" ||
|
||||||
|
extension == "mov" ||
|
||||||
|
extension == "mkv" ||
|
||||||
|
extension == "mpg";
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenSelectMusic::AfterMusicChange()
|
void ScreenSelectMusic::AfterMusicChange()
|
||||||
{
|
{
|
||||||
if( !m_MusicWheel.IsRouletting() )
|
if( !m_MusicWheel.IsRouletting() )
|
||||||
@@ -2004,6 +2013,14 @@ void ScreenSelectMusic::AfterMusicChange()
|
|||||||
if( bWantBanner )
|
if( bWantBanner )
|
||||||
{
|
{
|
||||||
LOG->Trace("LoadFromCachedBanner(%s)",g_sBannerPath .c_str());
|
LOG->Trace("LoadFromCachedBanner(%s)",g_sBannerPath .c_str());
|
||||||
|
if( IsVideoFile(g_sBannerPath) )
|
||||||
|
{
|
||||||
|
// Directly load the video file.
|
||||||
|
m_Banner.LoadFromCachedBanner(g_sBannerPath);
|
||||||
|
g_bBannerWaiting = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if( m_Banner.LoadFromCachedBanner( g_sBannerPath ) )
|
if( m_Banner.LoadFromCachedBanner( g_sBannerPath ) )
|
||||||
{
|
{
|
||||||
/* If the high-res banner is already loaded, just delay before
|
/* If the high-res banner is already loaded, just delay before
|
||||||
@@ -2014,6 +2031,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
|||||||
g_bBannerWaiting = true;
|
g_bBannerWaiting = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Don't stop music if it's already playing the right file.
|
// Don't stop music if it's already playing the right file.
|
||||||
g_bSampleMusicWaiting = false;
|
g_bSampleMusicWaiting = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user