diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b76c6bd94..2ffeef548 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet @@ -101,7 +101,7 @@ jobs: rm /usr/local/bin/python3* brew bundle popd - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet @@ -153,7 +153,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet @@ -217,8 +217,9 @@ jobs: with: ndk-version: r21e - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: + distribution: "zulu" java-version: 11 - uses: krdlab/setup-haxe@v1 @@ -231,7 +232,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet @@ -289,7 +290,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet @@ -339,7 +340,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet @@ -462,8 +463,9 @@ jobs: with: ndk-version: r15c - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: + distribution: "zulu" java-version: 11 - uses: krdlab/setup-haxe@v1 @@ -476,7 +478,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet @@ -585,7 +587,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet @@ -637,6 +639,7 @@ jobs: - name: Install Haxe dependencies run: | + haxelib install genes --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet - uses: actions/download-artifact@v3 @@ -661,6 +664,12 @@ jobs: lime build SimpleImage html5 -release -verbose -nocolor lime build SimpleAudio html5 -release -verbose -nocolor + - name: Build Lime samples with Genes + run: | + lime build HelloWorld html5 -clean -release -verbose -nocolor --haxelib=genes + lime build SimpleImage html5 -clean -release -verbose -nocolor --haxelib=genes + lime build SimpleAudio html5 -clean -release -verbose -nocolor --haxelib=genes + ios-samples: needs: package-haxelib runs-on: macos-11 @@ -676,7 +685,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet @@ -727,7 +736,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet @@ -773,7 +782,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet @@ -834,7 +843,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet @@ -886,7 +895,7 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install hxcpp --quiet + haxelib install hxcpp 4.2.1 --quiet haxelib install format --quiet haxelib install hxp --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet diff --git a/project/include/text/Font.h b/project/include/text/Font.h index 6523207db..bcf3d4a8e 100644 --- a/project/include/text/Font.h +++ b/project/include/text/Font.h @@ -49,8 +49,8 @@ namespace lime { int GetAscender (); int GetDescender (); wchar_t *GetFamilyName (); - int GetGlyphIndex (char* character); - void* GetGlyphIndices (bool useCFFIValue, char* characters); + int GetGlyphIndex (const char* character); + void* GetGlyphIndices (bool useCFFIValue, const char* characters); void* GetGlyphMetrics (bool useCFFIValue, int index); int GetHeight (); int GetNumGlyphs (); diff --git a/project/include/ui/Window.h b/project/include/ui/Window.h index dc4146142..2db40ab27 100644 --- a/project/include/ui/Window.h +++ b/project/include/ui/Window.h @@ -48,6 +48,8 @@ namespace lime { virtual void Move (int x, int y) = 0; virtual void ReadPixels (ImageBuffer *buffer, Rectangle *rect) = 0; virtual void Resize (int width, int height) = 0; + virtual void SetMinimumSize (int width, int height) = 0; + virtual void SetMaximumSize (int width, int height) = 0; virtual bool SetBorderless (bool borderless) = 0; virtual void SetCursor (Cursor cursor) = 0; virtual void SetDisplayMode (DisplayMode* displayMode) = 0; diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp index 298a55316..b3453d621 100644 --- a/project/src/ExternalInterface.cpp +++ b/project/src/ExternalInterface.cpp @@ -54,6 +54,7 @@ #endif #include +#include DEFINE_KIND (k_finalizer); @@ -175,6 +176,54 @@ namespace lime { } + value wstring_to_value (std::wstring* val) { + + if (val) { + + #ifdef HX_WINDOWS + return alloc_wstring (val->c_str ()); + #else + std::string _val = std::string (val->begin (), val->end ()); + return alloc_string (_val.c_str ()); + #endif + + } else { + + return 0; + + } + + } + + + vbyte* wstring_to_vbytes (std::wstring* val) { + + if (val) { + + #ifdef HX_WINDOWS + int size = std::wcslen (val->c_str ()); + char* result = (char*)malloc (size + 1); + std::wcstombs (result, val->c_str (), size); + result[size] = '\0'; + return (vbyte*)result; + #else + std::string _val = std::string (val->begin (), val->end ()); + int size = std::strlen (_val.c_str ()); + char* result = (char*)malloc (size + 1); + std::strncpy (result, _val.c_str (), size); + result[size] = '\0'; + return (vbyte*)result; + #endif + + } else { + + return 0; + + } + + } + + value lime_application_create () { Application* application = CreateApplication (); @@ -687,7 +736,7 @@ namespace lime { if (path) { - value _path = alloc_wstring (path->c_str ()); + value _path = wstring_to_value (path); delete path; return _path; @@ -720,13 +769,9 @@ namespace lime { if (path) { - int size = std::wcslen (path->c_str ()); - char* result = (char*)malloc (size + 1); - std::wcstombs (result, path->c_str (), size); - result[size] = '\0'; + vbyte* _path = wstring_to_vbytes (path); delete path; - - return (vbyte*)result; + return _path; } else { @@ -757,7 +802,7 @@ namespace lime { if (path) { - value _path = alloc_wstring (path->c_str ()); + value _path = wstring_to_value (path); delete path; return _path; @@ -790,13 +835,9 @@ namespace lime { if (path) { - int size = std::wcslen (path->c_str ()); - char* result = (char*)malloc (size + 1); - std::wcstombs (result, path->c_str (), size); - result[size] = '\0'; + vbyte* _path = wstring_to_vbytes (path); delete path; - - return (vbyte*)result; + return _path; } else { @@ -830,7 +871,8 @@ namespace lime { for (int i = 0; i < files.size (); i++) { - val_array_set_i (result, i, alloc_wstring (files[i]->c_str ())); + value _file = wstring_to_value (files[i]); + val_array_set_i (result, i, _file); delete files[i]; } @@ -864,12 +906,8 @@ namespace lime { for (int i = 0; i < files.size (); i++) { - int size = std::wcslen (files[i]->c_str ()); - char* _file = (char*)malloc (size + 1); - std::wcstombs (_file, files[i]->c_str (), size); - _file[size] = '\0'; - - *resultData++ = (vbyte*)_file; + vbyte* _file = wstring_to_vbytes (files[i]); + *resultData++ = _file; delete files[i]; } @@ -899,7 +937,7 @@ namespace lime { if (path) { - value _path = alloc_wstring (path->c_str ()); + value _path = wstring_to_value (path); delete path; return _path; @@ -932,13 +970,9 @@ namespace lime { if (path) { - int size = std::wcslen (path->c_str ()); - char* result = (char*)malloc (size + 1); - std::wcstombs (result, path->c_str (), size); - result[size] = '\0'; + vbyte* _path = wstring_to_vbytes (path); delete path; - - return (vbyte*)result; + return _path; } else { @@ -3518,6 +3552,38 @@ namespace lime { } + void lime_window_set_minimum_size (value window, int width, int height) { + + Window* targetWindow = (Window*)val_data (window); + targetWindow->SetMinimumSize (width, height); + + } + + + HL_PRIM void HL_NAME(hl_window_set_minimum_size) (HL_CFFIPointer* window, int width, int height) { + + Window* targetWindow = (Window*)window->ptr; + targetWindow->SetMinimumSize (width, height); + + } + + + void lime_window_set_maximum_size (value window, int width, int height) { + + Window* targetWindow = (Window*)val_data (window); + targetWindow->SetMaximumSize (width, height); + + } + + + HL_PRIM void HL_NAME(hl_window_set_maximum_size) (HL_CFFIPointer* window, int width, int height) { + + Window* targetWindow = (Window*)window->ptr; + targetWindow->SetMaximumSize (width, height); + + } + + bool lime_window_set_borderless (value window, bool borderless) { Window* targetWindow = (Window*)val_data (window); @@ -3986,6 +4052,8 @@ namespace lime { DEFINE_PRIME3v (lime_window_move); DEFINE_PRIME3 (lime_window_read_pixels); DEFINE_PRIME3v (lime_window_resize); + DEFINE_PRIME3v (lime_window_set_minimum_size); + DEFINE_PRIME3v (lime_window_set_maximum_size); DEFINE_PRIME2 (lime_window_set_borderless); DEFINE_PRIME2v (lime_window_set_cursor); DEFINE_PRIME2 (lime_window_set_display_mode); @@ -4173,6 +4241,8 @@ namespace lime { DEFINE_HL_PRIM (_VOID, hl_window_move, _TCFFIPOINTER _I32 _I32); DEFINE_HL_PRIM (_DYN, hl_window_read_pixels, _TCFFIPOINTER _TRECTANGLE _TIMAGEBUFFER); DEFINE_HL_PRIM (_VOID, hl_window_resize, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_VOID, hl_window_set_minimum_size, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_VOID, hl_window_set_maximum_size, _TCFFIPOINTER _I32 _I32); DEFINE_HL_PRIM (_BOOL, hl_window_set_borderless, _TCFFIPOINTER _BOOL); DEFINE_HL_PRIM (_VOID, hl_window_set_cursor, _TCFFIPOINTER _I32); DEFINE_HL_PRIM (_VOID, hl_window_set_display_mode, _TCFFIPOINTER _TDISPLAYMODE _TDISPLAYMODE); diff --git a/project/src/backend/sdl/SDLWindow.cpp b/project/src/backend/sdl/SDLWindow.cpp index 871c2e7ec..59ff7435f 100644 --- a/project/src/backend/sdl/SDLWindow.cpp +++ b/project/src/backend/sdl/SDLWindow.cpp @@ -745,6 +745,20 @@ namespace lime { } + void SDLWindow::SetMinimumSize (int width, int height) { + + SDL_SetWindowMinimumSize (sdlWindow, width, height); + + } + + + void SDLWindow::SetMaximumSize (int width, int height) { + + SDL_SetWindowMaximumSize (sdlWindow, width, height); + + } + + bool SDLWindow::SetBorderless (bool borderless) { if (borderless) { diff --git a/project/src/backend/sdl/SDLWindow.h b/project/src/backend/sdl/SDLWindow.h index e66569f9c..50ee4638e 100644 --- a/project/src/backend/sdl/SDLWindow.h +++ b/project/src/backend/sdl/SDLWindow.h @@ -42,6 +42,8 @@ namespace lime { virtual void Move (int x, int y); virtual void ReadPixels (ImageBuffer *buffer, Rectangle *rect); virtual void Resize (int width, int height); + virtual void SetMinimumSize (int width, int height); + virtual void SetMaximumSize (int width, int height); virtual bool SetBorderless (bool borderless); virtual void SetCursor (Cursor cursor); virtual void SetDisplayMode (DisplayMode* displayMode); diff --git a/project/src/media/openal/OpenALBindings.cpp b/project/src/media/openal/OpenALBindings.cpp index 836de928b..cd67d72cc 100644 --- a/project/src/media/openal/OpenALBindings.cpp +++ b/project/src/media/openal/OpenALBindings.cpp @@ -3659,7 +3659,7 @@ namespace lime { DEFINE_HL_PRIM (_VOID, hl_al_effecti, _TCFFIPOINTER _I32 _I32); DEFINE_HL_PRIM (_VOID, hl_al_effectiv, _TCFFIPOINTER _I32 _ARR); DEFINE_HL_PRIM (_VOID, hl_al_enable, _I32); - DEFINE_HL_PRIM (_VOID, hl_al_filteri, _TCFFIPOINTER _I32 _DYN); + DEFINE_HL_PRIM (_VOID, hl_al_filteri, _TCFFIPOINTER _I32 _I32); DEFINE_HL_PRIM (_VOID, hl_al_filterf, _TCFFIPOINTER _I32 _F32); DEFINE_HL_PRIM (_TCFFIPOINTER, hl_al_gen_aux, _NO_ARG); DEFINE_HL_PRIM (_TCFFIPOINTER, hl_al_gen_buffer, _NO_ARG); diff --git a/project/src/text/Font.cpp b/project/src/text/Font.cpp index 8ab0bdd0b..61328850c 100644 --- a/project/src/text/Font.cpp +++ b/project/src/text/Font.cpp @@ -25,7 +25,7 @@ #define IS_IN_RANGE(c, f, l) (((c) >= (f)) && ((c) <= (l))) -unsigned long readNextChar (char*& p) +unsigned long readNextChar (const char*& p) { // TODO: since UTF-8 is a variable-length // encoding, you should pass in the input @@ -33,7 +33,8 @@ unsigned long readNextChar (char*& p) // can determine if a malformed UTF-8 // sequence would exceed the end of the buffer... - unsigned char c1, c2, *ptr = (unsigned char*) p; + const unsigned char* ptr = (const unsigned char*) p; + unsigned char c1, c2; unsigned long uc = 0; int seqlen; @@ -792,7 +793,7 @@ namespace lime { } - int Font::GetGlyphIndex (char* character) { + int Font::GetGlyphIndex (const char* character) { long charCode = readNextChar (character); @@ -801,7 +802,7 @@ namespace lime { } - void* Font::GetGlyphIndices (bool useCFFIValue, char* characters) { + void* Font::GetGlyphIndices (bool useCFFIValue, const char* characters) { if (useCFFIValue) { diff --git a/run.n b/run.n index 4e278d982..2544816fb 100644 Binary files a/run.n and b/run.n differ diff --git a/src/lime/_internal/backend/air/AIRApplication.hx b/src/lime/_internal/backend/air/AIRApplication.hx index 9dc75930b..c814ec97b 100644 --- a/src/lime/_internal/backend/air/AIRApplication.hx +++ b/src/lime/_internal/backend/air/AIRApplication.hx @@ -21,7 +21,7 @@ class AIRApplication extends FlashApplication { System.exit(0); - if (Application.current.onExit.canceled) + if (Application.current != null && Application.current.onExit.canceled) { event.preventDefault(); event.stopImmediatePropagation(); diff --git a/src/lime/_internal/backend/air/AIRWindow.hx b/src/lime/_internal/backend/air/AIRWindow.hx index 821ec79cd..3dccc8264 100644 --- a/src/lime/_internal/backend/air/AIRWindow.hx +++ b/src/lime/_internal/backend/air/AIRWindow.hx @@ -5,6 +5,7 @@ import flash.display.NativeWindow; import flash.display.NativeWindowInitOptions; import flash.display.NativeWindowRenderMode; import flash.display.NativeWindowSystemChrome; +import flash.geom.Point; import flash.events.Event; import flash.events.NativeWindowBoundsEvent; import flash.html.HTMLLoader; @@ -231,6 +232,22 @@ class AIRWindow extends FlashWindow } } + public override function setMinSize(width:Int, height:Int):Void + { + if (nativeWindow != null) + { + nativeWindow.minSize = new Point(width, height); + } + } + + public override function setMaxSize(width:Int, height:Int):Void + { + if (nativeWindow != null) + { + nativeWindow.maxSize = new Point(width, height); + } + } + public override function setMaximized(value:Bool):Bool { if (nativeWindow != null) diff --git a/src/lime/_internal/backend/flash/FlashWindow.hx b/src/lime/_internal/backend/flash/FlashWindow.hx index 2d3988e5c..a1f3dc7b6 100644 --- a/src/lime/_internal/backend/flash/FlashWindow.hx +++ b/src/lime/_internal/backend/flash/FlashWindow.hx @@ -586,6 +586,10 @@ class FlashWindow public function resize(width:Int, height:Int):Void {} + public function setMinSize(width:Int, height:Int):Void {} + + public function setMaxSize(width:Int, height:Int):Void {} + public function setBorderless(value:Bool):Bool { return value; diff --git a/src/lime/_internal/backend/html5/HTML5Application.hx b/src/lime/_internal/backend/html5/HTML5Application.hx index 78a4c3bfb..3b137e92b 100644 --- a/src/lime/_internal/backend/html5/HTML5Application.hx +++ b/src/lime/_internal/backend/html5/HTML5Application.hx @@ -325,7 +325,7 @@ class HTML5Application if (!window.requestAnimationFrame) window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); + var currTime = window.performance.now(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); @@ -341,7 +341,7 @@ class HTML5Application window.requestAnimFrame = window.requestAnimationFrame; "); - lastUpdate = Date.now().getTime(); + lastUpdate = Browser.window.performance.now(); handleApplicationEvent(); @@ -361,7 +361,7 @@ class HTML5Application updateGameDevices(); - currentUpdate = Date.now().getTime(); + currentUpdate = Browser.window.performance.now(); if (currentUpdate >= nextUpdate) { diff --git a/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx b/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx index e05967b29..a45d34c0d 100644 --- a/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx +++ b/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx @@ -444,7 +444,7 @@ class HTML5HTTPRequest private static function __loadImage(uri:String, promise:Promise, options:Int):Void { - var image = new JSImage(); + var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()'); if (!__isSameOrigin(uri)) { @@ -534,7 +534,7 @@ class HTML5HTTPRequest { if (request.readyState != 4) return; - if (request.status != null && ((request.status >= 200 && request.status <= 400) || (validStatus0 && request.status == 0))) + if (request.status != null && ((request.status >= 200 && request.status < 400) || (validStatus0 && request.status == 0))) { processResponse(); promise.complete(request.responseText); diff --git a/src/lime/_internal/backend/html5/HTML5Window.hx b/src/lime/_internal/backend/html5/HTML5Window.hx index 636275a5f..6a47f52b7 100644 --- a/src/lime/_internal/backend/html5/HTML5Window.hx +++ b/src/lime/_internal/backend/html5/HTML5Window.hx @@ -250,6 +250,45 @@ class HTML5Window public function close():Void { + var element = parent.element; + if (element != null) + { + if (canvas != null) + { + if (element != cast canvas) + { + element.removeChild(canvas); + } + canvas = null; + } + else if (div != null) + { + element.removeChild(div); + div = null; + } + + var events = ["mousedown", "mouseenter", "mouseleave", "mousemove", "mouseup", "wheel"]; + + for (event in events) + { + element.removeEventListener(event, handleMouseEvent, true); + } + + element.removeEventListener("contextmenu", handleContextMenuEvent, true); + + element.removeEventListener("dragstart", handleDragEvent, true); + element.removeEventListener("dragover", handleDragEvent, true); + element.removeEventListener("drop", handleDragEvent, true); + + element.removeEventListener("touchstart", handleTouchEvent, true); + element.removeEventListener("touchmove", handleTouchEvent, true); + element.removeEventListener("touchend", handleTouchEvent, true); + element.removeEventListener("touchcancel", handleTouchEvent, true); + + element.removeEventListener("gamepadconnected", handleGamepadEvent, true); + element.removeEventListener("gamepaddisconnected", handleGamepadEvent, true); + } + parent.application.__removeWindow(parent); } @@ -927,6 +966,10 @@ class HTML5Window public function resize(width:Int, height:Int):Void {} + public function setMinSize(width:Int, height:Int):Void {} + + public function setMaxSize(width:Int, height:Int):Void {} + public function setBorderless(value:Bool):Bool { return value; @@ -1130,7 +1173,7 @@ class HTML5Window textInput.type = 'text'; #else // use password instead of text to avoid IME issues on Android - textInput.type = 'password'; + textInput.type = Browser.navigator.userAgent.indexOf("Android") >= 0 ? 'password' : 'text'; #end textInput.style.position = 'absolute'; textInput.style.opacity = "0"; diff --git a/src/lime/_internal/backend/native/NativeCFFI.hx b/src/lime/_internal/backend/native/NativeCFFI.hx index 6372a96bc..6b6d5f8d7 100644 --- a/src/lime/_internal/backend/native/NativeCFFI.hx +++ b/src/lime/_internal/backend/native/NativeCFFI.hx @@ -323,6 +323,10 @@ class NativeCFFI @:cffi private static function lime_window_resize(handle:Dynamic, width:Int, height:Int):Void; + @:cffi private static function lime_window_set_minimum_size(handle:Dynamic, width:Int, height:Int):Void; + + @:cffi private static function lime_window_set_maximum_size(handle:Dynamic, width:Int, height:Int):Void; + @:cffi private static function lime_window_set_borderless(handle:Dynamic, borderless:Bool):Bool; @:cffi private static function lime_window_set_cursor(handle:Dynamic, cursor:Int):Void; @@ -582,6 +586,10 @@ class NativeCFFI "lime_window_read_pixels", "oooo", false)); private static var lime_window_resize = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_resize", "oiiv", false)); + private static var lime_window_set_minimum_size = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_set_minimum_size", "oiiv", + false)); + private static var lime_window_set_maximum_size = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_set_maximum_size", "oiiv", + false)); private static var lime_window_set_borderless = new cpp.CallableBool->Bool>(cpp.Prime._loadPrime("lime", "lime_window_set_borderless", "obb", false)); private static var lime_window_set_cursor = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_set_cursor", "oiv", @@ -753,6 +761,8 @@ class NativeCFFI private static var lime_window_move = CFFI.load("lime", "lime_window_move", 3); private static var lime_window_read_pixels = CFFI.load("lime", "lime_window_read_pixels", 3); private static var lime_window_resize = CFFI.load("lime", "lime_window_resize", 3); + private static var lime_window_set_minimum_size = CFFI.load("lime", "lime_window_set_minimum_size", 3); + private static var lime_window_set_maximum_size = CFFI.load("lime", "lime_window_set_maximum_size", 3); private static var lime_window_set_borderless = CFFI.load("lime", "lime_window_set_borderless", 2); private static var lime_window_set_cursor = CFFI.load("lime", "lime_window_set_cursor", 2); private static var lime_window_set_display_mode = CFFI.load("lime", "lime_window_set_display_mode", 2); @@ -1324,6 +1334,10 @@ class NativeCFFI @:hlNative("lime", "hl_window_resize") private static function lime_window_resize(handle:CFFIPointer, width:Int, height:Int):Void {} + @:hlNative("lime", "hl_window_set_minimum_size") private static function lime_window_set_minimum_size(handle:CFFIPointer, width:Int, height:Int):Void {} + + @:hlNative("lime", "hl_window_set_maximum_size") private static function lime_window_set_maximum_size(handle:CFFIPointer, width:Int, height:Int):Void {} + @:hlNative("lime", "hl_window_set_borderless") private static function lime_window_set_borderless(handle:CFFIPointer, borderless:Bool):Bool { return false; @@ -2294,7 +2308,7 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_al_filteri") private static function lime_al_filteri(filter:CFFIPointer, param:Int, value:Dynamic):Void {} + @:hlNative("lime", "hl_al_filteri") private static function lime_al_filteri(filter:CFFIPointer, param:Int, value:Int):Void {} @:hlNative("lime", "hl_al_filterf") private static function lime_al_filterf(filter:CFFIPointer, param:Int, value:hl.F32):Void {} diff --git a/src/lime/_internal/backend/native/NativeWindow.hx b/src/lime/_internal/backend/native/NativeWindow.hx index 4b0e94253..36790c5f4 100644 --- a/src/lime/_internal/backend/native/NativeWindow.hx +++ b/src/lime/_internal/backend/native/NativeWindow.hx @@ -461,6 +461,26 @@ class NativeWindow } } + public function setMinSize(width:Int, height:Int):Void + { + if (handle != null) + { + #if (!macro && lime_cffi) + NativeCFFI.lime_window_set_minimum_size(handle, width, height); + #end + } + } + + public function setMaxSize(width:Int, height:Int):Void + { + if (handle != null) + { + #if (!macro && lime_cffi) + NativeCFFI.lime_window_set_maximum_size(handle, width, height); + #end + } + } + public function setBorderless(value:Bool):Bool { if (handle != null) diff --git a/src/lime/app/Application.hx b/src/lime/app/Application.hx index 0949139e3..3348e3f4e 100644 --- a/src/lime/app/Application.hx +++ b/src/lime/app/Application.hx @@ -514,7 +514,7 @@ class Application extends Module { application.onUpdate.add(update); application.onExit.add(onModuleExit, false, 0); - application.onExit.add(__onModuleExit, false, 0); + application.onExit.add(__onModuleExit, false, -1000); for (gamepad in Gamepad.devices) { @@ -555,12 +555,15 @@ class Application extends Module @:noCompletion private function __checkForAllWindowsClosed():Void { + // air handles this automatically with NativeApplication.autoExit + #if !air if (__windows.length == 0) { #if !lime_doc_gen System.exit(0); #end } + #end } @:noCompletion private function __onGamepadConnect(gamepad:Gamepad):Void @@ -587,7 +590,17 @@ class Application extends Module @:noCompletion private function __onModuleExit(code:Int):Void { + if (onExit.canceled) + { + return; + } + + __unregisterLimeModule(this); __backend.exit(); + if (Application.current == this) + { + Application.current = null; + } } @:noCompletion private function __onWindowClose(window:Window):Void @@ -612,8 +625,6 @@ class Application extends Module Touch.onStart.remove(onTouchStart); Touch.onMove.remove(onTouchMove); Touch.onEnd.remove(onTouchEnd); - - onModuleExit(0); } // Get & Set Methods diff --git a/src/lime/graphics/Image.hx b/src/lime/graphics/Image.hx index 58c25addc..1af941fe5 100644 --- a/src/lime/graphics/Image.hx +++ b/src/lime/graphics/Image.hx @@ -1421,11 +1421,7 @@ class Image @:noCompletion private function __fromBase64(base64:String, type:String, onload:Image->Void = null):Void { #if (js && html5) - #if (openfljs || genes) var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()'); - #else - var image = new JSImage(); - #end var image_onLoaded = function(event) { @@ -1513,11 +1509,7 @@ class Image @:noCompletion private function __fromFile(path:String, onload:Image->Void = null, onerror:Void->Void = null):Bool { #if (js && html5) - #if (openfljs || genes) var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()'); - #else - var image = new JSImage(); - #end #if !display if (!HTML5HTTPRequest.__isSameOrigin(path)) diff --git a/src/lime/system/CFFI.hx b/src/lime/system/CFFI.hx index 37a4d8452..08b42b0e5 100644 --- a/src/lime/system/CFFI.hx +++ b/src/lime/system/CFFI.hx @@ -155,16 +155,15 @@ class CFFI if (result == null) { - var slash = (__sysName().substr(7).toLowerCase() == "windows") ? "\\" : "/"; var haxelib = __findHaxelib("lime"); if (haxelib != "") { - result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + slash + library, library, method, args); + result = __tryLoad(haxelib + "/ndll/" + __sysName() + "/" + library, library, method, args); if (result == null) { - result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + "64" + slash + library, library, method, args); + result = __tryLoad(haxelib + "/ndll/" + __sysName() + "64/" + library, library, method, args); } } } @@ -286,34 +285,35 @@ class CFFI { if (!__loadedNekoAPI) { + var init:Dynamic = null; try { - var init = load("lime", "neko_init", 5); - - if (init != null) - { - __loaderTrace("Found nekoapi @ " + __moduleNames.get("lime")); - init(function(s) return new String(s), function(len:Int) - { - var r = []; - if (len > 0) r[len - 1] = null; - return r; - }, null, true, false); - } - else if (!lazy) - { - throw("Could not find NekoAPI interface."); - } + init = load("lime", "neko_init", 5); } catch (e:Dynamic) { - if (!lazy) - { - throw("Could not find NekoAPI interface."); - } } - __loadedNekoAPI = true; + if (init != null) + { + __loaderTrace("Found nekoapi @ " + __moduleNames.get("lime")); + init(function(s) return new String(s), function(len:Int) + { + var r = []; + if (len > 0) r[len - 1] = null; + return r; + }, null, true, false); + + __loadedNekoAPI = true; + } + else if (!lazy) + { + var ndllFolder = __findHaxelib("lime") + "/ndll/" + __sysName(); + throw "Could not find lime.ndll. This file is provided with Lime's Haxelib releases, but not via Git. " + + "Please copy it from Lime's latest Haxelib release into either " + + ndllFolder + " or " + ndllFolder + "64, as appropriate for your system. " + + "Advanced users may run `lime rebuild cpp` instead."; + } } } #end diff --git a/src/lime/system/JNI.hx b/src/lime/system/JNI.hx index 8b571633c..b1a052022 100644 --- a/src/lime/system/JNI.hx +++ b/src/lime/system/JNI.hx @@ -63,52 +63,12 @@ class JNI public static function callMember(method:Dynamic, jobject:Dynamic, a:Array):Dynamic { - switch (a.length) - { - case 0: - return method(jobject); - case 1: - return method(jobject, a[0]); - case 2: - return method(jobject, a[0], a[1]); - case 3: - return method(jobject, a[0], a[1], a[2]); - case 4: - return method(jobject, a[0], a[1], a[2], a[3]); - case 5: - return method(jobject, a[0], a[1], a[2], a[3], a[4]); - case 6: - return method(jobject, a[0], a[1], a[2], a[3], a[4], a[5]); - case 7: - return method(jobject, a[0], a[1], a[2], a[3], a[4], a[5], a[6]); - default: - return null; - } + return Reflect.callMethod(null, method, [jobject].concat(a)); } public static function callStatic(method:Dynamic, a:Array):Dynamic { - switch (a.length) - { - case 0: - return method(); - case 1: - return method(a[0]); - case 2: - return method(a[0], a[1]); - case 3: - return method(a[0], a[1], a[2]); - case 4: - return method(a[0], a[1], a[2], a[3]); - case 5: - return method(a[0], a[1], a[2], a[3], a[4]); - case 6: - return method(a[0], a[1], a[2], a[3], a[4], a[5]); - case 7: - return method(a[0], a[1], a[2], a[3], a[4], a[5], a[6]); - default: - return null; - } + return Reflect.callMethod(null, method, a); } /** diff --git a/src/lime/system/System.hx b/src/lime/system/System.hx index 6d93f4018..6701340b1 100644 --- a/src/lime/system/System.hx +++ b/src/lime/system/System.hx @@ -141,12 +141,13 @@ class System #if (!lime_doc_gen || sys) public static function exit(code:Int):Void { - #if ((sys || air) && !macro) - if (Application.current != null) + var currentApp = Application.current; + #if ((sys || (js && html5) || air) && !macro) + if (currentApp != null) { - Application.current.onExit.dispatch(code); + currentApp.onExit.dispatch(code); - if (Application.current.onExit.canceled) + if (currentApp.onExit.canceled) { return; } @@ -155,6 +156,11 @@ class System #if sys Sys.exit(code); + #elseif (js && html5) + if (currentApp != null && currentApp.window != null) + { + currentApp.window.close(); + } #elseif air NativeApplication.nativeApplication.exit(code); #end diff --git a/src/lime/tools/AIRHelper.hx b/src/lime/tools/AIRHelper.hx index 08c009060..039ea0de6 100644 --- a/src/lime/tools/AIRHelper.hx +++ b/src/lime/tools/AIRHelper.hx @@ -149,12 +149,20 @@ class AIRHelper if (project.debug) { - args.push("-connect"); - if (project.config.exists("air.connect")) { + args.push("-connect"); args.push(project.config.getString("air.connect")); } + else if (project.config.exists("air.listen")) + { + args.push("-listen"); + args.push(project.config.getString("air.listen")); + } + else + { + args.push("-connect"); + } } args = args.concat(signingOptions); @@ -204,9 +212,17 @@ class AIRHelper Sys.putEnv("AIR_NOANDROIDFLAIR", "true"); } - if (targetPlatform == IOS) + if (targetPlatform == IOS && System.hostPlatform == MAC) { - Sys.putEnv("AIR_IOS_SIMULATOR_DEVICE", XCodeHelper.getSimulatorName(project)); + var simulatorName = XCodeHelper.getSimulatorName(project); + if (simulatorName == null) + { + Log.warn("Skipping AIR_IOS_SIMULATOR_DEVICE environment variable because default simulator not found"); + } + else + { + Sys.putEnv("AIR_IOS_SIMULATOR_DEVICE", simulatorName); + } } System.runCommand(workingDirectory, project.defines.get("AIR_SDK") + "/bin/adt", args); diff --git a/src/lime/tools/HXProject.hx b/src/lime/tools/HXProject.hx index 43cb8fa1b..6d9e55ba9 100644 --- a/src/lime/tools/HXProject.hx +++ b/src/lime/tools/HXProject.hx @@ -376,38 +376,18 @@ class HXProject extends Script var tempDirectory = System.getTemporaryDirectory(); var classFile = Path.combine(tempDirectory, name + ".hx"); - var nekoOutput = Path.combine(tempDirectory, name + ".n"); System.copyFile(path, classFile); - #if lime var args = [ name, - "-main", - "lime.tools.HXProject", - "-cp", - tempDirectory, - "-neko", - nekoOutput, - "-cp", - Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src"), - "-lib", - "lime", - "-lib", - "hxp" + #if lime + "-lib", "lime", + "-lib", "hxp", + #end + "-cp", tempDirectory, + "-cp", Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src") ]; - #else - var args = [ - name, - "--interp", - "-main", - "lime.tools.HXProject", - "-cp", - tempDirectory, - "-cp", - Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src") - ]; - #end var input = File.read(classFile, false); var tag = "@:compiler("; @@ -430,10 +410,6 @@ class HXProject extends Script var cacheDryRun = System.dryRun; System.dryRun = false; - #if lime - System.runCommand("", "haxe", args); - #end - var inputFile = Path.combine(tempDirectory, "input.dat"); var outputFile = Path.combine(tempDirectory, "output.dat"); @@ -457,10 +433,12 @@ class HXProject extends Script try { - #if lime - System.runCommand("", "neko", [FileSystem.fullPath(nekoOutput), inputFile, outputFile]); + #if (lime && !eval) + var nekoOutput = FileSystem.fullPath(Path.combine(tempDirectory, name + ".n")); + System.runCommand("", "haxe", args.concat(["--main", "lime.tools.HXProject", "-neko", nekoOutput])); + System.runCommand("", "neko", [nekoOutput, inputFile, outputFile]); #else - System.runCommand("", "haxe", args.concat(["--", inputFile, outputFile])); + System.runCommand("", "haxe", args.concat(["--run", "lime.tools.HXProject", inputFile, outputFile])); #end } catch (e:Dynamic) @@ -540,37 +518,48 @@ class HXProject extends Script return HXProject.fromPath(path, userDefines); } - public static function fromPath(path:String, userDefines:Map = null):HXProject + public static function fromPath(directory:String, userDefines:Map = null):HXProject { - if (!FileSystem.exists(path) || !FileSystem.isDirectory(path)) + if (!FileSystem.exists(directory) || !FileSystem.isDirectory(directory)) { return null; } - var files = ["include.lime", "include.nmml", "include.xml"]; + var files = ["include.lime", "include.nmml", "include.xml", "include.hxp"]; var projectFile = null; for (file in files) { - if (projectFile == null && FileSystem.exists(Path.combine(path, file))) + if (FileSystem.exists(Path.combine(directory, file))) { - projectFile = Path.combine(path, file); + projectFile = Path.combine(directory, file); + break; } } + var project = null; + if (projectFile != null) { - var project = new ProjectXMLParser(projectFile, userDefines); + if (StringTools.endsWith(projectFile, ".hxp")) + { + var cwd = Sys.getCwd(); + Sys.setCwd(directory); + project = HXProject.fromFile(projectFile, userDefines); + Sys.setCwd(cwd); + } + else + { + project = new ProjectXMLParser(projectFile, userDefines); + } if (project.config.get("project.rebuild.path") == null) { - project.config.set("project.rebuild.path", Path.combine(path, "project")); + project.config.set("project.rebuild.path", Path.combine(directory, "project")); } - - return project; } - return null; + return project; } private function getHaxelibVersion(haxelib:Haxelib):String diff --git a/src/lime/tools/XCodeHelper.hx b/src/lime/tools/XCodeHelper.hx index 5368f8499..1565d516a 100644 --- a/src/lime/tools/XCodeHelper.hx +++ b/src/lime/tools/XCodeHelper.hx @@ -6,7 +6,7 @@ import lime.tools.HXProject; class XCodeHelper { private static inline var DEFAULT_IPAD_SIMULATOR = "ipad-air"; - private static inline var DEFAULT_IPHONE_SIMULATOR = "iphone-11"; + private static var DEFAULT_IPHONE_SIMULATOR_REGEX = ~/iphone-\d+/g; private static function extractSimulatorFlagName(line:String):String { @@ -92,7 +92,14 @@ class XCodeHelper } else { - currentDevice = devices.get(DEFAULT_IPHONE_SIMULATOR); + for (device in devices.keys()) + { + if (DEFAULT_IPHONE_SIMULATOR_REGEX.match(device)) + { + currentDevice = devices.get(device); + break; + } + } } } @@ -101,12 +108,22 @@ class XCodeHelper public static function getSimulatorID(project:HXProject):String { - return getSelectedSimulator(project).id; + var simulator = getSelectedSimulator(project); + if (simulator == null) + { + return null; + } + return simulator.id; } public static function getSimulatorName(project:HXProject):String { - return getSelectedSimulator(project).name; + var simulator = getSelectedSimulator(project); + if (simulator == null) + { + return null; + } + return simulator.name; } private static function getSimulators():String diff --git a/src/lime/ui/Window.hx b/src/lime/ui/Window.hx index 177214835..f1abc1758 100644 --- a/src/lime/ui/Window.hx +++ b/src/lime/ui/Window.hx @@ -50,8 +50,12 @@ class Window public var height(get, set):Int; public var hidden(get, null):Bool; public var id(default, null):Int; + public var maxHeight(get, set):Int; public var maximized(get, set):Bool; + public var maxWidth(get, set):Int; + public var minHeight(get, set):Int; public var minimized(get, set):Bool; + public var minWidth(get, set):Int; public var mouseLock(get, set):Bool; public var onActivate(default, null) = new EventVoid>(); public var onClose(default, null) = new EventVoid>(); @@ -114,6 +118,10 @@ class Window @:noCompletion private var __width:Int; @:noCompletion private var __x:Int; @:noCompletion private var __y:Int; + @:noCompletion private var __minWidth:Int; + @:noCompletion private var __minHeight:Int; + @:noCompletion private var __maxWidth:Int; + @:noCompletion private var __maxHeight:Int; #if commonjs private static function __init__() @@ -128,8 +136,12 @@ class Window "frameRate": {get: p.get_frameRate, set: p.set_frameRate}, "fullscreen": {get: p.get_fullscreen, set: p.set_fullscreen}, "height": {get: p.get_height, set: p.set_height}, + "maxHeight": {get: p.get_maxHeight, set: p.set_maxHeight}, "maximized": {get: p.get_maximized, set: p.set_maximized}, + "maxWidth": {get: p.get_maxWidth, set: p.set_maxWidth}, + "minHeight": {get: p.get_minHeight, set: p.set_minHeight}, "minimized": {get: p.get_minimized, set: p.set_minimized}, + "minWidth": {get: p.get_minWidth, set: p.set_minWidth}, "mouseLock": {get: p.get_mouseLock, set: p.set_mouseLock}, "resizable": {get: p.get_resizable, set: p.set_resizable}, "scale": {get: p.get_scale}, @@ -396,12 +408,57 @@ class Window public function resize(width:Int, height:Int):Void { + if (width < __minWidth) + { + width = __minWidth; + } + else if (width > __maxWidth) + { + width = __maxWidth; + } + if (height < __minHeight) + { + height = __minHeight; + } + else if (height > __maxHeight) + { + height = __maxHeight; + } + __backend.resize(width, height); __width = width; __height = height; } + public function setMinSize(width:Int, height:Int):Void + { + __backend.setMinSize(width, height); + + __minWidth = width; + __minHeight = height; + if (__width < __minWidth) { + __width = __minWidth; + } + if (__height < __minHeight) { + __height = __minHeight; + } + } + + public function setMaxSize(width:Int, height:Int):Void + { + __backend.setMaxSize(width, height); + + __maxWidth = width; + __maxHeight = height; + if (__width > __maxWidth) { + __width = __maxWidth; + } + if (__height > __maxHeight) { + __height = __maxHeight; + } + } + public function setIcon(image:Image):Void { if (image == null) @@ -494,6 +551,17 @@ class Window return __hidden; } + @:noCompletion private inline function get_maxHeight():Int + { + return __maxHeight; + } + + @:noCompletion private function set_maxHeight(value:Int):Int + { + setMaxSize(__maxWidth, value); + return __maxHeight; + } + @:noCompletion private inline function get_maximized():Bool { return __maximized; @@ -505,6 +573,28 @@ class Window return __maximized = __backend.setMaximized(value); } + @:noCompletion private inline function get_maxWidth():Int + { + return __maxWidth; + } + + @:noCompletion private function set_maxWidth(value:Int):Int + { + setMinSize(value, __maxHeight); + return __maxWidth; + } + + @:noCompletion private inline function get_minHeight():Int + { + return __minHeight; + } + + @:noCompletion private function set_minHeight(value:Int):Int + { + setMinSize(__minWidth, value); + return __minHeight; + } + @:noCompletion private inline function get_minimized():Bool { return __minimized; @@ -516,6 +606,17 @@ class Window return __minimized = __backend.setMinimized(value); } + @:noCompletion private inline function get_minWidth():Int + { + return __minWidth; + } + + @:noCompletion private function set_minWidth(value:Int):Int + { + setMinSize(value, __minHeight); + return __minWidth; + } + @:noCompletion private function get_mouseLock():Bool { return __backend.getMouseLock(); diff --git a/src/lime/utils/Assets.hx b/src/lime/utils/Assets.hx index 58477916f..dc64da5b6 100644 --- a/src/lime/utils/Assets.hx +++ b/src/lime/utils/Assets.hx @@ -492,6 +492,11 @@ class Assets public static function registerLibrary(name:String, library:AssetLibrary):Void { + if (name == null || name == "") + { + name = "default"; + } + if (libraries.exists(name)) { if (libraries.get(name) == library) diff --git a/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java b/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java index b82938858..e0c37f44c 100644 --- a/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java +++ b/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java @@ -37,8 +37,7 @@ public class GameActivity extends SDLActivity { if (metrics == null) { - metrics = new DisplayMetrics (); - Extension.mainActivity.getWindowManager ().getDefaultDisplay ().getMetrics (metrics); + metrics = Extension.mainContext.getResources ().getDisplayMetrics (); } diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index 25fe2c319..62d143da8 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -1180,7 +1180,7 @@ class CommandLineTools if ((extension == "lime" && file != "include.lime") || (extension == "nmml" && file != "include.nmml") || (extension == "xml" && file != "include.xml") - || extension == "hxp") + || (extension == "hxp" && file != "include.hxp")) { matches.get(extension).push(path); } diff --git a/tools/RunScript.hx b/tools/RunScript.hx index 5b4663cf0..0f4243a15 100644 --- a/tools/RunScript.hx +++ b/tools/RunScript.hx @@ -199,6 +199,23 @@ class RunScript } } + if (args.indexOf("-eval") >= 0) + { + args.remove("-eval"); + Log.info("Experimental: executing `lime " + args.slice(0, args.length - 1).join(" ") + + "` using Eval (https://haxe.org/blog/eval/)"); + + var args = [ + "-D", "lime", + "-cp", "tools", + "-cp", "tools/platforms", + "-cp", "src", + "-lib", "format", + "-lib", "hxp", + "--run", "CommandLineTools"].concat(args); + Sys.exit(runCommand("", "haxe", args)); + } + if (!FileSystem.exists("tools/tools.n") || args.indexOf("-rebuild") > -1) { rebuildTools(); diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index 21ef7c06c..e03754c3a 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -91,7 +91,7 @@ class IOSPlatform extends PlatformTarget title: "" }; - defaults.architectures = [Architecture.ARMV7, Architecture.ARM64]; + defaults.architectures = [Architecture.ARM64]; defaults.window.width = 0; defaults.window.height = 0; defaults.window.fullscreen = true; @@ -250,7 +250,7 @@ class IOSPlatform extends PlatformTarget if (architectures == null || architectures.length == 0) { - architectures = [Architecture.ARMV7, Architecture.ARM64]; + architectures = [Architecture.ARM64]; } if (project.config.getString("ios.device", "universal") == "universal" || project.config.getString("ios.device") == "iphone") @@ -487,11 +487,11 @@ class IOSPlatform extends PlatformTarget var commands = []; - if (armv6) commands.push(["-Dios", "-DHXCPP_CPP11"]); + if (armv6) commands.push(["-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV6"]); if (armv7) commands.push(["-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV7"]); if (armv7s) commands.push(["-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV7S"]); if (arm64) commands.push(["-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARM64"]); - if (i386) commands.push(["-Dios", "-Dsimulator", "-DHXCPP_CPP11"]); + if (i386) commands.push(["-Dios", "-Dsimulator", "-DHXCPP_M32", "-DHXCPP_CPP11"]); if (x86_64) commands.push(["-Dios", "-Dsimulator", "-DHXCPP_M64", "-DHXCPP_CPP11"]); if (arc) diff --git a/tools/tools.hxml b/tools/tools.hxml index 01977752a..4c410494c 100644 --- a/tools/tools.hxml +++ b/tools/tools.hxml @@ -9,4 +9,3 @@ -lib hxp #-lib svg -D optional-cffi --D no-inline \ No newline at end of file