mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-03 02:53:57 +00:00
Read "multiplayer:room" from INI options (default "default") and use it in Connect() instead of a hardcoded string. Return early if room is blank, matching the relay URL check. Rename p_mgr to p_networkManager for consistency.
34 lines
1.2 KiB
C++
34 lines
1.2 KiB
C++
#include "config.h"
|
|
|
|
#include "filesystem.h"
|
|
#include "window.h"
|
|
|
|
#include <SDL3/SDL_log.h>
|
|
#include <emscripten.h>
|
|
#include <iniparser.h>
|
|
|
|
void Emscripten_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
|
{
|
|
SDL_Log("Overriding default config for Emscripten");
|
|
|
|
iniparser_set(p_dictionary, "isle:diskpath", Emscripten_bundledPath);
|
|
iniparser_set(p_dictionary, "isle:cdpath", Emscripten_streamPath);
|
|
iniparser_set(p_dictionary, "isle:savepath", Emscripten_savePath);
|
|
iniparser_set(p_dictionary, "isle:Full Screen", "false");
|
|
iniparser_set(p_dictionary, "isle:Flip Surfaces", "true");
|
|
|
|
iniparser_set(p_dictionary, "extensions", NULL);
|
|
iniparser_set(p_dictionary, "extensions:multiplayer", "true");
|
|
iniparser_set(p_dictionary, "multiplayer", NULL);
|
|
iniparser_set(p_dictionary, "multiplayer:relay url", "ws://localhost:8787");
|
|
iniparser_set(p_dictionary, "multiplayer:room", "default");
|
|
|
|
// Emscripten-only for now
|
|
Emscripten_SetScaleAspect(iniparser_getboolean(p_dictionary, "isle:Original Aspect Ratio", true));
|
|
Emscripten_SetOriginalResolution(iniparser_getboolean(p_dictionary, "isle:Original Resolution", true));
|
|
|
|
// clang-format off
|
|
MAIN_THREAD_EM_ASM({JSEvents.fullscreenEnabled = function() { return false; }});
|
|
// clang-format on
|
|
}
|