From 03e3ba7609cf80472541cbdf01026d672711241d Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 25 Feb 2005 16:52:33 +0000 Subject: [PATCH] move Font load for item length testing inside of OptionsRow --- stepmania/src/OptionRow.cpp | 8 +++++++- stepmania/src/OptionRow.h | 2 -- stepmania/src/ScreenOptions.cpp | 8 -------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 3d7609fc3d..58cb11465b 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -5,6 +5,8 @@ #include "Font.h" #include "Foreach.h" #include "OptionRowHandler.h" +#include "FontManager.h" +#include "Font.h" static const CString SelectTypeNames[NUM_SELECT_TYPES] = { "SelectOne", @@ -132,7 +134,6 @@ void OptionRow::LoadNormal( const OptionRowDefinition &def, OptionRowHandler *pH } void OptionRow::AfterImportOptions( - Font* pFont, const CString &sTitle, float fY ) @@ -199,6 +200,8 @@ void OptionRow::AfterImportOptions( // If the items will go off the edge of the screen, then re-init with the "long row" style. { + Font* pFont = FONT->LoadFont( THEME->GetPathF(m_sType,"item") ); + float fX = ITEMS_START_X; for( unsigned c=0; cUnloadFont( pFont ); + pFont = NULL; } // diff --git a/stepmania/src/OptionRow.h b/stepmania/src/OptionRow.h index 95845f342e..073613e801 100644 --- a/stepmania/src/OptionRow.h +++ b/stepmania/src/OptionRow.h @@ -9,7 +9,6 @@ #include "OptionIcon.h" #include "ThemeMetric.h" -class Font; class OptionRowHandler; enum SelectType @@ -93,7 +92,6 @@ public: int ExportOptions(); void AfterImportOptions( - Font* pFont, const CString &sTitle, float fY ); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 0a9f754d28..04485d9704 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -15,8 +15,6 @@ #include "Style.h" #include "ScreenDimensions.h" #include "Command.h" -#include "FontManager.h" -#include "Font.h" /* @@ -144,8 +142,6 @@ void ScreenOptions::InitMenu( InputMode im, const vector &v m_bShowUnderlines = bShowUnderlines; - Font* pFont = FONT->LoadFont( THEME->GetPathF(m_sName,"item") ); - for( unsigned r=0; r &v const float fY = ROW_Y.GetValue( pos ); row.AfterImportOptions( - pFont, GetExplanationTitle( r ), fY ); } - FONT->UnloadFont( pFont ); - pFont = NULL; - m_sprPage.Load( THEME->GetPathG(m_sName,"page") ); m_sprPage->SetName( "Page" ); SET_XY_AND_ON_COMMAND( m_sprPage );