mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-04 14:09:47 +03:00
* Add option saving to main.cpp when exiting..
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user