Commit Graph

4816 Commits

Author SHA1 Message Date
EmperorBale 0ffdef48ab avm2: Implement `finddef` opcode 2023-02-14 14:22:02 -08: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 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
renovate[bot] fed24aa243 fix(deps): update rust dependencies - wasm-bindgen related 2023-02-13 02:57:52 +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 c1fe3ded25 chore: remove unnecessary FromStr impl for LoadBehavior 2023-02-10 00:56:17 -08:00
nosamu 1a65a0942c desktop: Add --letterbox option 2023-02-09 23:43:25 -08:00
EmperorBale e7612f571d avm2: Implement ScopeChain caching 2023-02-09 10:51:12 -08:00
golfinq 37ec94f95b Avm2: Implement Stage.invalidate 2023-02-08 17:47:21 -07:00
Aaron Hill a818dd0918 core: Use colorTransform in DisplayObject.setTransform 2023-02-08 20:56:46 +01:00
Adrian Wielgosik 61a5161a20 avm2: Convert most errors in get/set/initproperty to AVM errors 2023-02-07 18:50:15 -06:00
Adrian Wielgosik c844d2ab6f avm2: Only store actually-passed arguments to 'arguments' 2023-02-07 18:35:30 -06:00
Nathan Adams ac9b6e3ecb avm2: Mark Dictionary(true) and TimerEvent.updateAfterEvent() as stubs 2023-02-07 20:34:59 +01:00
Nathan Adams e5f44b0f05 avm2: Replaced stubs in actionscript with new stub system 2023-02-07 20:34:59 +01:00
Nathan Adams bdbf54ecd4 core: Added ability to mark stubs inside actionscript 2023-02-07 20:34:59 +01:00
Nathan Adams dff558170e avm2: Implement BitmapData.getPixels() 2023-02-07 19:10:25 +01:00
Nathan Adams 25cc6f3243 avm2: Change MovieClip::frame_scripts to Vec<Option<Avm2Object>>, where index is frame num 2023-02-07 18:26:27 +01:00
Nathan Adams 43d9c3deed avm2: Make sure SoundChannel.soundTransform always returns a value 2023-02-07 18:26:27 +01:00
Nathan Adams bc7773596b avm2: addFrameScript allows null to unset the script, and only allows one script per frame 2023-02-07 18:26:27 +01:00
CUB3D 48f4df51a5 avm1: Correct depth calculation for AVM1 clips pending removal and add tests 2023-02-06 10:53:45 -07:00
CUB3D 2d11a250da avm1: Retrieving the child of a container should prioritise lowest depth 2023-02-06 10:53:45 -07:00
CUB3D a356be15fe avm1: Only delay removals on AVM1, check for dynamic unload handlers 2023-02-06 10:53:45 -07:00
CUB3D 755425ebfa avm1: Delay clip removals when a child has an unload listener
When removing a clip, first check if it has an unload event listener somewhere
it's hierarchy.
If it does, enqueue the removal to happen on the next frame, by moving it to a negative depth.
2023-02-06 10:53:45 -07:00
Nathan Adams 50fd7aeff5 core: Add quality options to the context menu 2023-02-06 16:08:04 +01:00
Nathan Adams a220703618 core: Made PlayerBuilder take quality instead of setting it after the Player was made 2023-02-06 16:08:04 +01:00
Nathan Adams d8e924affc render: Add RenderBackend::set_quality method, and call it from core 2023-02-06 16:08:04 +01:00
Nathan Adams 12bd38b338 core: Changed Player::set_quality to take in a StageQuality directly 2023-02-06 16:08:04 +01:00
Nathan Adams b270d1bbd7 render: Move StageQuality from core to render 2023-02-06 16:08:04 +01:00
Nathan Adams 00c7e8f634 avm2: Fixed bytearray compress/decompress methods setting position of resulting bytearray 2023-02-05 19:22:01 +01:00
Nathan Adams e798d69299 avm2: Convert ByteArray EOF to avm error 2023-02-05 19:22:01 +01:00
Nathan Adams c14f022837 core: Use overwrite_cpu_pixels in apply_filter 2023-02-05 18:41:43 +01:00
Nathan Adams 7476b3b0e0 avm2: Added a bunch of missing filter classes 2023-02-05 18:41:43 +01:00
Nathan Adams 42f3ee923f avm2: Mark unsupported filters as stubs 2023-02-05 18:41:43 +01:00