Aaron Hill
ae452d29b8
avm2: Stub DisplayObject.mask getter/setter
...
This allows the loaded ArmorGames API swf to run in
'This is the only level too'
2022-09-02 17:12:18 -07:00
relrelb
af006a3053
avm1: Introduce `NativeObject`
...
The existing `Object` enum representation is problematic for inherited
native objects, since "regular" `ScriptObject`s cannot be turned into
native objects, but rather a completely new native object needs to be
created. `TObject::create_bare_object` is an attempt to aid this
situation, but it works only for `ActionExtends` inheritance, and not
when the user manually wires up `prototype`/`__proto__` (#701 ).
In Flash, it seems like derived constructors initially have a "regular"
`this` object. But once the `super()` constructor is invoked, the same
`this` object becomes a native object.
To allow this in Ruffle, introduce a new `NativeObject` enum, and
store it as a member in `ScriptObject`. For a start, move `TextFormatObject`
from the `Object` enum to `NativeObject`. The plan is to gradually
move all `Object` enum variants to `NativeObject`, except for `ScriptObject`.
2022-09-02 16:41:27 -07:00
Mike Welsh
c17da6e91a
core: Fix some issues with `hitTest`
...
Fixes some issues with our winding # calculation which would cause
incorrect results for hitTest.
* The convention for handling an intersection at endpoints was
not the same between lines and bezier curves.
* The bezier curve winding # function was not properly handling
some cases where the curve was strictly y-monotonic.
* Simplify the code a bit so that ray-curve intersections are
returned in a consistent order based on upward/downward crossing.
2022-09-02 14:51:46 -07:00
golfinq
08917b49cb
avm2: Add actionscript event classes
2022-09-02 14:35:01 -07:00
TÖRÖK Attila
8bb6e77525
web: Also enable the "reference-types" feature in the build with WASM extensions
2022-09-02 13:36:20 -07:00
Aaron Hill
7a7ea87679
avm2: Implement Sprite.startDrag and Sprite.stopDrag
...
For now, I've left 'dropTarget' unimplemented - unlike in
AVM1, the drop target can be non-interactive objects like `Shape`,
so we'll need additional refactoring to implement it.
This allows 'This is the only level too' to be playable
2022-09-02 13:03:14 -07:00
relrelb
d2a463b08f
core: Remove unused parameter of `MovieClip::show_frame`
2022-09-02 10:42:09 -07:00
relrelb
16a1b7b832
swf: Remove `length` parameter of `read_frame_label`
...
Use `unwrap_or_default()` to optionally read a byte.
Also remove unused `context` parameter of `MovieClip::frame_label`.
2022-09-02 10:42:09 -07:00
relrelb
9ec3137891
swf: Remove `tag_length` parameter of `read_define_button_cxform`
...
It was not needed since `Reader` accounts for it internally.
2022-09-02 10:42:09 -07:00
relrelb
3da3567365
core: Avoid some allocations on JPEG tags
...
Read a slice instead of allocating a new `Vec`.
2022-09-02 10:42:09 -07:00
relrelb
cc166439d8
avm2: `Activation::is_of_type` is infallible
2022-09-02 10:10:40 -07:00
relrelb
ce5bf557f5
avm2: `ExternalValue::from_avm2` is infallible
2022-09-02 10:10:40 -07:00
relrelb
c2e78ffead
chore: Appease clippy
...
Resolve 2 instances of `only_used_in_recursion`.
2022-09-02 10:10:40 -07:00
relrelb
0d6462cfab
render: Remove `gc-arena` dependency
...
It was only used to make structs `#[derive(gc_arena::Collect)]`, and
generally it doesn't make much sense that `render` needs to be GC-aware.
So instead annotate `render` fields in `core` with `#[collect(require_static)]`.
2022-09-02 09:49:18 -07:00
relrelb
696514862d
extension: Migrate to TypeScript 4.8
...
Per https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to ,
`Object.entries()` no longer accepts nullable objects.
The suggested fix is to add a `T extends {}` constraint, but that's
disallowed by https://typescript-eslint.io/rules/ban-types/ . So instead
change the parameter types from `T` to `NonNull<T>`.
2022-09-02 15:58:28 +03:00
dependabot[bot]
43e4e8fb61
build(deps-dev): bump typescript from 4.7.3 to 4.8.2 in /web
...
Bumps [typescript](https://github.com/Microsoft/TypeScript ) from 4.7.3 to 4.8.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases )
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.3...v4.8.2 )
---
updated-dependencies:
- dependency-name: typescript
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 15:58:28 +03:00
dependabot[bot]
667b24a7c8
build(deps-dev): bump eslint from 8.21.0 to 8.23.0 in /web
...
Bumps [eslint](https://github.com/eslint/eslint ) from 8.21.0 to 8.23.0.
- [Release notes](https://github.com/eslint/eslint/releases )
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md )
- [Commits](https://github.com/eslint/eslint/compare/v8.21.0...v8.23.0 )
---
updated-dependencies:
- dependency-name: eslint
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 20:50:44 -07:00
dependabot[bot]
5c27c76cba
build(deps-dev): bump @wdio/cli from 7.20.1 to 7.24.0 in /web
...
Bumps [@wdio/cli](https://github.com/webdriverio/webdriverio ) from 7.20.1 to 7.24.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases )
- [Changelog](https://github.com/webdriverio/webdriverio/blob/v7.24.0/CHANGELOG.md )
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.20.1...v7.24.0 )
---
updated-dependencies:
- dependency-name: "@wdio/cli"
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 16:55:47 -07:00
dependabot[bot]
596263b4d6
build(deps-dev): bump @types/chrome from 0.0.188 to 0.0.196 in /web
...
Bumps [@types/chrome](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chrome ) from 0.0.188 to 0.0.196.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases )
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chrome )
---
updated-dependencies:
- dependency-name: "@types/chrome"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 16:33:16 -07:00
dependabot[bot]
31d4a5ff88
build(deps-dev): bump @wdio/static-server-service in /web
...
Bumps [@wdio/static-server-service](https://github.com/webdriverio/webdriverio ) from 7.20.7 to 7.24.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases )
- [Changelog](https://github.com/webdriverio/webdriverio/blob/v7.24.0/CHANGELOG.md )
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.20.7...v7.24.0 )
---
updated-dependencies:
- dependency-name: "@wdio/static-server-service"
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 15:49:12 -07:00
dependabot[bot]
599b1ad35e
build(deps-dev): bump webpack-dev-server from 4.9.3 to 4.10.1 in /web
...
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server ) from 4.9.3 to 4.10.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases )
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md )
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.9.3...v4.10.1 )
---
updated-dependencies:
- dependency-name: webpack-dev-server
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 15:35:39 -07:00
dependabot[bot]
a6c27bcefb
build(deps-dev): bump @wdio/local-runner from 7.19.5 to 7.24.0 in /web
...
Bumps [@wdio/local-runner](https://github.com/webdriverio/webdriverio ) from 7.19.5 to 7.24.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases )
- [Changelog](https://github.com/webdriverio/webdriverio/blob/v7.24.0/CHANGELOG.md )
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.19.5...v7.24.0 )
---
updated-dependencies:
- dependency-name: "@wdio/local-runner"
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 14:46:09 -07:00
dependabot[bot]
dd96e30666
build(deps-dev): bump @typescript-eslint/parser in /web
...
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser ) from 5.32.0 to 5.36.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases )
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md )
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.36.1/packages/parser )
---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 14:21:41 -07:00
dependabot[bot]
b9df9cf04f
build(deps-dev): bump stylelint-config-standard in /web
...
Bumps [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard ) from 26.0.0 to 28.0.0.
- [Release notes](https://github.com/stylelint/stylelint-config-standard/releases )
- [Changelog](https://github.com/stylelint/stylelint-config-standard/blob/main/CHANGELOG.md )
- [Commits](https://github.com/stylelint/stylelint-config-standard/compare/26.0.0...28.0.0 )
---
updated-dependencies:
- dependency-name: stylelint-config-standard
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 23:12:15 +03:00
Daniel Jacobs
d9da45d0f2
web: Don't show loading bar when wasm Content-Length does not exist
2022-09-01 21:43:53 +03:00
Aaron Hill
cc9e283191
avm2: Improve Debug impl for EventObject
2022-08-30 09:35:20 -05:00
Aaron Hill
3417dceca2
ci: Cache Cargo output on Github Actions
...
Co-authored-by: Mike Welsh <mwelsh@gmail.com>
2022-08-30 00:53:33 -07:00
Aaron Hill
1a7c5339a7
avm2: Implement DisplayObject.localToGlobal and DisplayObject.globalToLocal
...
While writing tests for these methods, I discovered and fixed some
issues with how 'scrollRect' interacted with 'dobj.transform.matrix'
2022-08-29 23:12:40 -05:00
relrelb
3645061910
core: Simplify `DisplayObjectContainer::highest_depth`
...
The `less_than` parameter remained just `Depth::MAX` since #7199 ,
which makes it useless. As such it can be removed.
2022-08-29 17:26:15 -06:00
Aaron Hill
e9697439de
avm2: Skip over holes during array enumeration
...
This brings us closer to matching the Flash Player
enumeration behavior. Unfortunately, the precise enumeration
order for ScriptObject properties depends on the precise
order in the internal avmplus hashmap. This order is deterministic,
but adding/removing a property effectively randomizes it. Hopefully
there aren't any SWFS that depend on the *exact* order.
2022-08-29 15:53:44 -07:00
dependabot[bot]
4831640471
build(deps): bump cpal from 0.13.5 to 0.14.0
...
Bumps [cpal](https://github.com/rustaudio/cpal ) from 0.13.5 to 0.14.0.
- [Release notes](https://github.com/rustaudio/cpal/releases )
- [Changelog](https://github.com/RustAudio/cpal/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rustaudio/cpal/commits )
---
updated-dependencies:
- dependency-name: cpal
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-29 15:15:14 -07:00
dependabot[bot]
33cc87ce27
build(deps): bump clap from 3.2.17 to 3.2.18
...
Bumps [clap](https://github.com/clap-rs/clap ) from 3.2.17 to 3.2.18.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.18/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.17...v3.2.18 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 00:19:02 +03:00
dependabot[bot]
802de0e7d1
build(deps): bump futures from 0.3.23 to 0.3.24
...
Bumps [futures](https://github.com/rust-lang/futures-rs ) from 0.3.23 to 0.3.24.
- [Release notes](https://github.com/rust-lang/futures-rs/releases )
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.23...0.3.24 )
---
updated-dependencies:
- dependency-name: futures
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-29 23:38:43 +03:00
nosamu
c5c619abbd
web: Correct IANA Flash MIME type
2022-08-29 02:49:23 -07:00
nosamu
4dc446825b
extension: Check more thoroughly for SWF filenames and MIME types
2022-08-29 02:49:23 -07:00
nosamu
c83ae114b2
web: Move MIME type check to its own function
2022-08-29 02:49:23 -07:00
Toad06
c4e64c5e26
avm1: Function calls in SWF4 bump the version to 5
2022-08-29 02:17:09 -07:00
TÖRÖK Attila
e86efd5c63
avm2: Add flash.utils.[set|clear][Timeout|Interval](...)
2022-08-29 01:44:57 -07:00
relrelb
5c29da6707
avm1: Implement `MovieClip.scrollRect`
...
The core functionality and AVM2 bindings were implemented in #7739 .
2022-08-28 22:18:33 -07:00
=
f180183ec5
core: Add audio feature, made dasp optional
2022-08-28 21:10:05 -07:00
=
c6c22cebc9
core: Make nellymoser optional, enable on desktop and web
2022-08-28 21:10:05 -07:00
=
f5245d72da
core: Make core not use minimp3 by default - only desktop uses it
2022-08-28 21:10:05 -07:00
Daniel Jacobs
29bdd138d5
web: Don't add debug info to context menu in insecure context
...
It won't work anyway, since the Clipboard API doesn't work in insecure contexts.
2022-08-28 20:18:46 -07:00
relrelb
81f803d77e
avm1: Remove `DisplayObject::prev_avm1_clip`
...
It is no longer needed.
2022-08-28 19:21:03 -06:00
relrelb
de6163569e
avm1: Simplify frame execution logic
...
Handle removed clips inline in `Avm1::run_frame`, such that
`DisplayObject::prev_avm1_clip` is no longer used. Thus it can be
removed in a follow-up commit.
2022-08-28 19:21:03 -06:00
relrelb
0b7d8ea007
avm1: Move frame lifecycle logic to `Avm1::run_frame`
...
This allows better encapsulation of AVM1.
2022-08-28 19:21:03 -06:00
Aaron Hill
397de91a2a
core: Do not run sounds on no-op goto.
...
When we run a 'goto' where the initial and target frame are the same,
we need to skip triggering any sounds in the target frame.
Some games like 'This is the only level too' rely on this behavior:
they repeatedly run 'movieClip.gotoAndStop(current_frame_id)',
where 'current_frame_id' is the id of a frame that starts playing
a sound. Without this change, the sound will restart every frame
intead of playing exactly once.
2022-08-28 18:55:29 -06:00
David Wendt
e353553835
core: When reporting errors in the AVM2 constructor from MovieClip, also report the name of the class being constructed.
2022-08-28 18:17:57 -06:00
David Wendt
4de46562ca
tests: Add a test for class singleton properties.
2022-08-28 17:54:22 -06:00
David Wendt
4b9ee55b56
avm2: The failsafe for self-referencing class properties should allow the use of `null` and `undefined`.
2022-08-28 17:54:22 -06:00