Commit Graph

595 Commits

Author SHA1 Message Date
player-03
76437a3014 Don't set asset.id to an empty string.
The `Asset` constructor sets `asset.id` to the asset's path, a sensible default. Of course, if the asset has a name instead of a path, we have to use that instead. Or if the user specified an ID, that's even better.

We just don't want to default to `""`, since then a bunch of assets could have the same ID.

Resolves #1758.
2024-02-11 21:18:19 -05:00
player-03
e72db10900 Change "vcruntime.dll" to "vcruntime140.dll" per HashLink's makefile. 2024-02-04 18:00:43 -05:00
player-03
3cbafc4622 Fix filename typo.
Closes #1756.
2024-02-03 22:21:50 -05:00
Josh Tynjala
f8a70444f5 Some missing docs 2024-01-29 12:27:48 -08:00
Josh Tynjala
f2ef5d0082 add comment about cast 2024-01-22 10:43:33 -08:00
Timur
c58013c5e6 Fix "don't know how to cast array" error.
This can happen when compiling HL with `analyzer-optimize`.
2024-01-22 10:43:33 -08:00
player-03
f0aae1f8f2 Correctly check for errors in Haxelib.runProcess().
In safe mode, this function includes its own `try ... catch` block, so we don't need one here. Instead, we need to check if the output is null.
2024-01-21 14:11:51 -05:00
player-03
13865cbbc9 Make better use of getPath().
If you check `paths.exists()` first, then there's no benefit to calling `getPath(id)`: it always just returns `paths.get(id)`. It's more effective to let `getPath()` perform all of its checks.
2024-01-18 14:02:58 -05:00
player-03
558fd0791c Merge pull request #1700 from EliteMasterEric/bugfix/library-get-path
Always use `getPath` instead of `paths.get()` directly.
2024-01-18 13:57:13 -05:00
player-03
40d70d8e53 Use paths.get() when pathGroups was already checked. 2024-01-18 13:56:44 -05:00
player-03
a414f64173 Optimize CI workflow. (#1743)
See pull request for details. Summary:

* Reduce dependencies between CI jobs, allowing more of them to run in parallel.
* Use Linux for as many jobs as possible.
* Merge matching "-ndll" and "-samples" jobs. This way, the latter doesn't have to waste time recreating the former's environment, and the workflow summary is simplified. Downside: this delays package-haxelib.
* Update to a newer macOS version, as the old version massively slowed down Homebrew.
* Skip the HelloWorld test for Mac and iOS, as those two can build slowly under some circumstances, delaying package-haxelib. These could be restored later, if performance seems good enough.
* Add `HAXE_VERSION` environment variable, so future updates will only have to make one change. Unfortunately, doing the same for the Windows/Mac/Linux versions would severely hurt performance, so those remain hard-coded.
* Split up some steps within jobs for better organization.
2024-01-18 13:22:05 -05:00
andrew-git
c40ec312fc Joystick: add try/catch around navigator.getGamepads() because it might throw a JS SecurityError if we don't have permission to call it (#1728)
Fixes the following exception when we don't have permissions:

> Failed to execute 'getGamepads' on 'Navigator': Access to the feature "gamepad" is disallowed by permissions policy.

By catching the exception, it should now behave the same as older browsers, where navigator.getGamepads() doesn't exist at all.

In the future, it might make sense to set a flag if navigator.getGamepads() throws, and skip calling it more than once. However, we may want to listen for some kind of browser event that indicates that permission was granted later, and clear the flag when appropriate. Perhaps the gamepadconnected event?

---------

Co-authored-by: Josh Tynjala <joshtynjala@bowlerhat.dev>
2023-12-01 11:09:34 -08:00
player-03
1a3a9bd5c5 Avoid integer overflow for long sounds.
Multiplying `dataLength * 8` produces a high number, which in the case of very long audio files can exceed the integer limit. Multiplying by 8.0 coerces to float, allowing much higher values.

An alternate solution is to divide first and multiply by 8 second, thus keeping the number from getting too large at any point. However, the purpose of the 8 is to convert `dataLength` from bytes to bits, so it's clearer if those two are close together.
2023-10-19 22:57:43 -04:00
Josh Tynjala
667567f7bd WebAudioContext: add missing resume() field for non-html5 platforms to fix doc gen 2023-09-29 09:31:08 -07:00
UncertainProd
843e7fc873 Removed unused field hello in Float32Array.hx 2023-08-19 22:02:19 +05:30
player-03
3c245b5287 Make replaceVariable() account for properties.
Some useful information is only available as a property, not a field.
2023-08-18 16:20:01 -04:00
Josh Tynjala
987e3dd425 Merge branch 'develop' into 8.1.0-Dev 2023-08-14 15:53:18 -07:00
Josh Tynjala
b6cfc7d812 HTTPRequest: fix missing response data for HTTP status codes (closes #1699)
Backends now return error and response data, but public API has not changed.

This allows OpenFL to expose URLLoader.data on IOErrorEvent.IO_ERROR to match the behavior of Flash
2023-08-11 13:43:16 -07:00
Josh Tynjala
6cff64018a Add -npx flag for lime test electron to run the npx electron command instead of just electron.
This will prompt the user to install electron, if required. Saves a separate `npm install -g electron` command before testing.
2023-07-25 08:43:39 -07:00
EliteMasterEric
3c431559df Always use getPath instead of paths.get() directly. 2023-07-17 14:49:45 -04:00
player-03
828864063f Merge pull request #1694 from loudoweb/dev-fix-library-unload
clear cached files on library unload
2023-07-04 20:31:03 -04:00
player-03
8b27623afb Follow formatting conventions. 2023-07-04 20:30:33 -04:00
player-03
914009ddb3 Merge pull request #1680 from player-03/auto_formatting_error
Fix `WebGL2RenderContext` formatting.
2023-07-04 20:23:40 -04:00
Josh Tynjala
ef37cd9afb AIRHelper: needs .app file extension on macOS if AIR target is bundle 2023-06-29 10:25:38 -07:00
Josh Tynjala
2cd1dad5ed Merge branch 'develop' into 8.1.0-Dev 2023-06-09 11:12:43 -07:00
Josh Tynjala
01a04c4d48 Clipboard: (windows/mac) fix issue where requesting text from clipboard ignores clipboard contents, if user last modified the clipboard before app startup 2023-06-09 10:06:45 -07:00
player-03
71c1854779 Don't call Map.clear() in Haxe 3. 2023-06-06 21:55:37 -04:00
Josh Tynjala
9e2d431e2b Merge branch 'develop' into 8.1.0-Dev 2023-06-06 12:35:57 -07:00
Josh Tynjala
aebf139dc7 Fix window show/hide on desktop being incorrectly considered the same as app going into and out of the background/suspend on mobile
The app's Timers should still continue when a window is hidden. Especially since an app could have multiple windows, with some being shown and some being hidden. If only one were hidden, the other shown windows would clearly behave in a broken manner because the one hidden window would cause all app timers, even those associated with other windows, to be paused.

Introduces new WINDOW_SHOW AND WINDOW_HIDE events from C++ to Haxe, and new onShow and onHide events on Haxe Window.

Followup to 0918ee2381
2023-06-06 10:56:06 -07:00
Ludovic Bas
76c76652cc I don't know why the unload method was empty but now it clears all cached files when calling Assets.unloadLibrary(""); 2023-06-06 15:51:01 +02:00
Josh Tynjala
5a87d77897 Merge branch 'develop' into 8.1.0-Dev 2023-06-05 10:29:26 -07:00
Joshua Granick
35d1436dcd Revert WebAssembly improvements (moved to 8.1.0-Dev branch) 2023-05-30 09:03:18 -07:00
Joshua Granick
305c788ed7 Improve error log on webassembly 2023-05-30 08:53:52 -07:00
Joshua Granick
920eb77db4 Set webassembly, wasm, emscripten in Lime project XML parse 2023-05-30 08:53:25 -07:00
Joshua Granick
2ccee960dc Rename Emscripten target to WebAssembly 2023-05-30 08:53:09 -07:00
Joshua Granick
b410a90121 Print http-server message, allow auto port finding starting at 3000 2023-05-30 08:52:38 -07:00
Joshua Granick
be19381999 Emscripten fixes 2023-05-30 08:46:52 -07:00
Joshua Granick
22abd30209 Improve error log on webassembly 2023-05-23 20:11:28 -07:00
Joshua Granick
6dee2204b0 Set webassembly, wasm, emscripten in Lime project XML parse 2023-05-23 19:51:37 -07:00
Joshua Granick
3dbc73f9ab Rename Emscripten target to WebAssembly 2023-05-23 14:19:32 -07:00
Joshua Granick
a90915cb3f Print http-server message, allow auto port finding starting at 3000 2023-05-20 11:05:47 -07:00
Joshua Granick
eec6e5e0fa Emscripten fixes 2023-05-19 23:10:16 -07:00
Josh Tynjala
4458cefeb2 HTML5Helper: need to chmod +x node when running terser on non-Windows platforms 2023-05-18 14:59:04 -07:00
Josh Tynjala
5424e8562e HTML5Helper: don't display deprecation warnings from Node.js
They are not relevant to our users
2023-05-16 12:55:18 -07:00
Josh Tynjala
571c2bd181 HTML5Helper, similar to -terser, adding -npx for Closure Compiler also uses the npx version instead of the bundled version 2023-05-16 12:50:53 -07:00
Josh Tynjala
763b982bd1 HTML5Helper: use bundled terser, but also add optional -npx flag to use npx version 2023-05-16 12:45:29 -07:00
Josh Tynjala
2dbe108d4e HTML5Helper: option to use terser as JS minifier for html5 target 2023-05-16 10:14:57 -07:00
Josh Tynjala
51c90393fe ProjectXMLParser: avoid exception for directories that don't exist (references #1689)
Calls FileSystem.exists() before FileSystem.isDirectory()
2023-05-16 08:56:43 -07:00
Joseph Cloutier
d43eab44af Fix rest of WebGL2RenderContext indentation.
This all could have been one big change, but the diff view would be very hard to read. Breaking it up like this allows Git to highlight the whitespace changes for you. Otherwise, it would show that 1245 lines were removed and replaced by 1245 new lines, not recognizing that any of those lines match.
2023-05-07 15:39:50 -04:00
Joseph Cloutier
542007680d Fix WebGL2RenderContext indentation up to line 4816. 2023-05-07 15:36:20 -04:00