本文整理汇总了C++中CSchemeManager::GetProportionalScaledValueEx方法的典型用法代码示例。如果您正苦于以下问题:C++ CSchemeManager::GetProportionalScaledValueEx方法的具体用法?C++ CSchemeManager::GetProportionalScaledValueEx怎么用?C++ CSchemeManager::GetProportionalScaledValueEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSchemeManager
的用法示例。
在下文中一共展示了CSchemeManager::GetProportionalScaledValueEx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReloadFontGlyphs
//-----------------------------------------------------------------------------
// Purpose: Reloads all scheme fonts
//-----------------------------------------------------------------------------
void CScheme::ReloadFontGlyphs()
{
// get our current resolution
if ( m_SizingPanel != 0 )
{
g_pIPanel->GetSize( m_SizingPanel, m_nScreenWide, m_nScreenTall );
}
else
{
g_pSurface->GetScreenSize( m_nScreenWide, m_nScreenTall );
}
// check our language; some have minimum sizes
int minimumFontHeight = GetMinimumFontHeightForCurrentLanguage();
// add the data to all the fonts
KeyValues *fonts = m_pData->FindKey("Fonts", true);
for (int i = 0; i < m_FontAliases.Count(); i++)
{
KeyValues *kv = fonts->FindKey(m_FontAliases[i]._trueFontName.String(), true);
// walk through creating adding the first matching glyph set to the font
for (KeyValues *fontdata = kv->GetFirstSubKey(); fontdata != NULL; fontdata = fontdata->GetNextKey())
{
// skip over fonts not meant for this resolution
int fontYResMin = 0, fontYResMax = 0;
sscanf(fontdata->GetString("yres", ""), "%d %d", &fontYResMin, &fontYResMax);
if (fontYResMin)
{
if (!fontYResMax)
{
fontYResMax = fontYResMin;
}
// check the range
if (m_nScreenTall < fontYResMin || m_nScreenTall > fontYResMax)
continue;
}
int flags = 0;
if (fontdata->GetInt( "italic" ))
{
flags |= ISurface::FONTFLAG_ITALIC;
}
if (fontdata->GetInt( "underline" ))
{
flags |= ISurface::FONTFLAG_UNDERLINE;
}
if (fontdata->GetInt( "strikeout" ))
{
flags |= ISurface::FONTFLAG_STRIKEOUT;
}
if (fontdata->GetInt( "symbol" ))
{
flags |= ISurface::FONTFLAG_SYMBOL;
}
if (fontdata->GetInt( "antialias" ) && g_pSurface->SupportsFeature(ISurface::ANTIALIASED_FONTS))
{
flags |= ISurface::FONTFLAG_ANTIALIAS;
}
if (fontdata->GetInt( "dropshadow" ) && g_pSurface->SupportsFeature(ISurface::DROPSHADOW_FONTS))
{
flags |= ISurface::FONTFLAG_DROPSHADOW;
}
if (fontdata->GetInt( "outline" ) && g_pSurface->SupportsFeature(ISurface::OUTLINE_FONTS))
{
flags |= ISurface::FONTFLAG_OUTLINE;
}
if (fontdata->GetInt( "custom" ))
{
flags |= ISurface::FONTFLAG_CUSTOM;
}
if (fontdata->GetInt( "bitmap" ))
{
flags |= ISurface::FONTFLAG_BITMAP;
}
if (fontdata->GetInt( "rotary" ))
{
flags |= ISurface::FONTFLAG_ROTARY;
}
if (fontdata->GetInt( "additive" ))
{
flags |= ISurface::FONTFLAG_ADDITIVE;
}
int tall = fontdata->GetInt("tall");
int blur = fontdata->GetInt("blur");
int scanlines = fontdata->GetInt("scanlines");
if ( (!fontYResMin && !fontYResMax) && m_FontAliases[i].m_bProportional ) // only grow this font if it doesn't have a resolution filter specified
{
tall = g_Scheme.GetProportionalScaledValueEx( this, tall );
blur = g_Scheme.GetProportionalScaledValueEx( this, blur );
scanlines = g_Scheme.GetProportionalScaledValueEx( this, scanlines );
}
// clip the font size so that fonts can't be too big
if (tall > 127)
//.........这里部分代码省略.........