From 62a475f9c73bf682b97669e7e3648c96707f87ac Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 17 Dec 2003 09:53:00 +0000 Subject: [PATCH] phase out SetTextMaxWidth --- stepmania/src/DifficultyList.cpp | 4 ++-- stepmania/src/ScreenRanking.cpp | 8 ++++---- stepmania/src/ScreenUnlock.cpp | 11 ++++++----- stepmania/src/TextBanner.cpp | 10 +++++++--- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index b6d578baeb..63f7168669 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -165,9 +165,9 @@ void DifficultyList::SetFromGameState() Difficulty dc = pSteps->GetDifficulty(); - m_Descriptions[m].SetZoomX(1); CString s = SONGMAN->GetDifficultyThemeName(dc); - m_Descriptions[m].SetTextMaxWidth( DESCRIPTION_MAX_WIDTH, s ); + m_Descriptions[m].SetMaxWidth( DESCRIPTION_MAX_WIDTH ); + m_Descriptions[m].SetText( s ); /* Don't mess with alpha; it might be fading on. */ m_Descriptions[m].SetDiffuseColor( SONGMAN->GetDifficultyColor(dc) ); diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index bff55960bf..a7bd34dda8 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -464,8 +464,8 @@ void ScreenRanking::SetPage( PageToShow pts ) m_sprCategory.Load( path ); m_sprCategory.SetDiffuseAlpha(1); } else { - m_textCategory.SetZoom(1); - m_textCategory.SetTextMaxWidth( CATEGORY_WIDTH, pts.pCourse->m_sName ); + m_textCategory.SetMaxWidth( CATEGORY_WIDTH ); + m_textCategory.SetText( pts.pCourse->m_sName ); m_textCategory.SetDiffuseAlpha(1); } @@ -523,8 +523,8 @@ void ScreenRanking::SetPage( PageToShow pts ) m_banner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT ); m_banner.SetDiffuseAlpha(1); - m_textCategory.SetZoom(1); - m_textCategory.SetTextMaxWidth( CATEGORY_WIDTH, pts.pSong->GetFullTranslitTitle() ); + m_textCategory.SetMaxWidth( CATEGORY_WIDTH ); + m_textCategory.SetText( pts.pSong->GetFullTranslitTitle() ); m_textCategory.SetDiffuseAlpha(1); m_sprType.SetDiffuse( RageColor(1,1,1,1) ); diff --git a/stepmania/src/ScreenUnlock.cpp b/stepmania/src/ScreenUnlock.cpp index 309a6467fe..0861b2fdfb 100644 --- a/stepmania/src/ScreenUnlock.cpp +++ b/stepmania/src/ScreenUnlock.cpp @@ -129,7 +129,6 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName ) if ( pSong == NULL ) // no such song continue; - /* Reset zoom before using SetTextMaxWidth. */ text->SetZoom(ScrollingTextZoom); if (pSong && pSong->m_pSong != NULL) @@ -138,14 +137,16 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName ) CString subtitle = pSong->m_pSong->GetDisplaySubTitle(); if( subtitle != "" ) title = title + "\n" + subtitle; - text->SetTextMaxWidth( MaxWidth, title ); + text->SetMaxWidth( MaxWidth ); + text->SetText( title ); } else // song is missing, might be a course { Course *crs = SONGMAN->FindCourse( DisplayedSong ); if (crs != NULL) { - text->SetTextMaxWidth( MaxWidth, crs->m_sName ); + text->SetMaxWidth( MaxWidth ); + text->SetText( crs->m_sName ); text->Command("Diffuse,0,1,0,1"); } else // entry isn't a song or course @@ -256,7 +257,6 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName ) DisplayedSong.MakeUpper(); UnlockEntry *pSong = UNLOCKSYS->FindLockEntry(DisplayedSong); - /* Reset zoom before using SetTextMaxWidth. */ NewText->SetZoom(UNLOCK_TEXT_SCROLL_ZOOM); CString title; @@ -272,7 +272,8 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName ) if( subtitle != "" ) title = title + "\n" + subtitle; - NewText->SetTextMaxWidth( MaxWidth, title ); + NewText->SetMaxWidth( MaxWidth ); + NewText->SetText( title ); RageColor color = SONGMAN->GetGroupColor(pSong->m_pSong->m_sGroupName); NewText->SetGlobalDiffuseColor(color); diff --git a/stepmania/src/TextBanner.cpp b/stepmania/src/TextBanner.cpp index d36aedfb68..ba9e7a1dc6 100644 --- a/stepmania/src/TextBanner.cpp +++ b/stepmania/src/TextBanner.cpp @@ -101,9 +101,13 @@ void TextBanner::LoadFromString( m_textSubTitle.SetZoom( fSubTitleZoom ); m_textArtist.SetZoom( fArtistZoom ); - m_textTitle.SetTextMaxWidth( MAX_TITLE_WIDTH, sDisplayTitle, sTranslitTitle ); - m_textSubTitle.SetTextMaxWidth( MAX_SUB_TITLE_WIDTH, sDisplaySubTitle, sTranslitSubTitle ); - m_textArtist.SetTextMaxWidth( MAX_ARTIST_WIDTH, sDisplayArtist, sTranslitArtist ); + m_textTitle.SetMaxWidth( MAX_TITLE_WIDTH ); + m_textSubTitle.SetMaxWidth( MAX_SUB_TITLE_WIDTH ); + m_textArtist.SetMaxWidth( MAX_ARTIST_WIDTH ); + + m_textTitle.SetText( sDisplayTitle, sTranslitTitle ); + m_textSubTitle.SetText( sDisplaySubTitle, sTranslitSubTitle ); + m_textArtist.SetText( sDisplayArtist, sTranslitArtist ); const float fTitleY = bTwoLines ? TWO_LINES_TITLE_Y : THREE_LINES_TITLE_Y; const float fSubTitleY = bTwoLines ? 0.0f : THREE_LINES_SUB_TITLE_Y;