Esempio n. 1
0
/* If this returns true, a low-resolution banner was loaded, and the full-res
 * banner should be loaded later. */
bool FadingBanner::LoadFromCachedBanner( const CString &path )
{
	/* If we're already on the given banner, don't fade again. */
	if( path != "" && m_Banner[GetBackIndex()].GetTexturePath() == path )
		return false;

	if( path == "" )
	{
		LoadFallback();
		return false;
	}

	/* If we're currently fading to the given banner, go through this again,
	 * which will cause the fade-in to be further delayed. */

	RageTextureID ID;
	bool bLowRes = (PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_FULL);
	if( !bLowRes )
	{
		ID = path;
		Sprite::SongBannerTexture( ID );
	}
	else
	{
		/* Try to load the low quality version. */
		ID = BANNERCACHE->LoadCachedBanner( path );
	}

	if( !TEXTUREMAN->IsTextureRegistered(ID) )
	{
		/* Oops.  We couldn't load a banner quickly.  We can load the actual
		 * banner, but that's slow, so we don't want to do that when we're moving
		 * fast on the music wheel.  In that case, we should just keep the banner
		 * that's there (or load a "moving fast" banner).  Once we settle down,
		 * we'll get called again and load the real banner. */

		if( m_bMovingFast )
			return false;

		if( IsAFile(path) )
			Load( path );
		else
			LoadFallback();

		return false;
	}

	BeforeChange();
	m_Banner[GetBackIndex()].Load( ID );

	return bLowRes;
}
Esempio n. 2
0
void ScreenSelectStyle::UpdateSelectableChoices()
{
	for( unsigned i=0; i<m_aGameCommands.size(); i++ )
	{
		/* If the icon is text, use a dimmer diffuse, or we won't be
		 * able to see the glow. */
		if( m_aGameCommands[i].IsPlayable() )
		{
			m_sprIcon[i].SetDiffuse( RageColor(1,1,1,1) );
			m_textIcon[i].SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) );	// gray so glow is visible
		}
		else
		{
			m_sprIcon[i].SetDiffuse( DISABLED_COLOR );
			m_textIcon[i].SetDiffuse( DISABLED_COLOR );
		}
	}

	// Select the first enabled choice.
	BeforeChange();

	int iSwitchToStyleIndex = -1;	// -1 means none found
	for( unsigned i=0; i<m_aGameCommands.size(); i++ )
	{
		const GameCommand& mc = m_aGameCommands[i];
		if( mc.IsPlayable() )
		{
			iSwitchToStyleIndex = i;
			break;
		}
	}

	if( iSwitchToStyleIndex == -1 )// no styles are enabled.  We're stuck!
	{
		DEBUG_ASSERT(0);
		SCREENMAN->SystemMessage( "No Styles are selectable." );
		SCREENMAN->SetNewScreen( INITIAL_SCREEN );
		return;
	}
	

	m_iSelection = iSwitchToStyleIndex;
	AfterChange();
}
Esempio n. 3
0
void ScreenSelectStyle::MenuRight( PlayerNumber pn )
{
	int iSwitchToIndex = -1;	// -1 means none found
	for( unsigned i=m_iSelection+1; i<m_aGameCommands.size(); i++ )	
	{
		if( m_aGameCommands[i].IsPlayable() )
		{
			iSwitchToIndex = i;
			break;
		}
	}

	if( iSwitchToIndex == -1 )
		return;

	BeforeChange();
	m_iSelection = iSwitchToIndex;
	m_soundChange.Play();
	AfterChange();
}
Esempio n. 4
0
void ScreenSelectStyle::MenuLeft( PlayerNumber pn )
{
	int iSwitchToIndex = -1;	// -1 means none found
	for( int i=m_iSelection-1; i>=0; i-- )
	{
		if( m_aGameCommands[i].IsPlayable() )
		{
			iSwitchToIndex = i;
			break;
		}
	}

	if( iSwitchToIndex == -1 )
		return;

	BeforeChange();
	m_iSelection = iSwitchToIndex;
	m_soundChange.Play();
	AfterChange();
}
Esempio n. 5
0
void FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes )
{
	BeforeChange( bLowResToHighRes );
	m_Banner[m_iIndexLatest].Load(ID);

	/* XXX: Hack to keep movies from updating multiple times.
	 * We need to either completely disallow movies in banners or support
	 * them. There are a number of files that use them currently in the
	 * wild. If we wanted to support them, then perhaps we should use an
	 * all-black texture for the low quality texture. */
	RageTexture *pTexture = m_Banner[m_iIndexLatest].GetTexture();
	if( !pTexture || !pTexture->IsAMovie() )
		return;
	m_Banner[m_iIndexLatest].SetSecondsIntoAnimation( 0.f );
	for( int i = 1; i < NUM_BANNERS; ++i )
	{
		int index = m_iIndexLatest - i;
		wrap( index, NUM_BANNERS );
		if( m_Banner[index].GetTexturePath() == ID.filename )
			m_Banner[index].UnloadTexture();
	}
}
Esempio n. 6
0
void FadingBanner::LoadRandom()
{
	BeforeChange();
	m_Banner[GetBackIndex()].LoadRandom();
}
Esempio n. 7
0
void FadingBanner::LoadAllMusic()
{
	BeforeChange();
	m_Banner[GetBackIndex()].LoadAllMusic();
}
Esempio n. 8
0
void FadingBanner::LoadCustom( std::string sBanner )
{
	BeforeChange();
	m_Banner[m_iIndexLatest].Load( THEME->GetPathG( "Banner", sBanner ) );
	m_Banner[m_iIndexLatest].PlayCommand( sBanner );
}
Esempio n. 9
0
void FadingBanner::LoadCourseFallback()
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadCourseFallback();
}
Esempio n. 10
0
void FadingBanner::LoadRandom()
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadRandom();
	m_Banner[m_iIndexLatest].PlayCommand( "Random" );
}
Esempio n. 11
0
void FadingBanner::LoadRoulette()
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadRoulette();
	m_Banner[m_iIndexLatest].PlayCommand( "Roulette" );
}
Esempio n. 12
0
void FadingBanner::LoadBannerFromUnlockEntry( const UnlockEntry* pUE )
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadBannerFromUnlockEntry( pUE );
}
Esempio n. 13
0
void FadingBanner::LoadIconFromCharacter( Character* pCharacter )
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadIconFromCharacter( pCharacter );
}
Esempio n. 14
0
void FadingBanner::LoadMode()
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadMode();
}
Esempio n. 15
0
void FadingBanner::LoadFallback()
{
	BeforeChange();
	m_Banner[GetBackIndex()].LoadFallback();
}
Esempio n. 16
0
bool FadingBanner::Load( RageTextureID ID )
{
	BeforeChange();
	bool bRet = m_Banner[GetBackIndex()].Load(ID);
	return bRet;
}
Esempio n. 17
0
void FadingBanner::LoadFromSortOrder( SortOrder so )
{
	BeforeChange();
	m_Banner[m_iIndexLatest].LoadFromSortOrder(so);
}