| 93 | } |
| 94 | |
| 95 | void 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 | |
| 135 | CGameFont* CFontManager::InitializeCustomFont(LPCSTR section, u32 flags) |
| 136 | { |
nothing calls this directly
no test coverage detected