diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-12-10 13:57:27 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-12-10 13:57:46 +0100 |
commit | 8020515717042453f253f2bed9a7a3d59a980ee7 (patch) | |
tree | a62fb0e59fa0a16c4b8b59b5bbd2786dce165782 /platform/javascript/export/export.cpp | |
parent | 9aec0ad3b3ed3cf80c0774b96c3c8005d1a441bf (diff) |
HTML5: Code style cleanup for export code
Diffstat (limited to 'platform/javascript/export/export.cpp')
-rw-r--r-- | platform/javascript/export/export.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index f77bf6ab97..37681b2484 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -37,16 +37,13 @@ #include "platform/javascript/logo.gen.h" #include "platform/javascript/run_icon.gen.h" -#define EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE "webassembly_release.zip" -#define EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG "webassembly_debug.zip" - class EditorHTTPServer : public Reference { private: Ref<TCP_Server> server; Ref<StreamPeerTCP> connection; - uint64_t time; + uint64_t time = 0; uint8_t req_buf[4096]; - int req_pos; + int req_pos = 0; void _clear_client() { connection = Ref<StreamPeerTCP>(); @@ -211,7 +208,12 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform { Ref<ImageTexture> logo; Ref<ImageTexture> run_icon; Ref<ImageTexture> stop_icon; - int menu_options; + int menu_options = 0; + + Ref<EditorHTTPServer> server; + bool server_quit = false; + Mutex server_lock; + Thread *server_thread = nullptr; enum ExportMode { EXPORT_MODE_NORMAL = 0, @@ -241,12 +243,6 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform { void _fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug, int p_flags, const Vector<SharedObject> p_shared_objects); -private: - Ref<EditorHTTPServer> server; - bool server_quit; - Mutex server_lock; - Thread *server_thread; - static void _server_thread_poll(void *data); public: @@ -685,7 +681,6 @@ void EditorExportPlatformJavaScript::_server_thread_poll(void *data) { EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() { server.instance(); - server_quit = false; server_thread = Thread::create(_server_thread_poll, this); Ref<Image> img = memnew(Image(_javascript_logo)); @@ -702,8 +697,6 @@ EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() { } else { stop_icon.instance(); } - - menu_options = 0; } EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() { |