Commit Graph

5845 Commits

Author SHA1 Message Date
ACrazyTown
bc862887c6 OpenALAudioContext: wrap import in conditional
Some checks failed
CI / docs (push) Failing after 2m28s
CI / android (stable) (push) Failing after 3m42s
CI / android (r28c) (push) Failing after 4m5s
CI / linux (push) Failing after 6m52s
CI / neko-samples (3.4.7, ubuntu-22.04) (push) Has been cancelled
CI / html5-samples (4.2.5) (push) Has been cancelled
CI / html5-samples (4.3.6) (push) Has been cancelled
CI / macos (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / ios (push) Has been cancelled
CI / package-haxelib (push) Has been cancelled
CI / air-samples (4.0.5) (push) Has been cancelled
CI / air-samples (4.1.5) (push) Has been cancelled
CI / air-samples (4.2.5) (push) Has been cancelled
CI / air-samples (4.3.6) (push) Has been cancelled
CI / neko-samples (3.4.7, macos-13) (push) Has been cancelled
CI / hashlink-samples (macos-13) (push) Has been cancelled
CI / hashlink-samples (ubuntu-22.04) (push) Has been cancelled
CI / hashlink-samples (windows-latest) (push) Has been cancelled
CI / hashlinkc-samples (macos-13) (push) Has been cancelled
CI / hashlinkc-samples (ubuntu-22.04) (push) Has been cancelled
CI / hashlinkc-samples (windows-latest) (push) Has been cancelled
CI / html5-samples (3.4.7) (push) Has been cancelled
CI / html5-samples (4.0.5) (push) Has been cancelled
CI / html5-samples (4.1.5) (push) Has been cancelled
CI / neko-samples (3.4.7, windows-latest) (push) Has been cancelled
CI / neko-samples (4.2.5, macos-13) (push) Has been cancelled
CI / neko-samples (4.2.5, ubuntu-22.04) (push) Has been cancelled
CI / neko-samples (4.2.5, windows-latest) (push) Has been cancelled
CI / notify (push) Has been cancelled
2025-07-30 22:37:55 +02:00
ACrazyTown
304ffb9438 Implement OpenAL audio capture extension 2025-07-27 13:40:37 +02:00
Josh Tynjala
f8229bf7ae AndroidPlatform: target-sdk-version 35 is the current minimum requirement for new apps 2025-07-21 08:55:06 -07:00
Josh Tynjala
67d2261f11 actions: compile Android with NDK r28c
Needed for required 16KB native library alignment
2025-07-21 08:37:30 -07:00
Josh Tynjala
7b5a5e1d0a Set hl-ver for Lime's bundled HashLink
Haxe 5 defaults to 1.15, but we're currently still bundling an older version. So we need to specify hl-ver or it won't work properly because Haxe 5 will produce code that older HashLink isn't compatible with.

If hl-ver is already specified, or if a custom HL_PATH is defined, does not set hl-ver because that may be undesirable.
2025-07-09 10:24:20 -07:00
Josh Tynjala
ae5751c230 HashLink 1.13
Tested on macOS, Linux, and Windows. Works better with Haxe 5 than HashLink 1.12 did. This upgrade is easier than 1.14 and presumably 1.15, which we can still do later.
2025-07-09 10:24:20 -07:00
player-03
f6393fc107 Overhaul ThreadPool job scheduling. (#1837, #1958)
* Store the job's thread in `JobData`.

Since we're storing more and more in `JobData`, and the background thread only needs three bits of that data, I added those to `ThreadEvent` so we don't have to pass the full object. This may improve performance in HTML5 specifically, where passing a class instance incurs an overhead.

* Allow a single `ThreadPool` to run jobs in both modes.

* Remove unnecessary `@:forward.new`.

* Improve check for whether to call `Thread.returnMessage()`.

Now that thread pools can manage both types of job at once, we can't rely on `mode` to determine whether we're on a background thread. Honestly, I shouldn't have relied on it in the first place.

* Improve `ThreadPool.isMainThread()`.

No need to set `__mainThread` based on `isWorker()` when `isWorker()` already gives the information we're after.

* Correct and clarify documentation.

* Start new jobs immediately when a slot opens up.

For single-threaded jobs, this means a pool can now handle multiple per frame. For multi-threaded jobs, this only slightly reduces the delay between jobs.

* Fix missing function call.

* Add missing import.

Forgot this when overriding the "send" functions.

* Simplify comment.

It's a private variable, so all it really needs to do is mention the location it gets used.

* Don't count the main thread in `currentThreads`.

Plus, alphabetize the variables.

In 8.2.0, a single-threaded pool would report `currentThreads == 1` when running a job, meaning it counted the main thread. But in retrospect, this was both redundant (with `activeJobs`) and unexpected, so I'm counting it as a bug.

* Update documentation.

* Remove redundant check.

All the jobs in `__multiThreadedJobs` are already known to be running in multi-threaded mode. This is left over from when pools were locked to a single mode.

* Handle error case differently.

We still need to throw an error when `mode` is `MULTI_THREADED`, but this can now vary per job, so the check must happen during `run()`.

Also, the old error message was out of date. You can't pass a function to the `ThreadPool` constructor.

* Remove unnecessary `#if`s.

On other targets, it will return `true`, which will be inlined and optimized out. The conditional compilation just added clutter.

* Rewrite `ThreadPool` to use `Deque` on native targets.

Using the flag `lime_threads_deque` to distinguish between this and the old approach. Hopefully someday we can remove this flag, once we implement something akin to `Deque` in HTML5.

That aside, the hardest part is keeping track of the state of each thread. That's why there's so much more complexity: whenever the main thread sends a message to a worker, it needs to wait for confirmation, but also not send any more messages while waiting. And the code that tracks all this needs to work in both modes (with and without `Deque`).

* Bug fix: `firstLoop = false` can get skipped.

* Fix misplaced `#if`.

* Add missing `#if`.

* Make sure all events are received before removing the update listener.

After all jobs are done, threads will send `EXIT` events. These must be processed before removing `__update`, otherwise they'll linger in the queue until the next job starts.

* Keep better track of how many threads are idle.

Previously, while a thread was exiting, `ThreadPool` could think it was still idle. This would cause it not to spin up a new thread for the next job, leading to a pending job with no threads available to handle it.

* Remove redundant code.

* Fix null pointer error.

* Fix bugs in `cancel()` and `cancelJob()`.

* Don't shut down a `ThreadPool` while work events are queued.

Co-authored-by: Barış Yıldırım <25794892+barisyild@users.noreply.github.com>

* Add missing `#if`.

---------

Co-authored-by: Barış Yıldırım <25794892+barisyild@users.noreply.github.com>
2025-07-07 16:22:41 -04:00
unknown
6450e5b2c3 Set some window properties upon creation 2025-06-10 13:17:36 -07:00
Josh Tynjala
3802d51e5c templates: use mobile-web-app-capable in index.html template instead of apple-mobile-web-app-capable
Similar fix to openfl/openfl@8aadc573b7
2025-06-04 13:41:08 -07:00
Josh Tynjala
f4d2965426 Merge branch 'develop' into 8.3.0-Dev 2025-06-04 11:36:03 -07:00
Josh Tynjala
c1f79fbfba actions: use ubuntu-22.04 because GitHub removed ubuntu-20.04 2025-05-05 10:19:03 -07:00
Josh Tynjala
09b6d151ad FileDialog: uses SINGLE_THREADED ThreadPool on all Windows targets to prevent application hang (closes #1946) (references #1849)
Previously, it seemed that only Windows HashLink would hang when opening a FileDialog, but I was able to reproduce #1946 on Windows CPP too. Not sure why I couldn't before because I don't see any obvious changes to FileDialog or ThreadPool that would cause it to happen now, but not when it was affecting HashLink previously.

Does not seem to affect other operating systems.

We might consider going back to BackgroundWorker instead, which we used in Lime 8.1 and older.
2025-05-05 09:47:25 -07:00
Josh Tynjala
bc8f9df60f zlib 1.2.13
Upgrading required to compile with latest Xcode and macOS SDK
2025-04-14 15:28:26 -07:00
Josh Tynjala
97466c6360 png 1.6.46
Upgrading required to compile with latest Xcode and macOS SDK
2025-04-14 15:28:01 -07:00
Josh Tynjala
241edd9d10 efsw 1.4.1
Upgrading required to compile with latest Xcode and macOS SDK
2025-04-14 15:27:24 -07:00
Chris Speciale
aadf0789b1 [ci] use the latest haxelib version 2025-04-10 11:49:27 -04:00
Chris Speciale
236e143a8e [fix] Extract values before locking to avoid deadlock with GC
Attempts to fix reported freezes/crashes related to possible gc contention related to: https://github.com/openfl/lime/issues/1943
2025-04-10 11:20:12 -04:00
Chris Speciale
b10d845ca0 Create MAINTAINERS.md 2025-04-02 10:55:52 -04:00
Barış Yıldırım
12d3ee5916 curl encoding support added 2025-03-21 10:56:23 -04:00
Josh Tynjala
a9f72d65d9 XCodeHelper: if project.xml contains <config:ios device="ipad"/>, default to ipad simulator instead of iphone simulator 2025-03-18 11:10:25 -07:00
Josh Tynjala
9d10e10f5f XCodeHelper: improve selection of default iPhone and iPad simulator
Falls back to any ipad- or iphone- simulator, if necessary
2025-03-18 11:10:25 -07:00
Josh Tynjala
6e869172b1 IOSHelper: use xcrun simctl boot deviceID to ensure that correct device is running
If the simulator was already running with a different device, it might not start the selected device
2025-03-18 11:10:25 -07:00
Josh Tynjala
c6cd26f699 AIRHelper: allow customization of the AIR simulator's screensize and screenDPI 2025-03-18 09:32:01 -07:00
Chris Speciale
63d6deeec3 Merge pull request #1929 from tobil4sk/ci-stable-android-ndk
[ci] Run against stable android ndk
2025-03-16 14:21:29 -04:00
Tobiasz Laskowski
60d10e16fe [ci] Avoid duplicate android artifact upload 2025-03-15 23:21:07 +00:00
Tobiasz Laskowski
cf5c66d889 [ci] Run against stable android ndk 2025-03-15 23:08:11 +00:00
Chris Speciale
844222e99d Merge branch 'develop' into 8.3.0-Dev 2025-03-14 06:53:14 -04:00
Chris Speciale
6f5bc336f3 Merge branch 'develop' into 8.3.0-Dev 2025-03-14 06:47:14 -04:00
Chris Speciale
49a08c6920 Merge pull request #1927 from tobil4sk/android-openal-c++11
Apply -std=c++11 to openal-soft build on android
2025-03-14 06:38:13 -04:00
Tobiasz Laskowski
52072d1f21 Apply -std=c++11 to openal-soft build on android
openal-soft assumes that aligned_alloc is available with c++17. Newer
android ndks set c++17 by default, however they do not expose
aligned_alloc without setting min sdk version to 28.

We can avoid this issue by forcing openal to be compiled with c++11.

Also note, we have HXCPP_CPP11 defined, however, hxcpp ignores this for
the android toolchain.  This means we must set it explicitly

See:
f5e0eef34d/common/almalloc.cpp (L15)
2025-03-14 10:04:25 +00:00
Chris Speciale
1dd2acf479 Merge branch 'develop' into 8.3.0-Dev 2025-03-14 05:30:43 -04:00
Chris Speciale
20c9bec3bc Update Build.xml
Hxcpp doesn't respect HXCPP_CPP11 for android. We can avoid this issue just by adding -std=c++11 here. This resolves a conflict with openal soft 1.20.1 for android builds. This works because the library assumes c++17 and invokes a function that isn't available in android sdk below 28.
2025-03-14 05:29:18 -04:00
Chris Speciale
e41dc949fe Revert "Merge pull request #1924 from tobil4sk/update-openal-1.21.1"
This reverts commit 3f0179657b, reversing
changes made to 80aaaaef9f.
2025-03-14 05:16:24 -04:00
Chris Speciale
ee1d56e864 Android: Revert to sdk 21 as default minimumSdkVersion
Minimum SDK 28 is no longer required to build android after updating openal to 1.21.1. See: https://github.com/openfl/lime/pull/1924

Closes https://github.com/openfl/lime/issues/1923
2025-03-14 01:45:05 -04:00
Chris Speciale
3f0179657b Merge pull request #1924 from tobil4sk/update-openal-1.21.1
Update openal soft to 1.21.1
2025-03-14 01:39:16 -04:00
Tobiasz Laskowski
755781fdf2 Fix mac -stdlib=libstdc++ compilation error
clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
2025-03-13 21:15:45 +00:00
Tobiasz Laskowski
a13b3c37bb Avoid hxcpp overriding openal_soft's c++14 2025-03-13 21:15:34 +00:00
Tobiasz Laskowski
ea2bbd0be3 Update OpenAL Soft to 1.21.1 2025-03-13 21:15:18 +00:00
Chris Speciale
80aaaaef9f Android: Set hard minimum sdk ver for rebuild
Avoids expectations of rebuilding clean which could lead to some confusing situations otherwise.
2025-03-13 08:56:59 -04:00
Chris Speciale
855996e122 Remove PLATFORM from Build.xml
We shouldn't need it anymore following this commit: 46aab0c80e
2025-03-13 05:59:14 -04:00
Chris Speciale
46aab0c80e Android: Allow minimumSDKVersion to be set dynamically
This change moves away from purely hard coding the minimum sdk version for android and also correctly sets the PLATFORM_NUMBER define. The gcc toolchain is no longer compatible in lime 8.3.x+ so, we shouldn't have to worry about the PLATFORM define at all.

It might be wise to enforce a baseline minimum version and complain if users try to use something lower than the default.
2025-03-13 02:24:30 -04:00
Chris Speciale
8d21626297 set PLATFORM to android 28 2025-03-12 18:55:09 -04:00
Chris Speciale
ed8354a86a Update the API level for Android to 28 2025-03-12 18:45:42 -04:00
Chris Speciale
37c9155608 Set minSdkVersion to 28
Should resolve part of the issues related here: https://github.com/openfl/lime/issues/1923#issuecomment-2719250849
2025-03-12 18:26:56 -04:00
Chris Speciale
63b9a88e34 Merge pull request #1921 from tobil4sk/fix/get_glyphs_infinite_loop
Fix Font.getGlyphs returning zeros and looping
2025-03-11 01:34:41 -04:00
Tobiasz Laskowski
23b90dff3f Fix loop in GetGlyphIndices with invalid input
If the text is invalid, then readNextChar returns -1 and does not
progress to the next character. This previously meant that we got stuck
and looped indefinitely.
2025-03-11 01:23:29 +00:00
Tobiasz Laskowski
f495b777ab Remove old comment for hl GetGlyphIndices
The array size is already determined by the first loop
2025-03-11 01:19:58 +00:00
Tobiasz Laskowski
6283017adb Fix GetGlyphIndices returning array of 0 on hl
Previously, the first for loop would reach the end of the characters, so
no further characters were read in the second loop. This meant that the
array remained filled with 0 values.
2025-03-11 01:19:43 +00:00
Josh Tynjala
5488eee50c IOSHelper: comment about how the Platform == 'iOS' filter used by xcrun devicectl includes iPadOS, so there's no need to check for that one separately 2025-03-10 14:58:58 -07:00
Tobiasz Laskowski
70e55b1fa5 Fix rebuild warning about unknown option on msvc
cl : Command line warning D9002 : ignoring unknown option '-std=c11'
2025-03-10 14:20:55 -07:00