/* 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; }
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(); }
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(); }
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(); }
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(); } }
void FadingBanner::LoadRandom() { BeforeChange(); m_Banner[GetBackIndex()].LoadRandom(); }
void FadingBanner::LoadAllMusic() { BeforeChange(); m_Banner[GetBackIndex()].LoadAllMusic(); }
void FadingBanner::LoadCustom( std::string sBanner ) { BeforeChange(); m_Banner[m_iIndexLatest].Load( THEME->GetPathG( "Banner", sBanner ) ); m_Banner[m_iIndexLatest].PlayCommand( sBanner ); }
void FadingBanner::LoadCourseFallback() { BeforeChange(); m_Banner[m_iIndexLatest].LoadCourseFallback(); }
void FadingBanner::LoadRandom() { BeforeChange(); m_Banner[m_iIndexLatest].LoadRandom(); m_Banner[m_iIndexLatest].PlayCommand( "Random" ); }
void FadingBanner::LoadRoulette() { BeforeChange(); m_Banner[m_iIndexLatest].LoadRoulette(); m_Banner[m_iIndexLatest].PlayCommand( "Roulette" ); }
void FadingBanner::LoadBannerFromUnlockEntry( const UnlockEntry* pUE ) { BeforeChange(); m_Banner[m_iIndexLatest].LoadBannerFromUnlockEntry( pUE ); }
void FadingBanner::LoadIconFromCharacter( Character* pCharacter ) { BeforeChange(); m_Banner[m_iIndexLatest].LoadIconFromCharacter( pCharacter ); }
void FadingBanner::LoadMode() { BeforeChange(); m_Banner[m_iIndexLatest].LoadMode(); }
void FadingBanner::LoadFallback() { BeforeChange(); m_Banner[GetBackIndex()].LoadFallback(); }
bool FadingBanner::Load( RageTextureID ID ) { BeforeChange(); bool bRet = m_Banner[GetBackIndex()].Load(ID); return bRet; }
void FadingBanner::LoadFromSortOrder( SortOrder so ) { BeforeChange(); m_Banner[m_iIndexLatest].LoadFromSortOrder(so); }