MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / init

Function init

TheForceEngine/TFE_FrontEndUI/console.cpp:61–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 void createCVar(const char* name, const char* helpString, u32 flags, CVarType type, CValue value, u32 maxLen = 0);
60
61 bool init()
62 {
63 char fontpath[TFE_MAX_PATH];
64 s32 scale = TFE_Ui::getUiScale();
65 s_fontSize = (scale * 20) / 100;
66
67 sprintf(fontpath, "Fonts/DroidSansMono.ttf");
68 TFE_Paths::mapSystemPath(fontpath);
69
70 ImGuiIO& io = ImGui::GetIO();
71 s_consoleFont = io.Fonts->AddFontFromFileTTF(fontpath, (f32)s_fontSize);
72 s_height = 0.0f;
73 s_anim = 0.0f;
74 s_historyIndex = -1;
75 s_historyScroll = 0;
76 s_commandHistory.clear();
77
78 registerDefaultCommands();
79 return true;
80 }
81
82 void destroy()
83 {

Callers

nothing calls this directly

Calls 5

getUiScaleFunction · 0.85
registerDefaultCommandsFunction · 0.85
AddFontFromFileTTFMethod · 0.80
mapSystemPathFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected