Commit Graph

8869 Commits

Author SHA1 Message Date
Tom Schuster c0400af1de avm2: Implement XML.copy 2023-03-29 11:04:32 -05:00
Aaron Hill cdba704b4b avm2: Construct Activation with Domain when setting named child 2023-03-29 09:27:34 -05:00
relrelb b0eb1057f1 web: Run `npm run format` 2023-03-28 23:43:02 +03:00
renovate[bot] a7ffae1453 chore(deps): lock file maintenance node.js dependencies 2023-03-28 23:43:02 +03:00
Nathan Adams 42e23ce100 tests: Add tests for LoaderInfo properties that error 2023-03-28 11:57:00 +02:00
Nathan Adams 3a49870689 avm2: Fix errors in LoaderInfo and stubbed remaining properties 2023-03-28 11:57:00 +02:00
nosamu e19f63c3c6 web: Small CSS fixups for save manager 2023-03-28 10:37:59 +03:00
TÖRÖK Attila 05e2b4c729 avm2: Stub Video.deblocking and Video.smoothing 2023-03-28 10:20:29 +03:00
TÖRÖK Attila 72802de20e nit: Fix typo: "recieve" -> "receive" 2023-03-28 10:06:08 +03:00
renovate[bot] 5052e942b5 chore(deps): lock file maintenance rust dependencies 2023-03-28 09:31:15 +03:00
Lord-McSweeney eacb4498fb web: Fix XML document detection 2023-03-28 09:13:10 +03:00
Toad06 9c37c9cd34 core: Correct `swapDepths` 2023-03-28 00:24:48 -05:00
Adrian Wielgosik 4e84632609 avm2: Fix edge cases in RegExp constructor 2023-03-27 19:09:09 -05:00
Ikko Eltociear Ashimine fc4b51b20f chore: fix typo in display_object.rs
defualt -> default
2023-03-27 20:54:16 +03:00
Mike Welsh 87dad709b8 tests: Add test for `SharedObject.clear` 2023-03-26 22:22:27 -05:00
Mike Welsh a7bd3737a6 avm2: Implement `SharedObject.clear` 2023-03-26 22:22:27 -05:00
Mike Welsh 74b2ff6997 swf: Inline `Color` methods 2023-03-26 18:20:15 -07:00
Mike Welsh df5f5451f4 swf: Inline `Point` methods 2023-03-26 18:20:15 -07:00
Mike Welsh 49ea1b0f36 swf: Inline `Twips` methods 2023-03-26 18:20:15 -07:00
Aaron Hill 1f22f868a0 tests: Use antiAlias=4 in Stage3D tests
This is the only antialiasing level supported by Mesa lavapipe,
which we use to run our tests on CI.
2023-03-26 18:05:41 -07:00
Aaron Hill a52cb7461e wgpu: Implement MSAA support for Stage3D
When we receieve a nonzero 'antiAlias' parameter, we create
create a non-multisampled resolve buffer to use with WGPU.

Several tests were already requesting antialiasing, so their
output images are now anti-aliased without any changes to
the tests themselves.
2023-03-26 18:05:41 -07:00
Aaron Hill 1a352aa453 avm2: Implement ApplicationDomain constructor and fix parent handling
Previously, the `ApplicationDomain` constructor ignored its argument,
instead of constructing a new domain with the specified domain as
the parent.

Additionally, we were incorrectly executing code with
`Activation::from_nothing` in several places, causing
`ApplicationDomain.currentDomain` to return the system domain
instead of the correct parent domain. I've introduced a new method
`Activation::from_domain`, which allows explicitly passing in the
domain. Internally, we now store an `Option<Domain>`, and panic
when calling `caller_domain` with a `None` domain. Several places
in the codebase have been adjusted to pass in the correct domain.
2023-03-26 17:43:46 -07:00
Aaron Hill da6384b30e Warn instead of panicking 2023-03-26 17:22:52 -07:00
Aaron Hill d220cad3bf avm2: Allow duplicate (class, symbol) pairs in SymbolClass tags 2023-03-26 17:22:52 -07:00
Aaron Hill 7f829dd646 avm2: Don't overwrite symbol class entry with a different SwfMovie
If you use a `Loader` to load an SWF containing a class that shadows
an already-defined class, the class definition from the Loader SWF
will be ignoredin favor of the already-defined class. This commit
applies this log to symbol classes as well - the symbol registry for the class
should continue to point to the existing MovieClip in the parent.
This results in the child SWF instantiating the class from the parent
SWF when the child places the affected movie clip on the timeline.

