From c1c3e599974885d53789f78c67aa962bf4a26449 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 6 Nov 2003 21:47:12 +0000 Subject: [PATCH] Add assert, const, comments. --- stepmania/src/BitmapText.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index bef76df7d6..ccdc0bf2af 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -264,6 +264,8 @@ void BitmapText::SetText( CString sText, CString sAlternateText, int iWrapWidthP // (if only one word fits on the line, it may be larger than iWrapWidthPixels ). // // TODO: Investigate whether this works in all languages + /* It doesn't. I can add Japanese wrapping, at least. We could handle hyphens + * and soft hyphens and pretty easily, too. -glenn */ // TODO: Move this wrapping logic into Font CStringArray asWords; split( sText, " ", asWords ); @@ -271,9 +273,11 @@ void BitmapText::SetText( CString sText, CString sAlternateText, int iWrapWidthP CString sCurLine; int iCurLineWidth = 0; - for( int i=0; iGetLineWidthInSourcePixels( CStringToWstring(sWord) ); if( sCurLine.empty() ) @@ -453,6 +457,7 @@ void BitmapText::HandleCommand( const CStringArray &asTokens ) void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels ) { + ASSERT( m_pFont ); // always load a font first if( m_iWrapWidthPixels == iWrapWidthPixels ) return; SetText( m_sText, "", iWrapWidthPixels );