Emscripten fixes

This commit is contained in:
Yousef Khadadeh 2026-05-14 14:39:34 +03:00
parent ad1844adc7
commit c083ccc1a9
9 changed files with 60 additions and 18 deletions

View file

@ -14,10 +14,16 @@ void NetThreadManager::init(MainProgram* m) {
return;
started = true;
main = m;
#ifndef __ANDROID__
init_thread();
#else
#ifdef __ANDROID__
AndroidJNICalls::startNetworkService();
#else
NetLibrary::init_websocket();
#endif
}
void NetThreadManager::synchronous_update() {
#ifndef __ANDROID__
NetLibrary::update();
#endif
}
@ -71,9 +77,9 @@ void NetThreadManager::destroy() {
if(!started)
return;
started = false;
#ifndef __ANDROID__
destroy_thread();
#else
#ifdef __ANDROID__
AndroidJNICalls::stopNetworkService();
#else
NetLibrary::destroy_websocket();
#endif
}