Commit Graph

7646 Commits

Author SHA1 Message Date
Adrian Wielgosik acdb767862 avm2: Swap Multiname flags to bitflags 2022-09-04 16:56:32 -07:00
Adrian Wielgosik 782f670c39 avm2: Store uninitialized Multinames in txunit, behind Gc 2022-09-04 16:56:32 -07:00
Adrian Wielgosik c28549ed9e avm2: Store multi-namespaces behind Gc And single namespaces directly 2022-09-04 16:56:32 -07:00
EmperorBale dd2bc1ea78
avm2: Add automatic linting for AS3 playerglobals 2022-09-04 16:33:35 -07:00
= ce0752c225 avm1: Removed export of SystemPrototypes and SharedObject 2022-09-04 12:27:29 -07:00
= 6ed1dd5942 avm1: Replace avm1::AvmString with string::AvmString 2022-09-04 12:27:29 -07:00
= ddaee950f8 avm1: Removed all public access into Avm1 modules, export only what's needed 2022-09-04 12:27:29 -07:00
= 7d7309d165 avm1: Moved start_drag from Avm1 root to activation module 2022-09-04 12:27:29 -07:00
= f2c9ae7c50 avm1: Moved root_error_handler from avm1 root to runtime module 2022-09-04 12:27:29 -07:00
= 7645c84980 avm1: Moved skip_actions from avm1 root to runtime module 2022-09-04 12:27:29 -07:00
= 2d24ed539e avm1: Moved Avm1 struct into its own file, fixing field access as needed 2022-09-04 12:27:29 -07:00
Adrian Wielgosik 4707e4b6a8 tests: Add tests for int conversion edge cases 2022-09-04 08:57:18 +03:00
Adrian Wielgosik 9cf6f64d06 avm2: Guarantee that int+/-int makes an int 2022-09-04 08:57:18 +03:00
Adrian Wielgosik cc6abab72f avm2: Remove Value::Unsigned, add minimal implicit int->float conversion 2022-09-04 08:57:18 +03:00
relrelb 3b752cc600 swf: Merge `read_color_transform_no_alpha` into `read_color_transform`
Differentiate between the cases using a new `has_alpha` boolean
parameter.
2022-09-03 13:24:12 -07:00
TÖRÖK Attila 2b681e85b2 avm2: Remove unnecessary `extends Object` from some class stubs
As it's implicit.
2022-09-03 10:43:33 -07:00
TÖRÖK Attila 27b67d01d0 avm2: `Vector` -> `Vector.<Number>` in `ShaderEvent` 2022-09-03 10:43:33 -07:00
TÖRÖK Attila 92a2b6206e avm2: Fix the stub for `Vector` 2022-09-03 10:43:33 -07:00
relrelb 32c55dda22 core: Avoid some clones of `Matrix` and `ColorTransform`
Change `set_matrix` and `set_color_transform` to accept owned structs,
instead of references. This allows callers that already have an owned
struct to pass it directly, thus saving an unnecessary borrow + clone.

This also aligns with other methods, such as `set_sound_transform`,
which currently accepts an owned struct.
2022-09-03 09:36:51 -07:00
TÖRÖK Attila 2e3fad9165 core: Log errors coming from timer callbacks 2022-09-02 22:22:03 -07:00
TÖRÖK Attila 89434d65e8 core: Don't panic when an error occurs in an AVM2 timer callback 2022-09-02 22:22:03 -07:00
TÖRÖK Attila f75eee389a core/mp3: More lenient MP3 buffer underrun detection 2022-09-02 20:38:24 -07:00
relrelb fb39bb2b71 swf: Remove `Copy` from `Rectangle`
Use `.clone()` explicitly where needed.
2022-09-02 18:21:13 -07:00
relrelb 299da43c16 swf: Extract `ShapeFlag` 2022-09-02 18:21:13 -07:00
relrelb efd449dc0d swf: Extract `DefineMorphShapeFlag` 2022-09-02 18:21:13 -07:00
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