Added Application::initMemoryFS() function to allow apps to init the memory FS before further initialization.

This commit is contained in:
Patrick 2025-03-28 11:53:25 +01:00
parent 63fcb6181f
commit 71a268b5ad
2 changed files with 7 additions and 1 deletions

View File

@ -247,6 +247,11 @@ std::vector<FontConfig> Application::getDefaultFonts()
}};
}
void Application::initMemoryFS()
{
mMemoryFS->addFile(DEFAULT_FONT_PATH, NOTO_SANS_DATA);
}
void Application::handleMessage(const Message& message)
{
switch (message.severity)
@ -297,7 +302,7 @@ bool Application::init()
};
mMemoryFS = mFS.emplaceAdapter<mijin::MemoryFileSystemAdapter>();
mMemoryFS->addFile(DEFAULT_FONT_PATH, NOTO_SANS_DATA);
initMemoryFS();
addConfigDir(mijin::getKnownFolder(mijin::KnownFolder::USER_CONFIG_ROOT) / getFolderName());
addDataDir(mijin::getKnownFolder(mijin::KnownFolder::USER_DATA_ROOT) / getFolderName());

View File

@ -131,6 +131,7 @@ protected:
virtual std::string getWindowTitle() = 0;
virtual void configureImgui();
virtual std::vector<FontConfig> getDefaultFonts();
virtual void initMemoryFS();
virtual void handleMessage(const Message& message);
virtual void handleSDLEvent(const SDL_Event& event);