Skip to content

merge 8.4.0#2064

Merged
dimensionscape merged 44 commits into
developfrom
8.4.0-dev
May 14, 2026
Merged

merge 8.4.0#2064
dimensionscape merged 44 commits into
developfrom
8.4.0-dev

Conversation

@dimensionscape
Copy link
Copy Markdown
Member

No description provided.

player-03 and others added 30 commits August 5, 2025 03:35
Compared to `new Future()`, this offers:

- The option to run on the main thread.
- The option to send progress events.
- The ability to interrupt the job by calling `promise.error()`.
Having eight separate implementations made it harder to maintain. While an asset embedding bug got fixed on desktop targets, it got overlooked on others. This lead to assets being included twice on those other targets: once embedded, and once normally. (#1898) Now, that behavior is controlled from one place, and the bug is fixed for eight targets at once.

This also standardizes the case of `asset.embed == true && asset.type == TEMPLATE`. Previously, some targets would prioritze `embed` over `type`, embedding the template into the app without even processing it as a template. Now, it will always prioritize `type`, processing templates as templates and never trying to embed them.

Three targets are left out since they have more complex asset embedding behavior. I haven't checked if the bug is present on any of those.
The old code appeared to be trying to do this, but it didn't work. When it found appinfo.json, it would call `copyAsset()` with an extra `context` argument, which is what you do for templates. However, `copyAsset()` only processes templates when `type == TEMPLATE`, otherwise it ignores the extra argument and processes it as a normal asset.
The implementation was copy-pasted, so it makes more sense to have only a single copy. `HTML5Platform` added a comment about possible future changes, so I kept that. Future changes will still be possible by overriding the function.
All of the implementations were identical, except for `FlashPlatform`, which was identical with extra steps.
Two reasons:

1. This is how it always worked in practice. The old special case actually did nothing due to an oversight.
2. Per the principle of least astonishment, Lime should avoid messing with the user's assets. If they wanted it to be a template, they would have specified `type="template"`.
Haxe will usually prevent `EventMacro.build()` from running if there are the wrong number of type params. Therefore the "wrong number" message would usually only appear when there were the right number of params (one) and the type was wrong.
Allows us to use sdl_sound to decode extended audio formats
Seems my toddler got her little hands on my keyboard!
* Implement Window.alwaysOnTop

* Add property to Flash/Air/HTML5

* js property

* Follow existing naming convention.

---------

Co-authored-by: player-03 <player3.14@gmail.com>
… build air -android to create non-apk packages

Consolidate file extension selection into AIRHelper.build() too, since it depends on which target is selected now
* 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.
joshtynjala and others added 14 commits February 2, 2026 09:14
…ecture/> values

We somewhat recently added these strings as command line options as alternatives to -64 and -32, so we might as well support them as strings in project.xml too.
Expose SDL_sound streaming to the engine and update related plumbing.

- Add SDLSound streaming API (SDLSoundStreamInfo / SDLSoundStream) and functions: GetStreamInfo, OpenStream, ReadStream, RewindStream, SeekStream, CloseStream.
- Implement robust SDL_sound handling in SDLSound.cpp: sample creation, buffer alignment, prepare/resize logic, better error reporting, and streaming decode paths.
- Add SDLSoundBindings.cpp: CFFI/Haxe/HL bindings to work with SDL_sound streams (get info, open stream from bytes/file, read, seek, rewind, clear).
- Register new native CFFI functions in NativeCFFI.hx (regular and HL variants) and add CFFI callables.
- Extend AudioBuffer with fields for SDL sound sources and new helpers: fromBytesStream / fromFileStream and internal SDLSound metadata handling.
- Enhance NativeAudioSource to support SDL_sound streaming: open/reset/clear stream, buffer alignment, queue management, reading stream data and seeking; integrate with existing Vorbis streaming logic.
- Add TryResize API to Bytes and ArrayBufferView and update usages to avoid unnecessary allocations and handle OOM safely.
- Add SDLSoundBindings.cpp to project Build.xml and check Sound_Init() result during SDL init.

These changes enable streamed playback of compressed audio via SDL_sound (bytes or file), improve memory handling during decoding, and expose the required native bindings to Haxe/HL runtimes.
Bump haxelib to 8.4.0 and add a lime_sdl_sound define. Treat SDL sound resources without a reported duration as valid streams in SDLSound.cpp. Refactor NativeAudioSource to reuse a read buffer/UInt8Array, return byte counts from read functions, and support streaming sources with unknown length (dataLength == -1). Add streamExhausted tracking and related logic to stop/complete playback correctly, improve refill and playback-restart checks, and adjust timer behavior to compute length from streamed data when needed. These changes reduce allocations and fix playback/completion for SDL-based streamed audio.
Add Ogg Vorbis streaming support and robust resource management: introduce vorbisStream and ownsVorbisStream in NativeAudioSource, with clear/open/reset helpers and stream-seeking handling; ensure refill/stream timers and buffer queuing handle null/edge cases. Add __isDisposed and Vorbis source fields to AudioBuffer, provide __fromVorbisSource helper and mark/clear sources on dispose. Make AssetLibrary/Assets skip and evict disposed AudioBuffer instances from caches. Fix Bytes.cpp mutex logic to correctly track/erase usingValue/hadValue and avoid incorrect frees. Misc small safety checks and null guards related to streaming and buffer reads.
Missing fields added for SDL_sound in commits 7389eb0 and 6812fa2
@dimensionscape dimensionscape merged commit a0534ff into develop May 14, 2026
26 checks passed
@player-03
Copy link
Copy Markdown
Contributor

Whoops! Looks like #2005 overwrote some changes from #1980. I'll check if that can be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants