Commit Graph

588 Commits

Author SHA1 Message Date
Joseph Cloutier
8bdd93753d Standardize ConfigData's array logic. 2023-12-21 19:52:02 -05:00
Joseph Cloutier
8d3d123266 Add unique parameter to ConfigData.push(). 2023-12-21 17:18:54 -05:00
Joseph Cloutier
15e6dc5050 Remove duplicate code in ConfigData. 2023-12-21 01:14:57 -05:00
Joseph Cloutier
ca3012b877 Convert single to double quotes.
The convention, according to haxe-checkstyle, is to use double quotes unless single quotes are specifically required.
2023-12-20 23:03:02 -05:00
Joseph Cloutier
3cd308a6a8 Convert string literals to constant. 2023-12-20 22:55:25 -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
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
Joseph Cloutier
9c63387e5f Fix WebGL2RenderContext indentation up to line 4661. 2023-05-07 15:35:39 -04:00
Joseph Cloutier
5f7d3170ac Fix WebGL2RenderContext indentation up to line 4533. 2023-05-07 15:34:52 -04:00
Joseph Cloutier
087660f7a7 Fix WebGL2RenderContext indentation up to line 4189. 2023-05-07 15:33:56 -04:00
Joseph Cloutier
3aec2c6a49 Fix WebGL2RenderContext indentation up to line 3847.
Perhaps going a few lines at a time will help Git manage.
2023-05-07 15:32:36 -04:00
Joseph Cloutier
ec20e46dca WebGl2RenderContext: fix some indentation.
If we fix all the indentation at once, it will permanently mess up the diff. Git will see
that the new line 4544 matches the old line 3773, and conclude that it got moved
800 lines down.
2023-05-07 15:24:04 -04:00
Joseph Cloutier
2857016a52 Begin to fix WebGL2RenderContext formatting.
Not removing any tabs yet, to help Git generate diffs.
2023-05-07 15:09:19 -04:00
Josh Tynjala
d299add52d FileDialog: should use #if (!macro && lime_cffi) around calls to NativeCFFI methods, similar to Application 2023-05-03 12:29:38 -07:00