MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / InitializeFont

Method InitializeFont

ogsr_engine/xrGame/HUDManager.cpp:95–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void CFontManager::InitializeFont(CGameFont*& F, LPCSTR section, u32 flags)
96{
97 LPCSTR font_tex_name = GetFontTexName(section);
98 R_ASSERT(font_tex_name);
99
100 const char* sh_name = READ_IF_EXISTS(pSettings, r_string, section, "shader", "font");
101 if (!F)
102 {
103 F = xr_new<CGameFont>(sh_name, font_tex_name, section, flags);
104 m_all_fonts.push_back(F);
105 }
106 else
107 F->Initialize(sh_name, font_tex_name, section);
108
109 F->m_font_name = section;
110
111 if (!(flags & CGameFont::fsDeviceIndependent))
112 {
113 if (pSettings->line_exist(section, "scale_x"))
114 {
115 F->SetWidthScale(pSettings->r_float(section, "scale_x"));
116 }
117 if (pSettings->line_exist(section, "scale_y"))
118 {
119 F->SetHeightScale(pSettings->r_float(section, "scale_y"));
120 }
121 }
122
123 if (pSettings->line_exist(section, "size"))
124 {
125 float sz = pSettings->r_float(section, "size");
126 if (flags & CGameFont::fsDeviceIndependent)
127 F->SetHeightI(sz);
128 else
129 F->SetHeight(sz);
130 }
131 if (pSettings->line_exist(section, "interval"))
132 F->SetInterval(pSettings->r_fvector2(section, "interval"));
133}
134
135CGameFont* CFontManager::InitializeCustomFont(LPCSTR section, u32 flags)
136{

Callers

nothing calls this directly

Calls 7

line_existMethod · 0.80
SetHeightIMethod · 0.80
push_backMethod · 0.45
InitializeMethod · 0.45
r_floatMethod · 0.45
SetHeightMethod · 0.45
r_fvector2Method · 0.45

Tested by

no test coverage detected