Mike Welsh
2b2346b65e
swf: Add `avm1::Action::End`
...
Returning an `Action::End` instead of `None` when reading the end
of an action.
2022-01-17 21:35:57 -08:00
Mike Welsh
d5862809c7
swf: Remove extraneous ? in avm1::Writer
2022-01-17 21:35:57 -08:00
Mike Welsh
265bcc278a
swf: Add avm1::Writer::write_small_action
...
Convenience method for writing zero-length actions.
2022-01-17 21:35:57 -08:00
Mike Welsh
9141451ca1
swf: Use structs for avm1 `Action` variants
...
Use a struct for all variants of `avm1::Action`.
This makes the style more consistent instead of using a mix of
struct and tuple variants, and allows the data to be easily passed
around.
2022-01-17 21:35:57 -08:00
Adrian Wielgosik
5358940774
avm2: Support basic string.replace
...
Supports:
- string.replace(string, string)
- string.replace(regex, simple_string)
Does not support:
- string.replace(regex, string_with_replacement_codes)
- string.replace(any, function)
2022-01-17 20:10:20 -08:00
relrelb
059c1a3417
web: Add a comment about `ignorePatterns`
2022-01-16 11:07:00 -08:00
relrelb
2f1cb9f655
web: Disallow non-const TypeScript enums
...
They generate unnecessary code.
2022-01-16 11:07:00 -08:00
relrelb
479719f425
web: De-duplicate TypeScript ESLint rules
...
Pull them to the root config, using the `overrides` feature:
https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns
2022-01-16 11:07:00 -08:00
relrelb
5bf8b46ab5
web: Integrate Prettier into Stylelint
2022-01-16 11:07:00 -08:00
relrelb
94d82aa060
web: Convert more files from JSON to YAML
2022-01-16 11:07:00 -08:00
relrelb
d0eb6adbc0
web: Fix `publicPath` when loaded from a CDN
...
CDNs allow omitting the filename:
* https://unpkg.com/@ruffle-rs/ruffle
* https://cdn.jsdelivr.net/npm/@ruffle-rs/ruffle
That caused `currentScriptURL` to be determined incorrectly:
```js
new URL(".", "https://unpkg.com/@ruffle-rs/ruffle ").href
// "https://unpkg.com/@ruffle-rs/ "
```
If the filename is omitted, append a slash to prevent the last
component from being dropped:
```js
new URL(".", "https://unpkg.com/@ruffle-rs/ruffle/ ").href
// "https://unpkg.com/@ruffle-rs/ruffle/ "
```
2022-01-15 14:49:19 -08:00
relrelb
7dad98e3a8
tests: Expand `mcl_getprogress`
2022-01-15 13:08:01 -08:00
relrelb
6ec69dcae1
tests: Expand `mcl_loadclip`
2022-01-15 13:08:01 -08:00
relrelb
3b25a3b901
avm1: Correct `MovieClipLoader.getProgress`
...
Handle strings, numbers and DisplayObject targets.
Return compressed length rather than uncompressed length.
2022-01-15 13:08:01 -08:00
relrelb
eb23f19fad
avm1: Correct `MovieClipLoader.unloadClip`
...
Handle strings, numbers and DisplayObject targets.
2022-01-15 13:08:01 -08:00
relrelb
0da8e504ab
avm1: Correct `MovieClipLoader.loadClip`
...
Handle strings, numbers and DisplayObject targets (not just MovieClips).
To support non-MovieClip targets, turn `clip.as_movie_clip().unwrap()`
to `if let Some(mc) = clip.as_movie_clip()` in `Loader`.
2022-01-15 13:08:01 -08:00
relrelb
e9607cfcbb
chore: Appease clippy
2022-01-15 11:16:24 -08:00
relrelb
eb52cbd770
ci: Publish npm package before packaging selfhosted
...
Otherwise `release.zip` is included in the package files.
2022-01-15 11:15:47 -08:00
relrelb
25722e7abe
avm1: Fix `onLoadInit` event order
...
`onLoadInit` is queued after all `DoAction`s of the loaded clips.
That is, if clip1, clip2, clip3 are loaded in the same frame
(in this order), then actions will be executed as follows:
* `DoAction` of clip3
* `DoAction` of clip2
* `DoAction` of clip1
* `onLoadInit` of clip3
* `onLoadInit` of clip2
* `onLoadInit` of clip1
Previously, those were incorrectly executed as follows:
* `DoAction` of clip3
* `onLoadInit` of clip3
* `DoAction` of clip2
* `onLoadInit` of clip2
* `DoAction` of clip1
* `onLoadInit` of clip1
2022-01-14 17:27:14 -08:00
TÖRÖK Attila
12f9bec194
chore: Bump h263-rs git reference
...
To make use of https://github.com/ruffle-rs/h263-rs/pull/17
2022-01-14 17:09:39 -08:00
Mike Welsh
31443cc9e7
chore: Publish npm package publicly
2022-01-14 16:01:23 -08:00
TÖRÖK Attila
483028707f
web: Add custom profiles to separate the build cache for the two wasm modules
2022-01-13 12:28:00 -08:00
relrelb
5f033743f0
web: Mark packages as private
...
This prevents accidental publication of packages that shouldn't
be published. Some packages were already marked as such, so it's a
bit more consistent.
2022-01-12 21:24:19 -08:00
relrelb
7cffddca97
extension: Fix typo
...
We actually append the build number (the `BUILD_ID` environment variable,
which originates from `github.run_number` in the CI), not the build date.
2022-01-12 21:24:19 -08:00
relrelb
38549fdbdf
web: Publish NPM package
...
Publish nightly releases as part of the CI, so Ruffle can be easily
integrated into a website using a CDN (such as jsDelivr). It would
also be easier for websites to keep up-to-date, as NPM auto-updates
the `latest` tag to refer to the latest release.
A dedicated `package.json` is used for the published NPM package,
because `ruffle-selfhosted` depends on the private `ruffle-core`
package, which shouldn't be published.
Also, the `version` field must monotonically increase. So Webpack
auto-fills it to be `0.1.0-nightly.YYYY.MM.DD`. This format satisfies
a couple of needs:
* Newer nightly releases should take precedence over older ones.
* Stable releases (e.g. `1.0.0`) should take precedence over nightly
ones.
2022-01-12 21:24:19 -08:00
relrelb
3f8f117fd3
web: Convert .eslintrc files from JSON to YAML
...
YAML is shorter, more modern, readable, and flexible than JSON.
In other words, YAML >>> JSON.
Auto-converted using [`yq`](https://github.com/kislyuk/yq ).
2022-01-12 20:10:00 -08:00
Mike Welsh
70bb5fa3f2
extension: Change unsafe-eval to wasm-eval in CSP
...
`unsafe-eval` was needed in the extension Content Security
Policy to Wasm compilation in Chrome.
This CSP setting causes the extension to get flagged in the
Mozilla Add-On Marketplace, which discourages the use of
`unsafe-eval`.
However, Chrome has a `wasm-eval` CSP setting which also allows
extensions to compile Wasm without requiring `unsafe-eval`.
Inject this into the extension manifest when building the Chrome
extension.
Eventually this may change to `wasm-unsafe-eval` as drafted by
the CSP spec and be required by all browsers.
2022-01-12 11:29:36 -08:00
TÖRÖK Attila
db6731be2c
web: Detect and log whether WebAssembly extensions are actually used
2022-01-12 11:29:16 -08:00
TÖRÖK Attila
44e59a0012
web,ci: Only build the vanilla module by default, use it as stand-in for the other
...
And enable the module that really uses WebAssembly extensions for the
releases by running the new "npm run build:dual-wasm" command, which
sets the ENABLE_WASM_EXTENSIONS=true environment variable.
2022-01-12 11:29:16 -08:00
TÖRÖK Attila
ab69c12649
web: Build two WASM modules, with/without extensions, load the appropriate one
2022-01-12 11:29:16 -08:00
relrelb
c4d013c884
ci: Cache npm dependencies
...
This should improve CI build times.
Done as described in:
https://github.com/actions/setup-node#caching-packages-dependencies
2022-01-12 10:30:51 -08:00
relrelb
7f4f40621b
web: Migrate to npm workspaces
...
`lerna` is a bit stale, and as such it currently has some outdated
dependencies which Dependabot warns on.
Fortunately, npm 7 supports monorepos natively, via "workspaces". So
simply replace `lerna` with this feature. The migration is pretty
neat and requires a very little invervention.
Because Node.js 14 comes with npm 6 by default, upgrade it manually
as shown in https://github.com/bahmutov/npm-install/issues/103#issuecomment-931226602 .
2022-01-11 13:17:48 -08:00
dependabot[bot]
50d6b48946
build(deps): bump clap from 3.0.1 to 3.0.6
...
Bumps [clap](https://github.com/clap-rs/clap ) from 3.0.1 to 3.0.6.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.1...v3.0.6 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 00:32:55 -08:00
dependabot[bot]
3eea49ef47
build(deps): bump enum-map from 1.1.1 to 2.0.0
...
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map ) from 1.1.1 to 2.0.0.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags )
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md )
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master )
---
updated-dependencies:
- dependency-name: enum-map
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 00:05:23 -08:00
Mike Welsh
232f1dd120
chore: Appease clippy
2022-01-10 23:37:11 -08:00
dependabot[bot]
8f53449762
build(deps): bump indexmap from 1.7.0 to 1.8.0
...
Bumps [indexmap](https://github.com/bluss/indexmap ) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/bluss/indexmap/releases )
- [Changelog](https://github.com/bluss/indexmap/blob/master/RELEASES.rst )
- [Commits](https://github.com/bluss/indexmap/compare/1.7.0...1.8.0 )
---
updated-dependencies:
- dependency-name: indexmap
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:08:19 -08:00
dependabot[bot]
e459677eaa
build(deps): bump sha2 from 0.10.0 to 0.10.1
...
Bumps [sha2](https://github.com/RustCrypto/hashes ) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/RustCrypto/hashes/releases )
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.10.0...sha2-v0.10.1 )
---
updated-dependencies:
- dependency-name: sha2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:07:50 -08:00
dependabot[bot]
491cc05a79
build(deps): bump syn from 1.0.84 to 1.0.85
...
Bumps [syn](https://github.com/dtolnay/syn ) from 1.0.84 to 1.0.85.
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/1.0.84...1.0.85 )
---
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:07:29 -08:00
dependabot[bot]
426bb56fb9
build(deps): bump clap from 3.0.1 to 3.0.5
...
Bumps [clap](https://github.com/clap-rs/clap ) from 3.0.1 to 3.0.5.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.1...v3.0.5 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:05:12 -08:00
dependabot[bot]
33db3e2d86
build(deps): bump crossbeam-channel from 0.5.1 to 0.5.2
...
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam ) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases )
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md )
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.1...crossbeam-channel-0.5.2 )
---
updated-dependencies:
- dependency-name: crossbeam-channel
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:04:41 -08:00
dependabot[bot]
e5497e3351
build(deps): bump winit from 0.26.0 to 0.26.1
...
Bumps [winit](https://github.com/rust-windowing/winit ) from 0.26.0 to 0.26.1.
- [Release notes](https://github.com/rust-windowing/winit/releases )
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-windowing/winit/compare/v0.26.0...v0.26.1 )
---
updated-dependencies:
- dependency-name: winit
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:04:28 -08:00
dependabot[bot]
807b22eabd
build(deps): bump tinyfiledialogs from 3.8.3 to 3.9.0
...
Bumps [tinyfiledialogs](https://github.com/jdm/tinyfiledialogs-rs ) from 3.8.3 to 3.9.0.
- [Release notes](https://github.com/jdm/tinyfiledialogs-rs/releases )
- [Commits](https://github.com/jdm/tinyfiledialogs-rs/commits/v3.9.0 )
---
updated-dependencies:
- dependency-name: tinyfiledialogs
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 22:04:10 -08:00
relrelb
b39ab9034c
core: Remove `Player::is_mouse_down`
...
Now that `InputManager` tracks the mouse button, it can be used
instead.
2022-01-10 01:18:49 -08:00
relrelb
573aa89c9a
core: Handle mouse events in `InputManager::handle_event`
2022-01-10 01:18:49 -08:00
relrelb
82b4c6ef27
core: Support mouse buttons in `KeyCode`
...
Add `MouseLeft`, `MouseRight` and `MouseMiddle` to `KeyCode` for
AVM1's `Key.isDown()` function.
2022-01-10 01:18:49 -08:00
relrelb
6396c21bc0
core: Rename `PlayerEvent::MouseLeft` to `MouseLeave`
...
So it's not consfusing with `KeyCode::MouseLeft`.
2022-01-10 01:18:49 -08:00
relrelb
c00532aed2
core: Cleanup mouse update logic
...
Move code that is exclusive to mouse events from
`Player::update_mouse_state` to `Player::handle_event`.
2022-01-10 01:18:49 -08:00
Adrian Wielgosik
86210363f0
avm2: Remove Object::derive() machinery for AS3 prototypes
2022-01-09 18:23:10 -08:00
relrelb
b79144c122
avm1: Remove `TextFormatObject::set_text_format`
...
Use `text_format_mut` instead.
2022-01-10 00:26:33 +02:00
Mike Welsh
bb3ef68499
web: Handle gaps in MP3 SoundStreamBlock tags
2022-01-07 13:23:53 -08:00