|
@@ -36,17 +36,14 @@
|
|
#include "platform/javascript/logo.gen.h"
|
|
#include "platform/javascript/logo.gen.h"
|
|
#include "platform/javascript/run_icon.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 {
|
|
class EditorHTTPServer : public Reference {
|
|
|
|
|
|
private:
|
|
private:
|
|
Ref<TCP_Server> server;
|
|
Ref<TCP_Server> server;
|
|
Ref<StreamPeerTCP> connection;
|
|
Ref<StreamPeerTCP> connection;
|
|
- uint64_t time;
|
|
|
|
|
|
+ uint64_t time = 0;
|
|
uint8_t req_buf[4096];
|
|
uint8_t req_buf[4096];
|
|
- int req_pos;
|
|
|
|
|
|
+ int req_pos = 0;
|
|
|
|
|
|
void _clear_client() {
|
|
void _clear_client() {
|
|
connection = Ref<StreamPeerTCP>();
|
|
connection = Ref<StreamPeerTCP>();
|
|
@@ -210,7 +207,12 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
|
|
Ref<ImageTexture> logo;
|
|
Ref<ImageTexture> logo;
|
|
Ref<ImageTexture> run_icon;
|
|
Ref<ImageTexture> run_icon;
|
|
Ref<ImageTexture> stop_icon;
|
|
Ref<ImageTexture> stop_icon;
|
|
- int menu_options;
|
|
|
|
|
|
+ int menu_options = 0;
|
|
|
|
+
|
|
|
|
+ Ref<EditorHTTPServer> server;
|
|
|
|
+ bool server_quit = false;
|
|
|
|
+ Mutex *server_lock = NULL;
|
|
|
|
+ Thread *server_thread = NULL;
|
|
|
|
|
|
enum ExportMode {
|
|
enum ExportMode {
|
|
EXPORT_MODE_NORMAL = 0,
|
|
EXPORT_MODE_NORMAL = 0,
|
|
@@ -240,12 +242,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, const Vector<SharedObject> p_shared_objects);
|
|
void _fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug, 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);
|
|
static void _server_thread_poll(void *data);
|
|
|
|
|
|
public:
|
|
public:
|
|
@@ -699,7 +695,6 @@ void EditorExportPlatformJavaScript::_server_thread_poll(void *data) {
|
|
EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
|
|
EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
|
|
|
|
|
|
server.instance();
|
|
server.instance();
|
|
- server_quit = false;
|
|
|
|
server_lock = Mutex::create();
|
|
server_lock = Mutex::create();
|
|
server_thread = Thread::create(_server_thread_poll, this);
|
|
server_thread = Thread::create(_server_thread_poll, this);
|
|
|
|
|
|
@@ -716,8 +711,6 @@ EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
|
|
stop_icon = theme->get_icon("Stop", "EditorIcons");
|
|
stop_icon = theme->get_icon("Stop", "EditorIcons");
|
|
else
|
|
else
|
|
stop_icon.instance();
|
|
stop_icon.instance();
|
|
-
|
|
|
|
- menu_options = 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() {
|
|
EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() {
|