longchar -> wchar_t

This commit is contained in:
Steve Checkoway
2006-09-14 09:32:04 +00:00
parent 5083893317
commit b5f57abc4e
2 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -243,7 +243,7 @@ void Font::AddPage( FontPage *m_pPage )
{ {
m_apPages.push_back( m_pPage ); m_apPages.push_back( m_pPage );
for( map<longchar,int>::const_iterator it = m_pPage->m_iCharToGlyphNo.begin(); for( map<wchar_t,int>::const_iterator it = m_pPage->m_iCharToGlyphNo.begin();
it != m_pPage->m_iCharToGlyphNo.end(); ++it ) it != m_pPage->m_iCharToGlyphNo.end(); ++it )
{ {
m_iCharToGlyph[it->first] = &m_pPage->m_aGlyphs[it->second]; m_iCharToGlyph[it->first] = &m_pPage->m_aGlyphs[it->second];
@@ -259,7 +259,7 @@ void Font::MergeFont(Font &f)
if( m_pDefault == NULL ) if( m_pDefault == NULL )
m_pDefault = f.m_pDefault; m_pDefault = f.m_pDefault;
for(map<longchar,glyph*>::iterator it = f.m_iCharToGlyph.begin(); for(map<wchar_t,glyph*>::iterator it = f.m_iCharToGlyph.begin();
it != f.m_iCharToGlyph.end(); ++it) it != f.m_iCharToGlyph.end(); ++it)
{ {
m_iCharToGlyph[it->first] = it->second; m_iCharToGlyph[it->first] = it->second;
@@ -279,7 +279,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const
return *m_iCharToGlyphCache[c]; return *m_iCharToGlyphCache[c];
/* Try the regular character. */ /* Try the regular character. */
map<longchar,glyph*>::const_iterator it = m_iCharToGlyph.find(c); map<wchar_t,glyph*>::const_iterator it = m_iCharToGlyph.find(c);
/* If that's missing, use the default glyph. */ /* If that's missing, use the default glyph. */
if(it == m_iCharToGlyph.end()) if(it == m_iCharToGlyph.end())
@@ -293,7 +293,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const
bool Font::FontCompleteForString( const wstring &str ) const bool Font::FontCompleteForString( const wstring &str ) const
{ {
map<longchar,glyph*>::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); map<wchar_t,glyph*>::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH );
if( m_pDefault == m_iCharToGlyph.end() ) if( m_pDefault == m_iCharToGlyph.end() )
RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() ); RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
@@ -313,7 +313,7 @@ void Font::CapsOnly()
* a lowercase one. */ * a lowercase one. */
for( char c = 'A'; c <= 'Z'; ++c ) for( char c = 'A'; c <= 'Z'; ++c )
{ {
map<longchar,glyph*>::const_iterator it = m_iCharToGlyph.find(c); map<wchar_t,glyph*>::const_iterator it = m_iCharToGlyph.find(c);
if(it == m_iCharToGlyph.end()) if(it == m_iCharToGlyph.end())
continue; continue;
@@ -732,7 +732,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
/* Expect at least as many frames as we have premapped characters. */ /* Expect at least as many frames as we have premapped characters. */
/* Make sure that we don't map characters to frames we don't actually /* Make sure that we don't map characters to frames we don't actually
* have. This can happen if the font is too small for an sChars. */ * have. This can happen if the font is too small for an sChars. */
for( map<longchar,int>::const_iterator it = pPage->m_iCharToGlyphNo.begin(); for( map<wchar_t,int>::const_iterator it = pPage->m_iCharToGlyphNo.begin();
it != pPage->m_iCharToGlyphNo.end(); ++it ) it != pPage->m_iCharToGlyphNo.end(); ++it )
{ {
if( it->second < pPage->m_pTexture->GetNumFrames() ) if( it->second < pPage->m_pTexture->GetNumFrames() )
@@ -765,7 +765,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
{ {
/* Cache ASCII glyphs. */ /* Cache ASCII glyphs. */
ZERO( m_iCharToGlyphCache ); ZERO( m_iCharToGlyphCache );
map<longchar,glyph*>::iterator it; map<wchar_t,glyph*>::iterator it;
for( it = m_iCharToGlyph.begin(); it != m_iCharToGlyph.end(); ++it ) for( it = m_iCharToGlyph.begin(); it != m_iCharToGlyph.end(); ++it )
if( it->first < (int) ARRAYLEN(m_iCharToGlyphCache) ) if( it->first < (int) ARRAYLEN(m_iCharToGlyphCache) )
m_iCharToGlyphCache[it->first] = it->second; m_iCharToGlyphCache[it->first] = it->second;
+3 -3
View File
@@ -46,7 +46,7 @@ struct FontPageSettings
float m_fScaleAllWidthsBy; float m_fScaleAllWidthsBy;
RString m_sTextureHints; RString m_sTextureHints;
map<longchar,int> CharToGlyphNo; map<wchar_t,int> CharToGlyphNo;
/* If a value is missing, the width of the texture frame is used. */ /* If a value is missing, the width of the texture frame is used. */
map<int,int> m_mapGlyphWidths; map<int,int> m_mapGlyphWidths;
@@ -92,7 +92,7 @@ public:
/* All glyphs in this list will point to m_pTexture. */ /* All glyphs in this list will point to m_pTexture. */
vector<glyph> m_aGlyphs; vector<glyph> m_aGlyphs;
map<longchar,int> m_iCharToGlyphNo; map<wchar_t,int> m_iCharToGlyphNo;
private: private:
void SetExtraPixels( int iDrawExtraPixelsLeft, int DrawExtraPixelsRight ); void SetExtraPixels( int iDrawExtraPixelsLeft, int DrawExtraPixelsRight );
@@ -145,7 +145,7 @@ private:
FontPage *m_pDefault; FontPage *m_pDefault;
/* Map from characters to glyphs. (Each glyph* is part of one of pages[].) */ /* Map from characters to glyphs. (Each glyph* is part of one of pages[].) */
map<longchar,glyph*> m_iCharToGlyph; map<wchar_t,glyph*> m_iCharToGlyph;
glyph *m_iCharToGlyphCache[128]; glyph *m_iCharToGlyphCache[128];
// True for Hebrew, Arabic, Urdu fonts. // True for Hebrew, Arabic, Urdu fonts.