* Add option saving to main.cpp when exiting..

This commit is contained in:
iProgramInCpp
2023-08-25 20:35:26 +03:00
parent 4d5f087ae5
commit 0c38c01c28
2 changed files with 3 additions and 4 deletions

View File

@@ -287,12 +287,12 @@ Texture AppPlatform_sdl::loadTexture(const std::string& path, bool b)
return out;
}
#ifndef __EMSCRIPTEN__
std::vector<std::string> AppPlatform_sdl::getOptionStrings()
{
std::vector<std::string> o;
LogMsg("Storage dir is %s", _storageDir.c_str());
std::ifstream ifs(_storageDir + "/options.txt");
if (!ifs.is_open())
{
@@ -339,5 +339,3 @@ void AppPlatform_sdl::setOptionStrings(const std::vector<std::string>& str)
for (int i = 0; i < int(str.size()); i += 2)
os << str[i] << ':' << str[i + 1] << '\n';
}
#endif

View File

@@ -214,6 +214,7 @@ static EM_BOOL main_loop(double time, void *user_data)
if (g_pApp->wantToQuit())
{
g_pApp->saveOptions();
delete g_pApp;
delete g_pAppPlatform;
teardown();