auto merge WASM config on emscripten builds

This commit is contained in:
ohsqueezy 2023-05-30 18:22:20 -04:00
parent 9f33ac872f
commit e5aef6ffb8
3 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,6 @@ const nlohmann::json& Configuration::operator()() const
void Configuration::merge(const nlohmann::json& incoming)
{
sb::Log::log("Merging into configuration", sb::Log::DEBUG);
if (!incoming.empty())
{
/* loop over first level key/value pairs */

View File

@ -21,6 +21,8 @@ Game::Game()
_configuration.merge(USER_CONFIG_PATH);
#ifdef __ANDROID__
_configuration.merge(ANDROID_CONFIG_PATH);
#elif defined(__EMSCRIPTEN__)
_configuration.merge(WASM_CONFIG_PATH);
#endif
if (configuration()["configuration"]["auto-refresh"])
{

View File

@ -75,6 +75,7 @@ private:
inline static const std::string USER_CONFIG_PATH = "config.json";
inline static const std::string ANDROID_CONFIG_PATH = "config_android.json";
inline static const std::string WASM_CONFIG_PATH = "config_wasm.json";
/*!
* Overrides SDL's default log function to log a message to stdout/stderr and, if log is enabled in the