Commit Graph

8394 Commits

Author SHA1 Message Date
EmperorBale 158de01c92 avm2: `goto_frame` should use the movieclips scene by default 2023-02-17 18:46:43 -08:00
Aaron Hill 071306f107 avm2: Also register EventDispatcher methods in ns "flash.events:IEventDispatcher"
This is needed by "Steambirds: Survival"
2023-02-17 20:32:27 -06:00
EmperorBale bc165a81ff chore: Add comment explaining why we skip the first scope 2023-02-18 01:37:12 +01:00
EmperorBale 46bd6bbee9 tests: Add test for scopechain resolution order 2023-02-18 01:37:12 +01:00
EmperorBale 7ef56c1d16 avm2: Search global scope after everything else 2023-02-18 01:37:12 +01:00
CUB3D f7b0c021a9 avm1: The this property should be mutable 2023-02-17 14:39:10 -06:00
Aaron Hill 4149913967
core: Introduce dedicated avm2 mouse picking logic (#9565)
The mouse picking behavior in AVM2 interacts in complicated
ways with `mouseEnabled` and `mouseChildren.` It's sufficiently
different from AVM1 that I decided to split the logic into separate
`mouse_pick_avm1` and `mouse_pick_avm2` methods.

The `mouseChildren` property is now fully implemented.
Additionally, the `click_block` tests now work correctly
under Ruffle.

Combined with the orphan-movie PR, this is enough to make
SteamBirds fully playable (though performance greatly degrades
over a course of a level).
2023-02-17 19:04:52 +00:00
relrelb 90082e4658 ci: Refactor activity check
Use a GitHub output parameter, rather than an environment variable,
as described in:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
2023-02-17 14:25:25 +02:00
Lord-McSweeney 559ec8356d
Port Video to Actionscript 2023-02-16 22:46:11 +02:00
nosamu 15435c6bea desktop: Support `file` URLs 2023-02-16 19:46:16 +02:00
relrelb a7235febea core: Use unnamed field in `Character::Bitmap`
Since `initial_data` was removed from `Character::Bitmap` in #9143,
it now holds a single field. Move back to an unnamed field, which
aligns with the other `Character` enum variants.
2023-02-16 19:02:57 +02:00
renovate[bot] 43628fdef5 fix(deps): update rust crate winit to 0.28.1 2023-02-16 18:11:12 +02:00
TÖRÖK Attila c9864bbeb4 tests: Require the "mp3" feature of core as well, just to be sure. 2023-02-16 06:23:35 +01:00
TÖRÖK Attila 77cfb5ab4c core: Fix a clippy lint when building without the "mp3" feature. 2023-02-16 06:23:35 +01:00
TÖRÖK Attila 0e1bddff65 tests: Fix build when running from inside the `tests` folder. 2023-02-16 06:23:35 +01:00
David Wendt cc7d160d07 web: Automatically inject plugin-polyfill.ts into content.ts as a string.
The prior version of this code used a hardcoded copy of the script. Not only is this an outdated version of the code, this also caused us to fail our addons.mozilla.org audit.
2023-02-15 21:27:14 -07:00
David Wendt efc6254366 web: Build a separate plugin polyfill target file.
A future commit will add a mechanism to inject this into `content.ts` in lieu of the old copy of this file.
2023-02-15 21:27:14 -07:00
David Wendt 85f544a6cc web: Break out all the Flash identifier strings into a separate module and make `plugin-polyfill.ts` only import that. 2023-02-15 21:27:14 -07:00
Aaron Hill 4e25a4fcae avm1: Add ignored test for strange rewind behavior
Ruffle doesn't correctly remove certain objects from the stage
when processing an AVM1 rewind goto.
2023-02-15 15:21:29 -06:00
David Wendt e6b9eb7df9 web: Extension build needs to seal the Firefox extension ID. 2023-02-14 18:49:58 -07:00
EmperorBale 1e12f2d49b tests: Add test for finddef opcode 2023-02-14 14:22:02 -08:00
EmperorBale 0ffdef48ab avm2: Implement `finddef` opcode 2023-02-14 14:22:02 -08:00
nosamu e68cb433b2 desktop: Support flashvars passed via URL parameters 2023-02-14 23:05:22 +01:00
TÖRÖK Attila 35e21ce51d tests: Add a regression test for SoundMixer.computeSpectrum() 2023-02-14 18:47:33 +01:00
TÖRÖK Attila 4d0fee0cf8 tests: Add TestAudioBackend, used only on request 2023-02-14 18:47:33 +01:00
Nathan Adams eb35d6217b avm2: DoAbc (72) seems to imply lazy loading 2023-02-14 08:51:45 +01:00
Nathan Adams 94fdc8bdb5 avm2: Support older DoAbc tag (72) 2023-02-14 08:51:45 +01:00
Nathan Adams f2acb7c230 swf: Added DoAbc2 tag 2023-02-14 08:51:45 +01:00
Nathan Adams 69f93f926e swf: Rename DoAbc to DoAbc2 2023-02-14 08:51:45 +01:00
Adrian Wielgosik 5eb887c628 avm2: Stub describeType to have .@name work 2023-02-13 23:55:00 +01:00
Nathan Adams a4fc39efcd avm2: Copy Regexp methods to the Regexp prototype 2023-02-13 21:31:46 +01:00
Nathan Adams 899635f658 avm2: Copy Array methods to the Array prototype 2023-02-13 21:31:46 +01:00
Aaron Hill a52a41de97 core: Fix stageX and stageY getters for MouseEvent
These getters were previously calling `local_to_global`
with the unused localX/localY coordinate set to 0. Howver,
`local_to_global` does a matrix multiplication, which in general
will depend on both the x and y values. This was causing the getters
to return incorrect results when any of the `transform.matrix` values
included a non-diagonal matrix.

We now call `local_to_transform` with the real `localX` and `localY`
values.
2023-02-13 21:19:20 +01:00
Nathan Adams 081387e047 avm2: Stub TouchEvent 2023-02-13 05:35:18 +01:00
renovate[bot] a27bd66b58 fix(deps): update rust dependency patches 2023-02-13 04:59:31 +01:00
Aaron Hill c597f9f996 core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
Nathan Adams d6abf24a81 chore: Update docs andf actions to wasm-bindgen-cli 0.2.84 2023-02-13 02:57:52 +01:00
renovate[bot] fed24aa243 fix(deps): update rust dependencies - wasm-bindgen related 2023-02-13 02:57:52 +01:00
Nathan Adams 4cb22d6d9d chore: Bundle wasm-bindgen and wasm-bindgen-futures updates together in renovate PRs 2023-02-13 01:07:55 +01:00
Lord-McSweeney b848ab6860 Fix stub in DisplayObjectContainer
In mouse_children
2023-02-13 00:42:28 +01:00
Lord-McSweeney eb7a96f55b Fix stub types in security.rs
Change from avm2_stub_getter to avm2_stub_method
2023-02-13 00:42:28 +01:00
Adrian Wielgosik 561e118ffe avm2: Export private traits normally, remove private_trait_scripts hack 2023-02-12 17:49:14 +01:00
Adrian Wielgosik f717b99599 avm2: Compare private namespaces by pointer. Refactor rust-avm field sharing. 2023-02-12 17:49:14 +01:00
Adrian Wielgosik e0e653e463 avm2: make Namespace a GC type 2023-02-12 17:49:14 +01:00
Aaron Hill 4e0dce2efa core: Make SandboxType configurable, and set to 'remote' on web
The Newgrounds API checks `Security.sandboxType` to see if it should
run in debug mode or not (which determines whether or not medals
can actually be unlocked).

For now, desktop continues to use `localTrusted` as the default,
while web now uses `remote`. We might want to make this configurable
at some point, but this should be good enough for now (and better
match Flash's behavior).
2023-02-11 14:44:11 -06:00
Aaron Hill 9bce6b78d5 core: Queue up Sound and SoundChannel methods during loading
Flash supports calling `Sound.play`, `SoundChannel.stop`, and
`SoundChannel.soundTransform` while a sound load is in progress
(e.g. immediately after calling `Sound.load`).

To support this, we queue up information inside `SoundObject`
and `SoundChannelObject` when a load is in progress. When a load
completes, we trigger any queued `Sound.play` and `SoundChannel.stop`
calls, and apply the most recent `SoundChannel.soundTransform`
2023-02-11 11:53:56 -06:00
Aaron Hill 51fe1e9754 core: Handle `DirtyState::CpuModified` in `overwrite_cpu_pixels`
If we're going to overwrite the CPU pixels with the result of a
GPU operation, make sure the GPU texture is up to date with the
latest CPU pixels. I've also renamed the method to
`overwrite_cpu_pixels_from_gpu` to better reflect how it should
be used.
2023-02-11 11:37:00 -06:00
Bale 73e9fd55fb
avm2: Make sure scripts get initialized after all scripts have been loaded when lazy init is disabled (#9478)
* avm2: Initialize scripts **after** all scripts have been loaded

* tests: Add test for eager initialization
2023-02-11 00:38:38 +00:00
Aaron Hill 4b76d1b32a
core: Support using URLVariables as a POST request body (#9489)
This is needed by the Newgrounds API. We don't have the ability
to make fake requests to HTTP urls in our test frameworks,
so I haven't added any tests for this. However, I tested locally
that this allows the Newgrounds API to work (and got a medal
in Cloud Wars).
2023-02-11 00:18:10 +00:00
nosamu a2cd3ee06e tests: Update fills_and_lines expected image 2023-02-10 23:43:01 +01:00