Commit Graph

5713 Commits

Author SHA1 Message Date
Josh Tynjala
eed47e7132 AndroidHelper: Fix Android -emulator flag by preferring newer executable paths from Android SDK
The 'SDK Tools' package located in /tools/ is officially considered 'obsolete', so we should not use it by default.

We now prefer /platform-tools/adb over /tools/adb

We now prefer /emulator/emulator over /tools/emulator

If the newer replacement executables are missing, we still try to fall back to /tools/. This should allow older Android SDKs to continue to work properly.

Additionally, if neither version can be found, we report an error. For adb, we always need it, so we always report an error if it is missing. For emulator, we report an error only if we're actually going to use an emulator.

/tools/android doesn't have a newer alternative. We were running 'android list avds' to get a list of all available AVDs. However, both '/emulator/emulator -list-avds' and '/tools/emulator -list-avds' provide a simple list of AVDs separated by line breaks. So it seems that we never actually needed /tools/android. Plus, it outputs a better format that doesn't require searching every line of the output string for 'Name:', and we can just split and trim. So I completely removed /tools/android and we now use either '/emulator/emulator -list-avds' or '/tools/emulator -list-avds'.
2024-06-14 10:04:11 -07:00
player-03
7019abb9fc Don't try to load lzma_worker-min.js in web workers. 2024-06-11 16:22:10 -04:00
Joseph Cloutier
2874ac9cab Use globalThis.
It's designed to solve exactly this problem, and has been universally available since 2020.