This fixes a bug in Fancy Pants World 4 Part 3, where the sub-level
SWF was replacing the symbol class entry for the parent 'shipInteract'
class with the dummy clip provided in the sub-level SWF (instead
of continuing to use the correct clip from the parent SWF).
2023-03-26 17:22:52 -07:00
Aaron Hill cb9d02e3dd avm2: Fire soundComplete events immediately
Instead of queueing up these events in the `Activation`,
we can fire them immediately by making `AudioManager::update_sounds`
a freestanding method that takes in an `UpdateContext`
2023-03-26 14:43:07 -07:00
Gleb Piskunov 6f7e491bc5
core: Fix ChildContainer.replace_at_depth() panic
Avoid panic in ChildContainer.replace_at_depth() panic when previous child is not in render list.

---------

Co-authored-by: Gleb Piskunov <emgfc@ya.ru>
2023-03-26 19:47:07 +00:00
Lord-McSweeney 3b7172de8d nit: Add error code in error message 2023-03-26 11:39:07 -07:00
Mike Welsh 7d75f9ecf8 chore: Always rebuild TypeScript
Pass `--force` to tsc to always force a recompile of the
TypeScript on build.

`tsc` won't rebuild files if the source hasn't changed, but we
want `build-info.js` to always be updated.
2023-03-26 09:52:37 -07:00
yoganlava ab263b8c6a avm2: Handle undefined arg in XML.elements() 2023-03-25 23:12:51 -07:00
yoganlava 847465cb86 avm2: don't coerce to string before undefined check in name_to_multiname 2023-03-25 23:12:51 -07:00
yoganlava 447ada0929 avm2: Clean up XML.elements() by using name_to_multiname
name_to_multiname now resolves "undefined" to Multiname::any
2023-03-25 23:12:51 -07:00
yoganlava 9bf66ae3c3 chore: Fix fmt 2023-03-25 23:12:51 -07:00
yoganlava da0b245fb8 avm2: Fully implement XML.elements() 2023-03-25 23:12:51 -07:00
Daniel Jacobs b7c20a6c60 extension: Give precedence to toggles over default options (fixes #5825)
Also fixes #5696
2023-03-25 22:57:57 -07:00
Aaron Hill 9530da22e2 avm2: Convert SoundTransform and SoundMixer to ActionScript classes
Co-authored-by: Mike Welsh <mwelsh@gmail.com>
2023-03-25 22:28:14 -07:00
EmperorBale 8bb4f21065 avm2: Add test for function double borrow issue 2023-03-25 21:57:04 -07:00
EmperorBale 7a4a4f7c9a avm2: Fix function double borrow panic 2023-03-25 21:57:04 -07:00
Tom Schuster 53d9118834 avm2: Implement XML set for simple element cases 2023-03-25 20:40:44 -07:00
Lord-McSweeney 3bfa2deb5c
avm2: Log error message instead of error object 2023-03-26 02:20:18 +00:00
Aaron Hill b140029e95 render: Fix BitmapData.applyFilter with non-full sourceRect
Previously, we were scaling down the source image to fit into
the smaller sourceRect, instead of cropping at the original scale.
This broke the background textures in Fancy Pants World 4 Part 2,
as the scaled-down output image resulted in a smaller rectangle
being returned from 'getColorBoundsRect'

We now crop the image by properly constructing the UV-coordinate
transformation matrix. We were also using the wrong value for the
'destPoint' y coordinate, which I fixed.

This slightly changes the image output of two tests - the new images
now more closely match the Flash output.
2023-03-25 18:44:01 -07:00
Moulins 5b4096de8b wstr: Revert incorrect optimization in hash calculation
Calling `Hash::write_bytes` isn't guaranteed to be equivalent to a
sequence of `Hash::write_u8`.

Additionally, make sure the hash is truly prefix-free by hashing the
length first.
2023-03-25 18:27:51 -07:00
David Wendt 65d2fca7bd chore: Rename `NetStream.toggle_pause` to match `StreamManager::toggle_paused` 2023-03-25 15:30:02 -06:00
David Wendt 6689b547f8 chore: Re-alphabetize `globals.as` 2023-03-25 15:30:02 -06:00
David Wendt 66efb02f46 chore: `NetStreamInfo.as` formatting 2023-03-25 15:30:02 -06:00
David Wendt 0fd6fbc6d6 chore: Explicitly type `NetStream` constants as `String` 2023-03-25 15:30:02 -06:00
David Wendt d9dcc49bc1 core: If a timeline video gets a `NetStream` attached to it, timeline seeking should be a no-op. 2023-03-25 15:30:02 -06:00
David Wendt afb0cd3b5e avm1,avm2: Implement `pause`/`resume` based methods.
For AVM1, `pause` handles three different functions; while AVM2 splits that into `pause`, `resume`, and `togglePause`.
2023-03-25 15:30:02 -06:00
David Wendt 6217397482 avm1,avm2: Implement `NetStream.play`.
So far this just sticks the stream into the playback list and kicks off a download; we do not actually support decoding, seeking, or any of the other things that we expect `play` to do.
2023-03-25 15:30:02 -06:00
David Wendt 273b0a4a76 core: `NetStream` should be a self-owning pointer type. 2023-03-25 15:30:02 -06:00