From 1869bdf1e83acdd7a0ce5393caa1414becc01c53 Mon Sep 17 00:00:00 2001 From: Hugh Sanderson Date: Wed, 28 Aug 2024 18:13:41 +0800 Subject: [PATCH] Update JSPRIME defines --- project/ToolkitBuild.xml | 2 +- project/src/common/Font.cpp | 4 ++-- tools/nme/src/platforms/EmscriptenPlatform.hx | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/project/ToolkitBuild.xml b/project/ToolkitBuild.xml index 631546854..b87e641a9 100644 --- a/project/ToolkitBuild.xml +++ b/project/ToolkitBuild.xml @@ -640,7 +640,7 @@ -
+
diff --git a/project/src/common/Font.cpp b/project/src/common/Font.cpp index 8ac087f07..ecca8beee 100644 --- a/project/src/common/Font.cpp +++ b/project/src/common/Font.cpp @@ -382,8 +382,8 @@ FontMap sgFontMap; #ifdef LINKED_FONT_DATA FontBuffer decompressFontData(int srcLen, int destLen, const unsigned char *inData) { - #ifdef JS_PRIME - FontBuffer data = new FontBuffer(); + #ifdef HXCPP_JS_PRIME + FontBuffer data = new BufferData(); data->IncRef(); data->setDataSize(destLen,false); Bytef *dataPtr = (Bytef*)data->getData(); diff --git a/tools/nme/src/platforms/EmscriptenPlatform.hx b/tools/nme/src/platforms/EmscriptenPlatform.hx index 9a261af36..aed5abdeb 100644 --- a/tools/nme/src/platforms/EmscriptenPlatform.hx +++ b/tools/nme/src/platforms/EmscriptenPlatform.hx @@ -33,13 +33,9 @@ class EmscriptenPlatform extends DesktopPlatform executablePath = applicationDirectory + "/" + executableFile; outputFiles.push(executableFile); - var wasmFile = "ApplicationMain.js"; - executablePath = applicationDirectory + "/" + executableFile; - outputFiles.push(executableFile); - project.haxeflags.push('-D exe_link'); project.haxeflags.push('-D HXCPP_LINK_EMSCRIPTEN_EXT=$ext'); - project.haxeflags.push('-D HXCPP_LINK_EMRUN'); + project.haxeflags.push('-D HXCPP_LINK_MEMORY_GROWTH=1'); memFile = project.getBool("emscriptenMemFile", false); if (memFile) @@ -98,15 +94,19 @@ class EmscriptenPlatform extends DesktopPlatform Sys.println(" -browser ID, for specific one"); } + override public function run(arguments:Array):Void { - if (true) + if (false) { runPython(arguments); } else { - var server = new nme.net.http.Server( new nme.net.http.FileServer([FileSystem.fullPath(applicationDirectory) ]).onRequest ); + var server = new nme.net.http.Server( + new nme.net.http.FileServer([FileSystem.fullPath(applicationDirectory) ], + new nme.net.http.StdioHandler(), + ).onRequest ); var port = 2323; server.listen(port);