Commit Graph

5907 Commits

Author SHA1 Message Date
Josh Tynjala
6acb0cb961 Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-09-18 09:43:31 -07:00
Josh Tynjala
fc58879a1a Merge branch 'develop' into 8.3.0-Dev 2025-09-18 09:42:54 -07:00
Josh Tynjala
30b77ebd53 System: populate Display's safeArea property on non-native targets 2025-09-15 09:02:29 -07:00
Josh Tynjala
05591ebdb0 NativeCFFI: fix key_code_to_scan_code and key_code_from_scan_code
They were using float values, but they should have been int values instead.

The numeric type conversion was causing some kind of data loss that resulted in wrong values being returned in some cases. In particular, arrow keys.
2025-09-12 15:59:46 -07:00
Josh Tynjala
afbac6d35f some more API docs 2025-09-12 12:24:38 -07:00
Joseph Cloutier
58e15337db Fix hl_gamepad_rumble function signature. 2025-09-01 16:59:33 -04:00
player-03
cb41de5300 Add seperate defines for OpenAL Soft and MojoAL (#1912) 2025-09-01 01:49:41 -04:00
Joseph Cloutier
4b74794c97 Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-09-01 00:46:55 -04:00
Joseph Cloutier
57355ba8cf Merge branch 'develop' into 8.3.0-Dev 2025-09-01 00:42:57 -04:00
player-03
86283df77e Simplify Timer.stop() (#1839) 2025-09-01 00:36:33 -04:00
Regan Green
c8beb396f6 Implement controller rumble support in Gamepad (#1739)
* Add SDL rumble

* Fix rumble

* whitespace fixins real (#2)

* whitespacing real.. please!

* nativecffi rumble thing fix lol

* Remove trailing whitespace.

* Use SDL's argument names and order.

* Standardize formatting.

* Make `SDLGamepad` fully static again, for simplicity.

Also, consistently use `find()` instead of array access, to avoid accidentally creating entries.

Also also, consistently use guard clauses instead of indenting.

* Make another guard clause.

* Update CFFI function signature.

* Use `clamp()` instead of `if` statements.

* Include required header for `std::clamp()`.

* Revert "Use `clamp()` instead of `if` statements."

`std::clamp()` was not available until C++17, and we'd like to continue supporting older versions.

This reverts commit 715a270f79.

* Revert "Include required header for `std::clamp()`."

This reverts commit f47aebf640.

* Tidy up.

* Document `Gamepad.rumble()`'s arguments.

* Don't limit rumble duration.

SDL apparently supports the full Uint32 range, so there's no reason for Lime to restrict it.

* Fix whitespace.

* Add rumble support in HTML5 (experimental).

---------

Co-authored-by: Cameron Taylor <cameron.taylor.ninja@gmail.com>
Co-authored-by: player-03 <player3.14@gmail.com>
2025-09-01 00:29:58 -04:00
player-03
06c4934f45 Fix old android ndk error not showing (#1926) 2025-09-01 00:23:29 -04:00
player-03
5b05c3f77e Implement onUncaughtError event for thread pools (#1777) 2025-08-31 23:24:14 -04:00
player-03
2bdd41ef57 Memory leak fix in curl bindings (#1856) 2025-08-31 23:20:16 -04:00
player-03
0b1ab0a245 Update tinyfiledialogs to fix compatibility with zenity. (#1964) 2025-08-31 15:07:19 -04:00
Giuppe
e439f0d0ae Allow setting Gradle properties in project.xml (#1859)
* allow setting gradle jvmargs in project.xml

* Make gradle.properties fully configurable from project.xml.

---------

Co-authored-by: Joseph Cloutier <player3.14@gmail.com>
2025-08-31 15:05:03 -04:00
Chris Speciale
2b1a627ed0 Clarify versioning and branching guidelines
Documented semver-based versioning flow
- Explained usage of patch (develop), minor (x.x.x-dev), and major (x.0.0-dev) branches
- Added guidance on where to submit bug fixes, new features, and breaking changes
- Improves contributor clarity and aligns with current project workflow (e.g., Lime 8.2.2 -> 8.3.0-dev, 9.0.0-dev)

This helps reduce confusion about where to submit changes and ensures consistency across releases.
2025-08-31 03:43:19 -04:00
Josh Tynjala
ab132da0fe didn't need to update tools.n
Followup to commit 9b6f81d006
2025-08-25 14:22:43 -07:00
Josh Tynjala
9b6f81d006 Font: add strikethroughPosition and strikethroughThickness
Similar to underlinePosition and underlineThickness
2025-08-25 14:11:47 -07:00
Apprentice-Alchemist
8d81a0fc8e HashLink 1.14 (closes #1827) (closes #1801) (closes #1967)
Co-Authored-By: Josh Tynjala <joshtynjala@users.noreply.github.com>
2025-08-22 15:43:26 -07:00
Rainy
945a2ec8e0 Perform null check for XMLHttpRequest.upload
Some browsers may not support uploading, and accessing upload will return null.
2025-08-20 11:50:17 -07:00
Josh Tynjala
54516f8693 Merge branch 'develop' into 8.3.0-Dev 2025-08-20 07:33:22 -07:00
ACrazyTown
4913ae6626 fix handling of winrt 2025-08-20 00:14:41 +02:00
unknown
75f994afb7 Add seperate defines for OpenAL Soft and MojoAL 2025-08-19 23:41:23 +02:00
Tobiasz Laskowski
d1369f1aaa Fix merge error from 985e0994d9 2025-08-18 18:40:13 +01:00
Tobiasz Laskowski
985e0994d9 Fix unicode system path conversions on linux
For non windows platforms, we previously just passed char* into wstring,
which didn't perform the necessary conversion into utf32 which is
expected when hxcpp converts a wchar string to a hxstring on platforms
where wchar has 4 bytes.
2025-08-18 09:32:28 -07:00
Tobiasz Laskowski
c81d70c303 Fix NULL handling in GetDirectory(DESKTOP)
If HOME is NULL, we cannot return here immediately, since we haven't
called `System::GCExitBlocking()`. This currently causes:
```
Critical Error: Allocating from a GC-free thread
```

This is already handled correctly for `USER` and `DOCUMENTS`, however
`DESKTOP` was missed out in f6e38208d3
2025-08-18 08:41:28 -07:00
Tobiasz Laskowski
cbcb5f029e Fix crash on null returns from sdl path functions
On android SDL_GetBasePath is not implemented and returns NULL, which
means that calling strlen causes a crash:

1f21aae242/src/filesystem/android/SDL_sysfilesystem.c (L35-L40)

According to sdl docs, SDL_GetPrefPath can also return NULL, so we also
need to check for that:
https://wiki.libsdl.org/SDL2/SDL_GetPrefPath#return-value
https://wiki.libsdl.org/SDL2/SDL_GetBasePath#return-value
2025-08-18 08:39:58 -07:00
Tobiasz Laskowski
99e986ce39 Fix typos in mbedtls xml includes 2025-08-15 15:13:38 -07:00
Thomas Cashman
52ad5b1b24 Fix GetDirectory UTF16 encoding issue 2025-08-14 09:43:29 -07:00
Josh Tynjala
a999a7b219 Assets: document getImage() result behavior
Multiple calls to getImage() with the same ID may return a new Image instance on
some targets, but the same Image instance on other targets.
2025-08-11 15:02:49 -07:00
Joseph Cloutier
1e47c4d0be Fix tinyfiledialogs compatibility with zenity. 2025-07-24 15:47:19 -04:00
Josh Tynjala
b9fecd2ab0 IOSHelper: more refinements to selecting a physical device for lime test ios (closes #1957)
Followup to 6f2f88ca74

Now checks for devices with filters in the following order of preference:

1. State == 'connected' AND transportType == 'wired'
2. State == 'connected' AND transportType == 'localNetwork'
3. State == 'available (paired)' AND transportType == 'wired'
3. State == 'available (paired)' AND transportType == 'localNetwork'

Also adds developerModeStatus == 'enabled' filter as a requirement for all checks.

If the app is meant to be iPhone-only or iPad-only, adds the appropriate filter for that too.
2025-07-23 10:32:50 -07: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
player-03
a8407f4f19 Allow adding tags to AndroidManifest.xml from project.xml. (#1814)
* Reduce indentation in `ConfigData`.

* Use more specific return type for `getKeyValueArray()`.

* Reserve "config:" prefix when parsing config data.

* Use new reserved prefix to avoid collisions.

* `ConfigData`: use stored values instead of looking them up repeatedly.

Also, there's no need for `Reflect.hasField()`. We know it has the field, because we're iterating over `Reflect.fields()`.

* Fix extraneous null values in `ConfigData` arrays.

* Simplify control flow.

* Allow adding tags to AndroidManifest.xml from project.xml.

For instance, `<config:android><manifest><uses-permission android:name="xyz" /></manifest></config:android>` will copy the `uses-permission` tag directly into the manifest. This allows you to specify attributes like `android:maxSdkVersion` that aren't normally available.

* Fix `Std.isOfType()` being used in old Haxe versions.
2025-07-13 21:25:33 -04:00
player-03
3c86d2cd39 Simplify logic in createCanvas().
I assume we used `untyped __js__` to get around incomplete externs, but Haxe 3.2 updated the externs, and they've included the second argument ever since.
2025-07-13 21:15:39 -04:00
Joseph Cloutier
e8b031a8a8 Implement ThreadPool.onUncaughtError.
This restores the behavior of `onError` to what it was in 8.1.0.
2025-07-13 20:10:33 -04:00
player-03
112664aa35 Fix deprecation warning. 2025-07-13 19:48:01 -04: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
Josh Tynjala
4be7cc924e FileDialog: if the defaultPath passed to browse() is a directory, fixes issue where parent directory was used as default path instead
Tiny file dialogs seems to choose the parent directory if the path doesn't end with a separator.
2025-06-20 14:04:57 -07:00
unknown
6450e5b2c3 Set some window properties upon creation 2025-06-10 13:17:36 -07:00
Josh Tynjala
0f6f01287a actions: add pip3 to python3 execs that need to be removed 2025-06-09 15:25:52 -07:00
Josh Tynjala
95e63398c8 CommandLineTools: fix ability to specify <haxelib version/> in project with local .haxelib directory
If the version of Lime tools doesn't match the version of Lime specified by <haxelib version/>, and Lime is found in .haxelib, append the -nolocalrepocheck option to avoid redundantly checking for .haxelib again and potentially comparing to a path resolved without accounting for <haxelib version/> yet.
2025-06-05 08:48:56 -07:00
Josh Tynjala
056664da14 Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-06-04 13:51:12 -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