Commit Graph

842 Commits

Author SHA1 Message Date
player-03
13c33d83f4 Start sorting NativeWindow functions.
There's more to sort, but moving them all at once messes up the diff.
2022-08-12 12:32:54 -04:00
player-03
a6323f323f Sort CFFI functions. 2022-08-12 12:27:51 -04:00
player-03
2903975465 Sort functions. 2022-08-12 12:22:27 -04:00
player-03
7b06d6a38a Sort functions. 2022-08-12 12:19:38 -04:00
Apprentice-Alchemist
399c1a3ba7 Missing function bodies. 2022-08-05 15:54:00 +02:00
Apprentice-Alchemist
57ef1223bc Fix typo. 2022-08-05 13:35:27 +02:00
Apprentice-Alchemist
1c8c6c1a5e Implement window transparency. 2022-08-04 22:00:49 +02:00
Chris Speciale
7a9a881b22 Remove TODO
...Unfortunately, after a little bit of testing and a lot more thought and consideration, I've realized there really isn't a way to do this without doubling the allocation. Ouch.
2022-07-28 18:01:10 -04:00
Chris Speciale
4fdaefac23 Add TODO 2022-07-28 17:09:23 -04:00
Justin Espedal
3644549574 Fix NativeHTTPRequest.loadText
Followup to these two commits:
02617a854d
ad3a632927

In the second commit, the buildBuffer call in HTTPRequest was
found to conflict with the way local requests are made, with the
bytes being set directly. So buildBuffer was moved to NativeHTTPRequest
instead. Upon promise completion, now, the value of bytes should always
be correct, and buildBuffer need not be called.

But buildBuffer is called again in NativeHTTPRequest.loadText. For local
requests, this will lead to the same problem that the second commit
fixed (presumably), and for network requests, this leads to the nulled
out buffer being accessed a second time, resulting in a crash.

So since the received value of bytes is already correct and buildBuffer
is harmful, the buildBuffer call is removed from loadText.
Both local and network requests are happy now!
2022-07-22 23:19:46 +09:00
Josh Tynjala
862fe55b1c Preloader: use ObjectMap instead of Map with bytesLoadedCache so that Dynamic can be a key when disable_preloader_assets flag is set 2022-07-20 11:54:21 -07:00
Josh Tynjala
aa1f305f9d project.xml: add <config:air profile=value/> to optionally support custom AIR profiles on run 2022-07-19 11:10:49 -07:00
Joseph Cloutier
dada3e3b0a Document JNI constructors. 2022-07-15 12:36:42 -04:00
Justin Espedal
b4110480c1 Don't set AL.BYTE_OFFSET immediately after calling AL.sourcePlay
The sourcePlay call in NativeAudioSource.play is removed, since
setCurrentTime will always do that itself. Additionally, within
setCurrentTime, sourcePlay was happening before setting the byte
offset for non-streamed sounds.

This appears to fix the problem of sounds playing the first part
multiple times, described here:
https://community.openfl.org/t/sounds-play-twice-on-ios/12163
2022-07-04 12:17:43 +09:00
player-03
b542d62429 Merge pull request #1552 from player-03/JNI_safety
Rename `ForegroundWorker` → `JNISafety`.
2022-06-18 22:20:08 -04:00
Joseph Cloutier
da5704e263 Rename ForegroundWorkerJNISafety.
This change places the focus on the one known use case, while clearing
up potential confusion caused by similar-sounding classes that function
totally differently.
2022-06-18 21:18:02 -04:00
Joseph Cloutier
0fd3144323 Expose more information to project.xml users.
Previously, they could access `${app.file}` and `${config.android}`, but
not `${project.platformType}` or `${config.android.target-sdk-version}`.
Now they can!

I don't know if we want to phase out `${projectDirectory}`, but it's now
an option.
2022-06-14 21:01:07 -04:00
Josh Tynjala
33502b099e Preloader: if disable_preloader_assets is defined, keep the public API available
Ensures that existing custom templates still work
2022-06-14 07:42:30 -07:00
Adam Hojka
17edd0435c [HXCPP][HL] UNICODE fixes (clipboard, window title, file dialogs, paths, font glyphs, ...) 2022-06-10 23:49:54 +02:00
player-03
89158a9b7f Merge pull request #1541 from Stencyl/fix-native-audio-stream-pos
Fix getCurrentTime for streaming native sounds
2022-06-10 13:27:00 -04:00
Justin Espedal
ea4c3716c1 Don't delay music preloading until the packed asset library is loaded 2022-06-10 20:19:50 +09:00
Justin Espedal
9274452766 Display preloader progress for packed asset libraries. 2022-06-10 20:19:46 +09:00
Justin Espedal
8660a189ba Fix getCurrentTime for streaming native sounds
vorbisFile.timeTell() returns the current decoding offset in seconds,
and it's updated each time vorisFile.read() is called. Since data is
buffered by calling vorbisFile.read() multiple times, the associated
time values also need to be preserved in order to get the correct time
offset.