The most likely scenario for `globalThis` to fail is if the user is stuck with an old browser, in which case `self` will be available. `window` will be too, but `self` also works in web workers.
2024-06-10 14:26:46 -04:00
Joseph Cloutier
832ac358c1 Use === and !== in output.js. 2024-06-10 14:14:39 -04:00
Joseph Cloutier
bbcb8bea07 Format output.js for readability. 2024-06-10 14:12:19 -04:00
Joseph Cloutier
8066037cdd Bug fix: Node.js was being treated as a web worker context. 2024-06-10 14:07:22 -04:00
Joseph Cloutier
fc393eabd1 Restore "web-worker" attribute.
This was mistakenly removed while merging.
2024-06-10 13:28:23 -04:00
player-03
7a25f656d0 Ignore system environment variables with the same name as common targets.
If you have a `<section if="cpp">` tag in your project.xml, you don't want it to be active just because a system environment variable happens to be named "cpp". You only want it active if actually targeting C++.
2024-06-04 23:11:55 -04:00
player-03
6a23b6eee3 Merge pull request #1790 from player-03/stale_assets
Automatically delete stale assets and dependency files.
2024-06-04 13:42:31 -04:00
player-03
f23ecb6c3f Add preserveDrawingBuffer context attribute. 2024-05-31 21:43:37 -04:00
player-03
5bcf8fcf8e Merge pull request #1770 from barisyild/make-preserveDrawingBuffer-configurable
make preserveDrawingBuffer configurable
2024-05-31 17:54:20 -04:00
tobil4sk
a74127b866 Fix usage of missing variable in CFFI.hx
See a850b12fa0
2024-05-31 22:46:54 +01:00
tobil4sk
587de6d0c5 Update neko scripts 2024-05-31 14:40:23 -07:00
tobil4sk
653c8c92f7 Include MacArm64 when rebuilding tools 2024-05-31 14:40:23 -07:00
tobil4sk
45972bb733 Copy correct ndll on arm64 mac 2024-05-31 14:40:23 -07:00
tobil4sk
1ebce5faa3 Load ndlls from correct path on Apple Silicon Mac 2024-05-31 14:40:23 -07:00
player-03
6c8d742cc3 Merge pull request #1792 from player-03/Matrix3
Make `Matrix3` use column-major order.
2024-05-31 13:26:55 -04:00
Josh Tynjala
81615dc245 CairoPattern: use new CairoMatrix3 for get/set matrix (references #1791) (references #1778) (references #1792)
Fixes gradient drawing in OpenFL
2024-05-31 10:18:03 -07:00
Josh Tynjala
e88b3d21c1 ProjectXMLParser: <echo/> and <log/> (except error) are skipped if the command is display (references openfl/lime-vscode-extension#88) 2024-05-31 08:34:48 -07:00
Joshua Granick
d0678156dd Add initial support for LZMA decompression on HTML5 target 2024-05-31 08:09:28 -07:00
Josh Tynjala
0cf13bf3dd Clipboard: fix text always getting cleared to null in __update() when targeting html5 2024-05-30 16:02:54 -07:00
Joseph Cloutier
084324a7ed Consistently refer to Matrix3 values in column-major order. 2024-05-30 18:42:08 -04:00
Joseph Cloutier
93ad84faeb Remove unused code.
These appear to have been copied from elsewhere and never used.
2024-05-30 18:41:16 -04:00
Joseph Cloutier
9dc809d3e4 Validate array length when converting to Matrix3. 2024-05-30 14:00:19 -04:00
player-03
c0ca857fa6 Merge pull request #1791 from player-03/CairoMatrix3
Create a placeholder object to send `Matrix3`s to C++ code.
2024-05-30 12:20:25 -04:00
tobil4sk
54d6b72390 Fix pixman build for m1 2024-05-30 09:18:09 -07:00
tobil4sk
1a1beff531 Remove no longer used defines
See cf5b033bbc
2024-05-30 09:18:09 -07:00
tobil4sk
f116b57c8e Adding missing RESTRICT define for openal
See e027811906
2024-05-30 09:18:09 -07:00
tobil4sk
53c9b52562 Apply openal build fixes for m1
https://github.com/openfl/libopenal/pull/1
2024-05-30 09:18:09 -07:00
player-03
57da678f67 Limit total time spent on green threads. (#1774)
Every single-threaded `ThreadPool` takes up a certain fraction of the app's time per frame. Without any coordination, they could take up more than 100% of the allotted time, causing the app to slow down. By using static variables, we can make them work together to limit the total time spent per frame.
2024-05-29 21:15:20 -04:00
Joseph Cloutier
224c0a0e93 Delete stale dependencies in addition to stale assets. 2024-05-29 20:55:09 -04:00
Joseph Cloutier
71442d09f4 Create a placeholder object to send Matrix3s to C++ code. 2024-05-29 20:00:23 -04:00
Joseph Cloutier
43b56eb86d Fix potential uninitialized values. 2024-05-29 19:50:52 -04:00
Josh Tynjala
ae941e7442 MacPlatform: running install_name_tool with System.runCommand() works better than new Process()
new Process() was crashing before the process could start for some reason
2024-05-29 15:57:41 -07:00
Joseph Cloutier
12ddca85d9 Implement AssetHelper.deleteStaleAssets(). 2024-05-28 19:33:30 -04:00
Joseph Cloutier
d3d476a1f5 Merge branch 'develop' into 8.2.0-Dev 2024-05-27 16:04:31 -04:00
Joseph Cloutier
1b8d7ac7fa Reduce indentation in ProjectXMLParser.
Whitespace changes interfere with merges, so this change must be applied manually first.
2024-05-27 15:58:20 -04:00
Beshoy Kamel
eabb10efbf Add Matrix4.createPerspective() (#1681)
* add createPerspective

I didn't find a createPerspective function so I tried to make one, but I don't really know if that will work.

* forgot something

* add doc

* I hope that's correct 

added zero to one mode, and -one to one mode variants

* fix missing import

* I keep forgetting shit

* change to exceptions

* Update Matrix4.hx

* remove `new`

* remove period

* final changes

* Follow formatting conventions.

* Avoid using `Math.pow()`.

Haxe is unable to optimize this function away. Also, it seems to be unable to return numbers smaller than 1e-7, so that's what I used in its place. Smaller constants can work, you just can't get them from `Math.pow()`.

* Fill in missing entries.

As per all the other "create" functions.

* Use guard clause for better readability.

* Fix duplicate assignment.

* Make `createPerspective()` public.

---------

Co-authored-by: player-03 <player3.14@gmail.com>
2024-05-27 15:36:44 -04:00
player-03
3078b7c1f6 Merge pull request #1787 from player-03/CFFI_haxelib_libpath
Fix error when locating Lime's bundled NDLLs.
2024-05-27 15:30:19 -04:00
player-03
d0b1f6b0df Merge pull request #1778 from UncertainProd/matrix-3-abstract
Make `Matrix3` an abstract over Float32Array (just like `Matrix4`)
2024-05-27 13:06:42 -04:00
Joseph Cloutier
166ac06e3e Store images as data when in a web worker.
More work may need to be done to transfer an image from a worker to the main thread, but this will at least prevent crashes.
2024-05-27 12:10:00 -04:00
UncertainProd
0f6d143790 Merge branch '8.2.0-Dev' of https://github.com/openfl/lime into matrix-3-abstract 2024-05-27 21:04:52 +05:30
Josh Tynjala
ac4039d849 ProjectXMLParser: handle Std.parseInt() returning null
Previously, null was propagated, which could lead to confusing errors from arithmetic operations. Now, it is ignored, and a warning is displayed that says where the invalid value can be found.
2024-05-22 09:10:04 -07:00
Joshua Granick
2dad602c0d ThreadPool: Crash fixes 2024-05-21 13:46:41 -07:00
player-03
a850b12fa0 Replace __findHaxelib() with a function that finds Lime's NDLL folder.
This is its only use case, so there's no need for an intermediate step of getting the library root. `haxelib path` does return the NDLL folder; the problem with the old implementation of `__findHaxelib()` was it got Lime's source folder instead.
2024-05-17 17:26:35 -04:00
player-03
4ce0a8302d Fix uninitialized variable. 2024-05-16 17:46:20 -04:00
player-03
3b115885f1 Use haxelib libpath when searching for NDLLs.
We could fall back to `haxelib path` for very old versions of Haxelib, but most likely even people stuck on Haxe 3 have updated Haxelib.

Also, `haxelib path` gave incorrect results in the first place, so falling back wouldn't do any good.
2024-05-16 17:40:49 -04:00
player-03
d2ea41570b Print an error message if the HXP project class doesn't match the file name.
This is required but not obvious, so we should spell it out.
2024-05-16 16:49:17 -04:00
Tobi Laskowski
333d093df0 Build.xml: Add /opt/homebrew/lib as rpath on arm64 macos
This is where arm64 homebrew installs `libneko.dylib`. However, it may still be in `/usr/local/lib` if installed via the haxe .pkg installer, so we add both.
2024-05-15 09:18:39 -07:00
Josh Tynjala
c70ec9fbe0 Build.xml: on macOS, add /usr/local/lib to rpath when building lime.ndll
This seems to be required with Xcode 15, but was not required previously
2024-05-09 15:07:12 -07:00