MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / main

Function main

Goldleaf/source/main.cpp:28–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26bool g_UpdatedNeedsRename = false;
27
28int main() {
29 // Initialize services
30 GLEAF_RC_ASSERT(Initialize());
31
32 GLEAF_LOG_FMT("Hello World from Goldleaf v%s!", GLEAF_VERSION);
33
34 // Create the UI renderer and the application - it will initialize romfs
35 auto renderer_opts = pu::ui::render::RendererInitOptions(SDL_INIT_EVERYTHING, pu::ui::render::RendererHardwareFlags);
36 renderer_opts.SetPlServiceType(PlServiceType_User);
37 renderer_opts.AddExtraDefaultFontSize(35);
38 renderer_opts.AddDefaultAllSharedFonts();
39 renderer_opts.UseImage(pu::ui::render::ImgAllFlags);
40 renderer_opts.AddInputNpadIdType(HidNpadIdType_Handheld); // Make it controllable only by player 1
41 renderer_opts.AddInputNpadIdType(HidNpadIdType_No1);
42 renderer_opts.AddInputNpadStyleTag(HidNpadStyleSet_NpadStandard);
43 auto renderer = pu::ui::render::Renderer::New(renderer_opts);
44 g_MainApplication = ui::MainApplication::New(renderer);
45
46 // Initialize and load settings
47 g_Settings = {};
48 g_Settings.Load();
49
50 // Load language strings, now that romfs is initialized
51 cfg::LoadStrings();
52
53 // Try to get the selected user if it was selected, and cache its icon if we succeed
54 if(acc::SelectFromPreselectedUser()) {
55 acc::ExportSelectedUserIcon();
56 }
57
58 // Load the application
59 GLEAF_RC_ASSERT(g_MainApplication->Load());
60
61 // Start and loop the application
62 g_MainApplication->ShowWithFadeIn();
63
64 Exit();
65}

Callers

nothing calls this directly

Calls 6

LoadStringsFunction · 0.85
ExportSelectedUserIconFunction · 0.85
InitializeFunction · 0.70
ExitFunction · 0.70
LoadMethod · 0.45

Tested by

no test coverage detected