Without this change, getCurrentTime() will return some time in the
future relative to the amount of buffered data.
2022-06-10 13:57:13 +09:00
Josh Tynjala
81d682d355 Window: add new setTextInputRect() method to optionally specify the location of the input when textInputEnabled is set to true
On native, this uses SDL_SetTextInputRect
2022-06-09 14:14:05 -07:00
Joseph Cloutier
f14dfc8462 Work around unreliable clipboard on Linux.
Most likely SDL_waylandvideo.c is to blame, but I don't know enough to
rule out SDL_x11video.c.
2022-06-07 13:36:35 -04:00
Joseph Cloutier
be8fd592a3 Document JNI function arguments. 2022-06-07 12:14:32 -04:00
Joseph Cloutier
14671facef Parse JNI class names more intelligently. 2022-06-07 12:05:50 -04:00
Joseph Cloutier
0e6bfa830b Allow running native apps from other directories.
It isn't always safe to assume `./` is the app directory, and removing
that assumption opens up options.

Requires at least Haxe 3.4, but I don't think Lime supports 3.3 anyway.
2022-06-07 11:47:18 -04:00
Joseph Cloutier
c13f02ef9c Check all asset types if type == null.
According to OpenFL's documentation, `type` is
"The asset type to match, or null to match any type."
2022-06-06 23:07:03 -04:00
Joseph Cloutier
6652a6f7ab Simplify switch statement.
`cast` can handle `null`; no need for a ternary operator.
2022-06-06 23:00:01 -04:00
player-03
238428c7ea Merge pull request #1509 from player-03/icon_priorities
Implement `Icon` priorities.
2022-06-06 01:14:55 -04:00
Joseph Cloutier
ab8003640b Use type hint in findMatch().
Haxe 3 can't deduce the type without it.
2022-06-05 23:49:21 -04:00
Joseph Cloutier
744b476f54 Add acceptSmaller argument.
I finally figured out why `findNearestMatch()` was coded the way it was.
2022-06-05 23:25:56 -04:00
Joseph Cloutier
793aa69ff4 Don't ignore priority argument. 2022-06-05 23:09:07 -04:00
Joseph Cloutier
67e4044abc Merge branch 'develop' into single_threaded_async 2022-06-05 22:42:29 -04:00
Joseph Cloutier
1b310dcc45 Add support for include.hxp.
Note that all paths in an include.hxp file must be absolute.
Fortunately, `Sys.getCwd()` works as expected.
2022-06-05 22:34:07 -04:00
Joseph Cloutier
17232fd7dc Remove trailing whitespace. 2022-06-03 23:14:27 -04:00
Joseph Cloutier
ad3a632927 Only call buildBuffer() when needed.
Turns out, `HTTPRequest`'s call is only needed for internet requests.
Files on the local machine will be loaded directly into `bytes`, leaving
`buffer` empty. Calling `buildBuffer()` will then delete the data.
2022-06-03 23:14:16 -04:00
player-03
2d028bf75f Merge pull request #1534 from player-03/ForegroundWorker
Add thread management tools for Android
2022-06-03 18:25:09 -04:00
Joseph Cloutier
f70b43a543 Explain ForegroundWorker's main use case. 2022-06-03 18:04:32 -04:00
player-03
276a8f6c8a Merge pull request #1517 from Apprentice-Alchemist/feature/update-hashlink
Update hashlink.
2022-06-02 18:34:19 -04:00
Joseph Cloutier
afbd7e15f8 Fix null pointer error in FileDialog.hx.
Co-authored-by: ShaharMS <88977041+ShaharMS@users.noreply.github.com>
2022-06-01 00:15:47 -04:00
Joseph Cloutier
c48f1fb44a Try a different approach to haxe_ver. 2022-05-31 03:00:17 -04:00
Joseph Cloutier
8015148ee0 Fix conditional compilation.
For real this time, definitely, hopefully, maybe.
2022-05-31 02:37:52 -04:00
Joseph Cloutier
894445687e Remove nonexistent function calls.
Earlier Haxe versions just used `EntryPoint`.
2022-05-31 02:31:59 -04:00
Joseph Cloutier
312dd70d72 Never inline ForegroundWorker functions.
The early `return` is incompatible with it.
2022-05-31 02:06:34 -04:00
Joseph Cloutier
6e86e45851 Implement ForegroundWorker. 2022-05-31 01:06:56 -04:00
Joseph Cloutier
7890951d12 Add MainLoop support.
Pros: It's a standard Haxe feature that other Haxelibs may rely on. Plus
it offers built-in thread safety, unlike `onUpdate`.

Cons: It incurs two `mutex.acquire()` calls per frame.
2022-05-30 16:37:43 -04:00
Chris Speciale
02617a854d NativeHTTPRequest: Improve buffer management for O(1) performance
Fixes debilitating issue on Native where buffer creation created an O(n) slowdown
2022-05-27 23:03:14 -04:00
Apprentice-Alchemist
46ad92f11e Why are we still supporting haxe 3? 2022-05-20 08:11:02 +02:00