Commit Graph

819 Commits

Author SHA1 Message Date
Aaron Hill 1a7022c30b avm2: Consider noninteractive child/drawing when mouseEnabled=false
We still want to propagate these hits to the parent, which may
be able to handle them. My existing tests missed this case,
since all of the parent objects had content which was
behind the child content. When the only clickable content
comes from a child with 'mouseEnabled=false', we should
still fire an event targeting the parent (when applicable
based on the parent's flags).

This fixes dragging on the background (without any scenery present)
in Steambirds.
2023-03-07 08:14:22 -06:00
Aaron Hill d72a8e7125 core: Run frames for 'orphan' AVM2 MovieClips
When a MovieClip is an 'orphan' (it has no parent),
it still has frames run (including frame scripts). Some SWFS
like SteamBirds and 'This is the Only Level TOO' rely on this behavior,
so we need to implement it.

The overall idea is straightforward - we keep a global list of
orphan movies, which we add to whenever we unset the parent for a movie.
This list stores weak references for consistency with Flash.
When we run a frame, we process entries in the root movie list,
in addition to the normal recursive processing from the `Stage`.

However, exactly matching Flash's output turned out to be quite tricky.
The particular sequence of calls I make in `run_all_phases_avm2` makes Ruffle
pass two complicated test cases, but there could still be lurking bugs.

This is enough to get SteamBirds to the first level (which doesn't
render due to a different error).
2023-03-06 20:53:35 -06:00
Nathan Adams 026efe7f18 render: Moved out some Gradient fields into webgl as it's no longer needed in wgpu 2023-03-06 23:22:09 +01:00
Nathan Adams 622abe60d1 wgpu: Extract T->Color lookup from gradient shader to Mesh construction 2023-03-06 23:22:09 +01:00
Aaron Hill fde46a72a4 avm2: Fix mouse picking on MovieClip in 'button mode'
We were previously performing a redundant 'self.hit_test_shape'
call in 'avm2_mouse_pick'. All of the logic in that function
is handled in `avm2_mouse_pick.` Additionally, this call happened
before we tested out children, which would result in us targeting
a parent's drawing instead of aa child.
2023-03-06 15:57:46 -06:00
EmperorBale 730115b1a0 tests: Extend proxy tests 2023-03-05 21:32:40 -08:00
EmperorBale 46ffd31f99 tests: Extend QName tests 2023-03-05 21:32:40 -08:00
Aaron Hill 1e75e7e60a tests: Don't run render-required tests when WGPU is unavailable 2023-03-05 18:36:55 -06:00
Aaron Hill bb5e568333 avm2: Stop after the first DisplayObject-linked class in the chain
Surprisingly, Flash allows mutliple classes in an inheritance chain
to hav a linked `class_symbol`. When we instantiate a `DisplayObject`,
we need to stop at the first such `class_symbol` we find. This means
that any fields set from named children will *only* be set in the
first class we find, not in any of the parent classes (as their
corresponding library symbol will not be instantiated).

Previously, we would continue looping even after we found a
`class_symbol`, resulting in the furthest ancestor *winning*
the `set_object2` call.
2023-03-05 18:04:02 -06:00
Nathan Adams 33064465b3 tests: Ignore stage3d_raytrace on WARP 2023-03-04 15:50:57 -06:00
relrelb 3967fe8e74 tests: Expand `movieclip_getbounds`
Add a case of uninitialized bounds.
2023-03-04 21:54:23 +02:00
Aaron Hill a4c8f27743 avm2: Implement Matrix3D.appendScale
This is based off the the MIT-licensed OpenFL code, which
just needed a few tweaks to convert it from Haxe to ActionScript.
2023-03-03 18:32:04 -06:00
Aaron Hill 59f4953730 avm2: Adding missing AGAL files to 'stage3d_raytrace'
These aren't necessary to run the included test.swf,
but they are needed into order to rebuild it from test.fla
2023-03-03 18:11:10 -06:00
Aaron Hill 2748b95c86 avm2: Improve Stage3D support for textures, register types, and opcodes
This is a very large diff, but most of it comes from test files and
output.

This PR ads partial support for the following Stage3D shader features:
* Normal (square), rectangle, and cube textures
* Varying and temporary registers
* Lots of opcodes

The combination of these allows us to get a raytracing program
fully working in Ruffle. I've included it as image test.
Currently, this test is very slow (about 90 seconds on my machine),
as the code I'm using (https://github.com/saharan/OGSL) includes
its own shader language and compiler. THe raytracing demo
first compiles its own shader language to AGAL, and then starts
rendering the scene.

Limitations:
* Many opcodes are still unimplemented
* Most non-default texture options (e.g. mipmaps) are not implemented
2023-03-03 15:58:46 -06:00
Aaron Hill 1d883688e0 avm2: Correctly check when toJSON is missing, and use vtable properties
We were previously calling `get_property` to determine if a `toJSON`
property exists, but that produces an error if the method is missing
on a sealed class.

Additionally, JSON serialization wasn't taking into account properties
from the vtable. All public properties (including fields, const fields,
and getter methods) get serialized.

Unfortunately, our vtable property order currently doesn't match
Flash's. I've hand-edited the test output for now (all of the actual
properties are there, just in a different order), and added a note
2023-03-03 15:34:26 -06:00
Adrian Wielgosik 1ba3ec0bf0 avm2: Implement BitmapData.getVector 2023-03-03 12:47:54 +01:00
Aaron Hill a07ff36726 avm2: Implement describeType
This includes all of the XML elements described in 'describeType' docs.
Unfortunately, the order of elements produced by Flash depends on
the iteration order of internal hashtables. As a result, the test
manually stringifies an XML object, sorting the stringified children,
to produce consistent output between Flash and Ruffle.
2023-03-02 20:37:59 -06:00
Nathan Adams fcaa17308c avm2: Workaround haxe calling addChild(this) before super() 2023-03-02 00:38:24 +01:00
Nathan Adams 6e5e8b13fc core: Use a lookup table in Color::to_un_multiplied_alpha to match Flash's output 2023-03-01 23:24:35 +01:00
CUB3D 4723c0414b avm1: Remove resolved todos, add comment and test about known reference launder issue 2023-03-01 22:36:39 +01:00
CUB3D 38f897eff4 test: Even more tests 2023-03-01 22:36:39 +01:00
CUB3D af9810c22e avm1: More scope fixes 2023-03-01 22:36:39 +01:00
CUB3D ca0e2488cb avm1: Dont double borrow the cache, update test output 2023-03-01 22:36:39 +01:00
CUB3D 6d4c04c1c3 avm1: Cleanup todos, add even more tests 2023-03-01 22:36:39 +01:00
CUB3D 6ba75d6045 avm1: Refactor movieclip path logic 2023-03-01 22:36:39 +01:00
CUB3D 6f13276341 tests: Uniform test naming 2023-03-01 22:36:39 +01:00
CUB3D 11d76fc2c4 tests: Add more string paths tests 2023-03-01 22:36:39 +01:00
CUB3D c71070f015 tests: Add string paths keypress event test, add support for keydown in input.json 2023-03-01 22:36:39 +01:00
CUB3D 619dbe8566 test: Add test for clip constructors and timers 2023-03-01 22:36:39 +01:00
CUB3D 71a58db8a4 test: Add test for unload and variable scopes 2023-03-01 22:36:39 +01:00
CUB3D 03f5fd8154 test: Add test for string paths aliasing 2023-03-01 22:36:39 +01:00
CUB3D 87947976d3 test: Add test for basic string paths 2023-03-01 22:36:39 +01:00
CUB3D b43510535f test: Add button v5/v6 tests 2023-03-01 22:36:39 +01:00
Aaron Hill 076016b1be avm2: Get XMLList 'filter' syntax working
This requires the ability to do a limited 'set_property',
as well as `get_enumerant_value`.

To prevent modification of XMLLists derived from queries,
I've introduced a `target` field on `XMLList`. This is
`None` for lists created with `new XMLList()`, and `Some`
when the list was derived from a query on an existing `XML`
/`XMLList`. We only allow `set_property` when `target` is `None`:
this is enough for filtering to work, and prevents silent incorrect
execution when trying to modify an existing node.
2023-03-01 12:04:02 -06:00
Aaron Hill 44a301e16a avm2: Add `attribute` and `attributes` methods to `XML/XMLList` 2023-03-01 10:51:21 -06:00
Aaron Hill 78c9de7b8f avm2: Fix constructing empty XMLList
A default empty text node should only be created for XML.
2023-03-01 15:57:34 +01:00
EmperorBale 93ce5e2328 tests: Extend loader_applicationDomain test 2023-02-28 13:04:24 -08:00
Nathan Adams f79015e201 render: Use swf Filter types where possible. Gradient types had to be split into duplicate classes to allow for different trait impls based on which gradient filter type it is. 2023-02-28 16:25:12 +01:00
Nathan Adams a7edeb4638 tests: Add avm2/gradient_glow_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams d869a6e0ab tests: Add avm2/gradient_bevel_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams 0a40a2d43f tests: Add avm2/glow_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams bfee81485d tests: Add avm2/drop_shadow_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams 238b25daf5 tests: Add avm2/displacement_map_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams 30a114a441 tests: Add avm2/convolution_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams ec605db19c tests: Add avm2/color_matrix_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams aabfc6c9c0 tests: Add avm2/blur_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Nathan Adams e240bf8472 tests: Add avm2/bevel_filter test for swf->core->avm2 and avm2->core->avm2 testing 2023-02-28 16:25:12 +01:00
Aaron Hill 54eb6e33ca avm2: Ignore XML comments and processing instructions by default
This matches the default value of the settings on XML.
2023-02-27 15:53:39 -06:00
Aaron Hill 82d03b4062 avm2: Ignore XML declaration and doctype
These are completely ignored by AVM2
2023-02-27 13:41:18 -06:00
Aaron Hill c04b463f1f avm2: Implement XML.children, XMLList.children, and related methods 2023-02-27 13:25:16 -06:00
Aaron Hill 7f58b92348 avm2: Implement encodeURI and encodeURIComponent 2023-02-27 12:40:39 -06:00
Nathan Adams cfcd257932 avm2: Xml(foo) converts foo to string 2023-02-27 17:37:28 +01:00
Aaron Hill f9fc4b3179
avm2: Store interfaces from superclases/superinterfaces in ClassObject (#9728) 2023-02-25 23:57:50 +00:00
Aaron Hill c7709dffec avm2: Handle Event::CData when parsing XML 2023-02-25 17:26:31 -06:00
Adrian Wielgosik 8bdf215462 avm2: Add a test for box-then-to-bool bug 2023-02-25 23:31:17 +01:00
Aaron Hill b26f2fd6fb
avm2: Initial incomplete implementation of XML (#9647) 2023-02-25 20:06:36 +00:00
EmperorBale 216bb1bb28 tests: Add test for duplicate definitions 2023-02-24 11:55:58 -08:00
Nathan Adams edd7f80341 wgpu: Fix blown out colors when transforming them above 100% - fixes #9698 2023-02-24 19:01:41 +01:00
Aaron Hill 455124d3ba render: Fix blending onto BitmapData contents
When rendering to an offscreen texture for `Bitmapdata.draw`,
we first render to a temporary frame buffer, and then copy the contents
of the frame buffer back to the target texture. However, this results
in blend modes being incorrectly applied - for example, rendering with
BlendMode.SUBTRACT will subtract against the framebuffer (which starts
with each pixel as 0x00000000), instead of the previous BitmapData
contents.

To fix this, we now use our texture target as the frame buffer
when performing `render_offscreen`. This ensure that we blend
over existing pixels (taking into account the `blendMode` provided
in the `BitmapData.draw` call).

When multisampling is enabled, we use a copy pipeline to copy
the existing contents of our texture to a fresh multisampled frame
buffer (the non-multisampled texture target becomes our resolve buffer).
2023-02-23 09:52:56 -06:00
Nathan Adams e17b154d47 avm2: Iterate the inheritance chain for class-symbol linkage 2023-02-22 22:27:13 +01:00
Aaron Hill c258423dc3 avm2: Allow resolving interfaces before ClassObjects are available
The Adobe Animate compiler can emit a 'newclass' opcode for
a concrete class before the 'newclass' opcodes for the interfaces
it implements. As a result, we cannot rely on looking up an interface
`ClassObject` when resolving a class's interfaces.

We now store a map of exported classes in `Domain`, and use this
to lookup interfaces before their `ClassObject`s have been created.

Additionally, `link_interfaces` was failing to consider superinterfaces,
which meant that methods from superinterfaces were not being copied
into the vtable. I've fixed this along with the other changes.
2023-02-22 14:41:01 -06:00
Bale 2cfa97e84d
avm2: ByteArray.readUTF/readUTFBytes should cut off after null byte (#9673)
* avm2: Fix #9668

* tests: Extend ByteArray test
2023-02-22 18:47:59 +00:00
Nathan Adams a550c877f6 tests: Update avm2/simplebutton_constr_params test to check the button on frame 2 2023-02-22 18:49:04 +01:00
Nathan Adams aef466f8f3 avm2: Implemented BitmapData.drawWithQuality 2023-02-22 17:36:55 +01:00
Lord-McSweeney 74640ed44e
tests: Remove ^M characters from Dictionary tests (#9656)
* Remove ^M characters from Dictionary test

Using Github's automatic line ending conversion to CRLF.

* Remove ^M characters from dictionary_delete test

* Remove ^M characters from dictionary_in test
2023-02-22 09:57:50 +02:00
nosamu 1e2ab9cd0e tests: Add new clipDepth test 2023-02-21 16:39:42 +02:00
EmperorBale fa6d01c505 tests: Extend `movielcip.gotoAndPlay` test 2023-02-17 18:46:43 -08:00
EmperorBale 46bd6bbee9 tests: Add test for scopechain resolution order 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
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 0e1bddff65 tests: Fix build when running from inside the `tests` folder. 2023-02-16 06:23:35 +01: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
EmperorBale 1e12f2d49b tests: Add test for finddef opcode 2023-02-14 14:22:02 -08: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
Adrian Wielgosik 5eb887c628 avm2: Stub describeType to have .@name work 2023-02-13 23:55:00 +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
Aaron Hill c597f9f996 core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01: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
golfinq 37ec94f95b Avm2: Implement Stage.invalidate 2023-02-08 17:47:21 -07: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 dff558170e avm2: Implement BitmapData.getPixels() 2023-02-07 19:10:25 +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 6b6e07c7cb test: Update unload fla 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 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 1cb3ea7bf9 wgpu: Store quality, not sample_count, and calculate the correct sample count per format 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 e73389aa71 wgpu: Implement blur filter 2023-02-05 18:41:43 +01:00
Nathan Adams 284a58c817 avm2: Implement BitmapData.apply_filter for ColorMatrixFilter 2023-02-05 18:41:43 +01:00
Nathan Adams 5e2f1a66eb tests: Enable tests that no longer need to be ignored 2023-02-04 15:26:45 -06:00
Nathan Adams 06361ce01d tests: Add overlay_onto_stage test to ensure blend buffers are cleared before use 2023-01-29 20:45:01 +01:00
Moulins e36b03bce9 core::html: correctly encode text in FormatSpans::to_html
Fixes issue #9327
2023-01-29 11:19:16 -06:00
CUB3D f829157deb avm1: Defining a local that already exists on the target of a with scope, defines it on the target not the parent 2023-01-29 18:05:25 +01:00
Nathan Adams 7b1c101c81 wgpu: Fix repeat & reflect gradients 2023-01-29 17:17:44 +01:00
Nathan Adams 85dc100ee9 avm2: Implement Sprite.dropTarget - though it's wrong right now 2023-01-29 00:52:52 +01:00
Nathan Adams d918d47f66 tests: Temporarily remove EditText from text_blocks_clicks as it's broken in ruffle atm 2023-01-29 00:39:06 +01:00
Nathan Adams 8108e64bfa tests: Add avm1 text_blocks_clicks test 2023-01-29 00:39:06 +01:00
Aaron Hill 184734267d tests: Deny unknown fields when deserializing test.toml files
This will catch typos and misplaced options when modifying tests.
2023-01-28 16:27:43 -06:00
Nathan Adams b14831417a tests: Added avm2 click_test test from #9287, ignored as it fails 2023-01-28 13:13:37 -07:00
Nathan Adams 666a55e503 tests: Added avm1 click_test test from #9287, ignored as it fails 2023-01-28 13:13:37 -07:00
Aaron Hill daeb132e53 tests: Handle trailing newlines more consistently
Previously, we would strip trailing newlines from the contents
of 'output.txt' files, and skip adding a trailing newline after
the final recorded `trace` call.

To reduce the amount of processing we do of expected/ruffle output,
and to make fpcompare tests easier, I've removed the special handling
of newlines. When recording `trace` calls, we now build up a single
large `String`, with a newline after every `trace` message. When
reading in an 'output.txt' file, we do not strip any newlines.

This required adding trailings newlines to lots of 'output.txt' files,
to match the behavior of Ruffle and Flash (the last 'trace' message
ends with a newline, just like every other 'trace' message).
2023-01-28 13:59:00 -06:00
Nathan Adams 48c9cdd5ad tests: Ported visual tests from ruffle-rs/visual-tests repo 2023-01-28 12:15:59 -07:00
Nathan Adams a6c6ae13fe tests: Adjust tolerance of existing image tests 2023-01-28 12:15:59 -07:00
Nathan Adams 051927775c tests: Clippy lint 2023-01-28 12:15:59 -07:00
Nathan Adams 9c4190b20b tests: Readd suffix to actual/difference files 2023-01-28 12:15:59 -07:00
Nathan Adams 67ec70d960 tests: Set default log filter to warn for wgpu 2023-01-28 12:15:59 -07:00
Nathan Adams cdb2c5fe04 tests: Allow image tolerance & max_outliers on image comparison tests. Changed all existing image tests to use 1 sample count since this changes them all anyway 2023-01-28 12:15:59 -07:00
Nathan Adams d70d9067ec tests: Fix clippy lints 2023-01-28 12:15:59 -07:00
Nathan Adams 4ef88eaaa0 tests: Fix imgchecks feature compiling 2023-01-28 12:15:59 -07:00
Nathan Adams c73aa5b9d5 tests: Add sample_count to render options 2023-01-28 12:15:59 -07:00
Nathan Adams cbe17c4455 tests: Filter early to avoid creating test info (and thus wgpu) for tests that won't run 2023-01-28 12:15:59 -07:00
Nathan Adams 9b43836d1d tests: Allow executing of with_renderer tests always, but image comparison is still gated 2023-01-28 12:15:59 -07:00
Nathan Adams 836468b6dd tests: Add player_options.with_renderer option, automatically set when image = true 2023-01-28 12:15:59 -07:00
Nathan Adams 6acf6009ef tests: Made PlayerOptions non optional (just empty default), and it works with a PlayerBuilder instead of a Player 2023-01-28 12:15:59 -07:00
Nathan Adams e614f788af tests: Refactor code so all testing goes through Test::test(), allows for approximations with custom hooks 2023-01-28 12:15:59 -07:00
Nathan Adams 8b02045c6b tests: Readd custom assert_eq 2023-01-28 12:15:59 -07:00
Nathan Adams a340318486 tests: Refactor runner methods to take in &Test and not direct values 2023-01-28 12:15:59 -07:00
Nathan Adams 56bc2b5051 tests: Added Test::should_run() 2023-01-28 12:15:59 -07:00
Nathan Adams dda8debadc tests: Move shared object tests to their own file 2023-01-28 12:15:59 -07:00
Nathan Adams 792d68d370 tests: Move TestLogBackend to runner 2023-01-28 12:15:59 -07:00
Nathan Adams 99da686822 tests: Move external interface tests to their own file 2023-01-28 12:15:59 -07:00
Nathan Adams ccc7c0a424 tests: Move ExternalInterfaceTestProvider to its own mod 2023-01-28 12:15:59 -07:00
Nathan Adams c5ab440083 tests: Move run_test(test) to Test::run() 2023-01-28 12:15:59 -07:00
Nathan Adams 6384034e47 tests: Move test_swf_with_hooks to util/runner 2023-01-28 12:15:59 -07:00
Nathan Adams ce8cb9501b tests: Move test_swf_approx to util/runner 2023-01-28 12:15:59 -07:00
Nathan Adams 818897b74e tests: Move run_swf to util/runner 2023-01-28 12:15:59 -07:00
Nathan Adams 4418431bfe tests: Move assert_eq to utils 2023-01-28 12:15:59 -07:00
Nathan Adams a741f373b4 tests: Take in a &Path for various paths 2023-01-28 12:15:59 -07:00
Nathan Adams 83af3e6b4e tests: Extract Test struct that contains all the info for a test 2023-01-28 12:15:59 -07:00
Nathan Adams ff8506d351 tests: Extract TestOptions::read() for parsing a file 2023-01-28 12:15:59 -07:00
Nathan Adams 316df5b415 tests: Extract TestOptions into its own file 2023-01-28 12:15:59 -07:00
Nathan Adams 7d234956eb tests: Move tests away from giant macro to individual test.toml files that describe the test 2023-01-27 13:53:43 +01:00
Aaron Hill 6fe7af58d5 Move back to upstream wgpu repository
We're relying on unreleased changes, so we depend on the latest commit
from their repository.
2023-01-23 11:31:04 +01:00
EmperorBale 954a7513f8 tests: Update date tests 2023-01-16 21:48:00 +01:00
Nathan Adams 8db8e4669a wgpu: Implement Multiply blend mode as a trivial blend 2023-01-12 10:54:03 -05:00
Nathan Adams 09608c2abc wgpu: Implement Screen blend mode as a trivial blend 2023-01-12 10:54:03 -05:00
dependabot[bot] b7986406a8 build(deps): bump regex from 1.7.0 to 1.7.1
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.7.0...1.7.1)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-12 14:27:19 +02:00
MrCheeze d1b01c9db7 tests: Update AVM2 currentLabels test for case insensitivity 2023-01-10 11:28:56 -05:00
CUB3D ea6ea8074a tests: Add tests for BitmapData.threshold, fix issues found as a result 2023-01-10 13:59:06 +01:00
MrCheeze c2ad376e2c tests: Add test for AVM2 hitTestPoint (without shapeFlag) and hitTestObject.
This is a port of a similar regression test written for AVM1.
AVM1 also has a test for hitTestPoint with shapeFlag=true, but it can't
be ported for now, because the implementation of AVM2 hit testing is not
yet accurate enough for it.
2023-01-10 12:53:20 +01:00
Nathan Adams 7a9e8b4771 core: Made NullNavigatorBackend no longer use unwraps 2023-01-10 11:10:46 +01:00
CUB3D 84d0111a14 avm1: Add test for with scope nesting 2023-01-10 10:34:10 +01:00
CUB3D ca82ff65de avm1: Defining a local in a with scope should actually define it on the parent scope 2023-01-10 10:34:10 +01:00
Aaron Hill 40d8751d67 avm2: Implement clipRect parameter for BitmapData.draw 2023-01-08 16:11:55 -05:00
Aaron Hill 1b71e288fd Remove 'gc_context lifetime
The latest `gc-arena` makes this unnecessary - we can just
use our `'a` lifetime for `MutationContext`
2023-01-06 19:20:39 -05:00
MrCheeze 41df7fdc59 avm2: For old swf versions, invalid goto labels jump to frame 1 (fix #8954)
The regression test for this was edited directly in JPEXS, so there is
no corresponding fla to compile into the swf.
2023-01-03 17:10:06 -07:00
MrCheeze 77104ca473 avm2: Improve accuracy of gotoAndPlay / gotoAndStop (partially fix #8954)
Partially based on AVM1 implementation, partially based on the new
regression tests added in this commit.
2023-01-03 17:10:06 -07:00
nosamu 664a86161a avm2: Fix `for each..in` loops over Dictionary values 2023-01-03 16:52:15 -07:00
Nathan Adams c6045a4f24 wgpu: Multiply can't be trivial blend mode because of 0 alpha 2023-01-03 03:39:13 +01:00
Nathan Adams df8ead3f96 tests: New multiply blend mode image 2023-01-03 03:39:13 +01:00
Nathan Adams 81f4741300 wgpu: Default msaa on mobiles to 2x, same as webgl backend 2023-01-03 03:39:13 +01:00
Nathan Adams 864f404f2f tests: Add blendmode visual tests 2023-01-03 03:39:13 +01:00
Nathan Adams 45339e037e tests: Added new output of bitmapdata_draw tests for github agents. Seems visually identical. 2023-01-03 03:39:13 +01:00
EmperorBale 0e2fbe4cf7 tests: Update date tests 2023-01-02 11:43:03 -08:00
EmperorBale 8b9bae8ca6 tests: Add test for LoaderContext.applicationDomain 2022-12-28 17:25:11 -05:00
dependabot[bot] 6f430bb40d build(deps): bump serde from 1.0.151 to 1.0.152
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.151 to 1.0.152.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.151...v1.0.152)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-28 10:55:35 +02:00
David Wendt 54bae0265b tests: `instantiation_on_enterframe_gotoandstop` is missing a line of output 2022-12-27 20:15:49 -07:00
David Wendt 534f1cf06c tests: Adrian's tests look like they want 2 frames of execution 2022-12-27 20:15:49 -07:00
Adrian Wielgosik 825613ec8c tests: Add tests for various PlaceObject situations we didn't catch before.
There is no source as these SWFs were handmade in JPEXS.
2022-12-27 20:15:49 -07:00
dependabot[bot] c7ba2d4e87 build(deps): bump serde_json from 1.0.89 to 1.0.91
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.89 to 1.0.91.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.89...v1.0.91)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-20 08:35:32 +02:00
dependabot[bot] 9db6ace65f build(deps): bump serde from 1.0.150 to 1.0.151
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.150 to 1.0.151.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.150...v1.0.151)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-20 00:48:45 +01:00
CUB3D acfb149316 tests: Add tests for button hittests, update hitTestPoint with onStage tests 2022-12-18 13:32:24 -07:00
Mike Welsh 696c9062d3 chore: Inherit cargo metadata from workspace
Use workspace inheritance added in Rust 1.64 to de-duplicate
various settings across all packages.
2022-12-16 15:53:59 -08:00
Adrian Wielgosik 7df920b255 avm2: Support indexing with QNames 2022-12-16 14:40:22 -08:00
Adrian Wielgosik d2dfdb9a0b avm2: Collapse PackageNamespace to Namespace 2022-12-16 12:51:01 -08:00
relrelb bd9078addf chore: Fix `clippy::uninlined_format_args` lints 2022-12-15 08:59:38 +02:00
dependabot[bot] b1c4e6f143 build(deps): bump serde from 1.0.149 to 1.0.150
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.149 to 1.0.150.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.149...v1.0.150)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 21:21:45 +01:00
Adrian Wielgosik 7b64fcf5fa avm2: Fix indirect event dispatching 2022-12-06 00:44:17 +01:00
dependabot[bot] 3b285f8cf2 build(deps): bump serde from 1.0.148 to 1.0.149
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.148 to 1.0.149.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.148...v1.0.149)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 22:35:48 +01:00
kmeisthax f79208c75f
avm2: Fix no-op gotos (#8667)
* tests: Add a test for issue #8630

* core: No-op gotos in AS3 do not actually do anything, even though they emit events

Fixes issue #8630

* tests: Add more tests for various #8630-adjacent cases

* tests: Ignore the tests with script removal as they expect MovieClip children to be nulled upon removal

* chore: Case sensitive filesystem fix

Co-authored-by: Adrian Wielgosik <adrian.wielgosik@gmail.com>
2022-12-05 18:19:29 +01:00
wsxarcher c8e39da1e0 avm2: Implement filefilter filereference 2022-12-04 15:10:48 +01:00
Adrian Wielgosik 0861153626 swf: make Clippy happy 2022-12-03 22:18:22 +01:00
Marco Bartoli f2080e6d57
avm2: implement get and set of displayobject filters (#8623) 2022-12-01 02:31:35 +01:00
dependabot[bot] 83487ae5d1 build(deps): bump serde from 1.0.147 to 1.0.148
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.147 to 1.0.148.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.147...v1.0.148)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 10:04:26 +01:00
Marco Grassi ad81b3bf14 upgrade lock and toml dependencies 2022-11-26 14:04:59 -05:00
Aaron Hill b8745f0ff1 avm2: Partially implement Stage3D for wgpu backend
This PR implements core 'stage3D' APIs. We are now able
to render at least two demos from the Context3D docs - a simple
triangle render, and a rotating cube.

Implemented in this PR:
* Stage3D access and Context3D creation
* IndexBuffer3D and VertexBuffer3D creation, uploading, and usage
* Program3D uploading and usage (via `naga-agal`)
* Context3D: configureBackBuffer, clear, drawTriangles, and present

Not yet implemented:
* Any 'dispose()' methods
* Depth and stencil buffers
* Context3D texture apis
* Scissor rectangle

General implementation strategy:

A new `Object` variant is added for each of the Stage3D objects
(VertexBuffer3D, Program3D, etc). This stores a handle to the
parent `Context3D`, and (depending on the object) a handle
to the underlying native resource, via `Rc<dyn
SomeRenderBackendTrait>`).

Calling methods on Context3D does not usually result in an immediate
call to a `wgpu` method. Instead, we queue up commands in our
`Context3D` instance, and execute them all on a call to `present`.
This avoids some nasty wgpu lifetime issues, and is very similar
to the approah we use for normal rendering.

The actual rendering happens on a `Texture`, with dimensions
determined by `createBackBuffer`. During 'Stage' rendering,
we render all of these Stage3D textures *behind* the normal
stage (but in front of the overall stage background color).
2022-11-25 21:43:00 -07:00
Aaron Hill 4b8cd45f4b
avm2: Partially implement StaticText (#8343)
This is linked to the legacy DisplayObject::Text, which can
only be created by Flash CS6 (but is allowed in AVM2 swfs).

The 'StaticText' class cannot be constructed from ActionScript.
To support this, I've added support for native initializers to
playerglobal. This allows us to throw an exception in the
ActionScript constructor in Test.as, and do nothing in the native
intiializer (so that we can construct it from a DisplayObject).

I've left StaticText.text unimplemented for now, since it will require
dealing with Glyphs

Co-authored-by: kmeisthax <dcrkid@yahoo.com>
2022-11-23 18:30:47 -05:00
dependabot[bot] cf8217f2ff build(deps): bump serde_json from 1.0.87 to 1.0.88
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.87...v1.0.88)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 16:31:02 -07:00
David Wendt 4c0099c39c tests: Reduce the epsilons on `as3_edittext_getlinemetrics` and `gettextextent` to more reasonable values 2022-11-20 17:13:48 -07:00
David Wendt 728b198c9d tests: Re-run the `gettextextent` in an environment that actually sees Noto Sans as a system font. 2022-11-20 17:13:48 -07:00
David Wendt 51d8a196a4 tests: `gettextextent` should be an approx test.
Also, yes, `TextFormat.getTextExtent` returns a bare object.
2022-11-20 17:13:48 -07:00
David Wendt 6590f58efe tests: Make `edittext_getlinemetrics` an approximate test with a tolerance of a quarter pixel. 2022-11-20 17:13:48 -07:00
David Wendt 1952870ed1 tests: Include tests for empty newlines in the `as3_edittext_getlinemetrics` test. 2022-11-20 17:13:48 -07:00
David Wendt c0b6496b96 tests: Add tests for AVM1 `gettextextent` and AVM2 `TextField.getLineMetrics`. 2022-11-20 17:13:48 -07:00
dependabot[bot] 4c34fa361d build(deps): bump image from 0.24.4 to 0.24.5
Bumps [image](https://github.com/image-rs/image) from 0.24.4 to 0.24.5.
- [Release notes](https://github.com/image-rs/image/releases)
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.24.4...v0.24.5)

---
updated-dependencies:
- dependency-name: image
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 08:12:38 +02:00
dependabot[bot] 8f214ff9a3 build(deps): bump regex from 1.6.0 to 1.7.0
Bumps [regex](https://github.com/rust-lang/regex) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.6.0...1.7.0)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-07 23:37:56 +02:00
dependabot[bot] 52f692c0e1 build(deps): bump env_logger from 0.9.1 to 0.9.3
Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.9.1 to 0.9.3.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.9.1...v0.9.3)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-07 23:02:47 +02:00
Aaron Hill 68471723b3 core: Fix clippy format string lint 2022-10-27 08:49:39 +03:00
dependabot[bot] 01967e4865 build(deps): bump serde_json from 1.0.86 to 1.0.87
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.86 to 1.0.87.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.86...v1.0.87)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 10:59:40 +03:00
dependabot[bot] d589130634 build(deps): bump serde from 1.0.145 to 1.0.147
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.145 to 1.0.147.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.145...v1.0.147)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 09:54:26 +03:00
dependabot[bot] 3c7e9235f6 build(deps): bump futures from 0.3.24 to 0.3.25
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.24 to 0.3.25.
- [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.24...0.3.25)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 09:19:27 +03:00
Aaron Hill d0230a2bea render: Add 'naga-agal' crate to compile AGAL shaders to Naga
This is the first part of the Stage3D implementation, and can
be reviewed independently.

Stage3D shaders use the Adobe Graphics Assembly Language (AGAL),
which is a binary shader format. It supports vertex attributes,
varying registers, program constants (uniforms), and texture sampling.

This PR only implements a few parts of AGAL:
* The 'mov' and 'm44' opcodes
* Vertex attributes, varying registers, program constants, and 'output'
 registers (position or color, depending on shader type)

This is sufficient to get a non-trivial Stage3D program
running (the rotating cube demo from the Adobe docs).

The output of `naga-agal` is a `naga::Module`. This can be passed
directly to wgpu, or compiled into a shader language using
a Naga backend (glsl, wgsl, SPIR-V, etc). The test suite
output WGSL files, and uses the 'insta' crate to compare against
saved files on disk.

Currently, the only real way to write AGAL bytecode is using
the Adobe-provided 'AGALMiniAssembler' flash class.
This class assembles the textual reprentation of AGAL into
the binary format.

To make writing tests easier, I've added a 'agal_compiler' test, which
can easily be modified to add more Agal textual assembly.
2022-10-17 13:22:02 -05:00
Aaron Hill 45515be0a3 render: Improve support for BitmapData.draw
This PR fixes a numbe of interconnected bugs:
* We weren't consistently uploading a dirty BitmapData to the render
  backend before drawing to/from it.
* BitmapData.draw should *not* add a fill color - it should draw over
  the current contents of the BitmapData
* After drawing to a non-transparent BitmapData, we need to manually
  set the opacity back to 255 for each pixel (the drawing process
  takes transparency into account, but the opacity information is
  thrown away at the end).
2022-10-17 12:53:38 -05:00
David Wendt 36844e5e2f chore: Use explicit `.clamp`
Also, update the tests to confirm that this doesn't break NaN handling.
2022-10-16 14:55:07 -06:00
David Wendt 77dadd7844 tests: Test the default values for Normal antialiasing, too. 2022-10-16 14:55:07 -06:00
David Wendt ca8f9c1103 tests: Add tests for `TextField.antiAliasType` and related properties for AVM1 and AVM2. 2022-10-16 14:55:07 -06:00
relrelb 178bf4fe24 chore: Extract Cargo `edition` to `[workspace.package]`
This is possible since Rust 1.64.0: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
2022-10-14 22:13:29 +03:00
relrelb 183b8adbf0 wgpu: Bump to `0.14.0`
Also bump `raw-window-handle` to `0.5`, as now required.
2022-10-14 21:49:40 +03:00
relrelb 4b334ce03a tests: Rewrite `Date` tests 2022-10-13 01:06:17 +03:00
relrelb a59114d569 tests: Expand `primitive_type_globals`
Cover the now-correct `NaN.toString(x)` cases.
2022-10-13 00:05:25 +03:00
dependabot[bot] 1d3412cce0 build(deps): bump serde_json from 1.0.85 to 1.0.86
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.85 to 1.0.86.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.85...v1.0.86)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-11 01:29:10 +03:00
EmperorBale bbeea8715c tests: Add test for SWZ parsing 2022-10-10 12:48:35 -07:00
relrelb bf0ace0b88 chore: Appease clippy 2022-10-09 13:46:28 +05:45
David Wendt 066ca11cff tests: Add a test for AS3 `BitmapData.clone()` 2022-10-07 01:41:48 -05:00
Tal Hayon a8b96b676a avm2: Add More BitMapData methods
This also fixes a small bug in copyChannels
2022-10-06 18:53:06 -06:00
Aaron Hill 4b2907ead5 avm2: Fix 'hasDefinition' and 'getDefinition' for ApplicationDomain
These methods were incorrectly treating the argument as a local name,
instead of a qualified name. Additionally, 'getDefinition' now throws
an AVM error.
2022-10-05 16:45:29 -05:00
Aaron Hill 9b055645d3 avm2: Support calling 'new Function()' objects
This appears to create a dummy function, which ignores all
of its arguments and always returned `undefined`
2022-10-05 08:57:12 -05:00
dependabot[bot] ac93f9d295 build(deps): bump serde from 1.0.144 to 1.0.145
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.144 to 1.0.145.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.144...v1.0.145)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 16:17:36 +03:00
dependabot[bot] fbba7744e7 build(deps): bump env_logger from 0.9.0 to 0.9.1
Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 02:47:48 +03:00
dependabot[bot] 103f384a08 build(deps): bump image from 0.24.3 to 0.24.4
Bumps [image](https://github.com/image-rs/image) from 0.24.3 to 0.24.4.
- [Release notes](https://github.com/image-rs/image/releases)
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.24.3...v0.24.4)

---
updated-dependencies:
- dependency-name: image
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 00:49:25 +03:00
dowgird 5ac4f4358d avm2: Added flash.net.URLVariables 2022-09-27 13:43:30 -05:00
Aaron Hill 53f42e0bec avm2: Fix getQualifiedClassName for null and undefined 2022-09-27 00:05:06 -05:00
Aaron Hill f5b59f869c avm2: Show native method names in stack trace
Previously, we would display an empty string for the method name.

We can now store a `&'static str` again in `NativeMethod`,
instead of needing a `Cow`
2022-09-26 14:13:48 -05:00
Aaron Hill dddc9e954a avm2: Add tests for looking up properties on Class objects 2022-09-25 15:37:50 -05:00
golfinq ceb877c55f avm2: Implement error types for avm2 2022-09-25 02:27:59 +03:00
dowgird e448f5e027 avm2: implemented flash.utils.unescapeMultiByte 2022-09-25 01:19:11 +03:00
Aaron Hill 66df5ea3de avm2: Implement typed 'catch' blocks
Now that we have a custom `Error` enum, this is very straightforwawrd.
I've converted `getDefinitionByName` return an AVM error, since this
is commonly used by games to test for a class.
2022-09-24 13:03:29 -05:00
Aaron Hill 7b0bc0fb74 avm2: Implement undocumented 'Function.length' property
This returns the function's parameter count, and is used by the Starling
framework to implement a custom event dispatcher.
2022-09-23 18:36:23 -05:00
David Wendt 293d52048b chore: Don't ask me how this `s` got in the output file 2022-09-23 11:45:52 -06:00
David Wendt 5a9f0ea099 tests: Add a test for `WaitForFrame`'s clamping behavior. 2022-09-23 11:45:52 -06:00
EmperorBale bfaedcf321 tests: Add test for checkfilter opcode 2022-09-22 15:18:23 -07:00
EmperorBale e40229d90b tests: Add test for ByteArray.writeObject 2022-09-21 13:39:58 -07:00
Aaron Hill 93b7de2fe6 avm2: Use custom Error instead of std::error::Error 2022-09-21 12:37:37 -05:00
Adrian Wielgosik d1ffaad927 avm2: Support enumerating null/undefined 2022-09-21 00:03:44 +02:00
EmperorBale e1eaa9770a avm2: Switch ByteArray to AS
avm2: Fix ByteArray

avm2: Implement ByteArray.defaultObjectEncoding

avm2: Rename ByteArray allocator
2022-09-17 12:31:43 -07:00
David Wendt f101160abc tests: Add a test for all `Stage.loaderInfo` properties that we weren't already testing for. 2022-09-17 12:32:15 -06:00
David Wendt eefe398f7c tests: `as3_bitmap_embedded` has a different stage size 2022-09-15 20:25:21 -06:00
David Wendt cf82a9d1c4 tests: Add a test for properties on Flex-style assets
We also re-enable the `bitmapdata_embedded` test now that we have a real renderer to work with.
2022-09-15 20:25:21 -06:00
David Wendt 2174c55d76 tests: Add a test for Flex-style image embeds. 2022-09-15 20:25:21 -06:00
David Wendt 613564baf7 tests: Adopt new expected images as the SWF stage size changed when I moved these tests to Flex/Flash Builder 2022-09-15 19:14:41 -06:00
David Wendt 0912ee4dff tests: Add an events test for `loadBytes` 2022-09-15 19:14:41 -06:00
David Wendt 0eff0bf91a core: Remove all synchronous preloading from core.
Backends that need synchronous preload behavior now explicitly ask for it as follows:

 * `tests` - repeatedly call `preload` in a loop with an exhausted execution limit to stress-test the chunked preload
 * `exporter`, `scanner` - synchronous/unlimited preload to match prior behavior

These may change in the future.
2022-09-15 19:14:41 -06:00
Aaron Hill 81a5f3f10a core: Always check mergeAlpha in BitmapData.copyPixels
Previously, we would only use mergeAlpha if alphaBitmapData
and alphaPoint. However, mergeAlpha can be used even when
those parameters are null.

Some of the AVM1 argument handling was also incorrect - I've fixed
it, and extended the existing test with the output-based test
added for AVM2.
2022-09-11 11:12:09 -05:00
Nathan Adams b2ecd39648 wgpu: Enable MSAA for offscreen textures 2022-09-11 09:07:53 +02:00
Nathan Adams c7f420dde5 wgpu: Moved WgpuRenderBackend into backend.rs 2022-09-11 09:07:53 +02:00
Aaron Hill 8370bc792d core: Use correct background alpha in BitmapData.draw
Previously, we would always use a transparent background,
even if the BitmapData is not transparent. This would normally
be corrected on the next frame when we copied the pixels to the
CPU. However, if an SWF ran `BitmapData.draw` on every frame,
this would never be corrected.
2022-09-09 19:24:21 -05:00
Aaron Hill 2f81f5814d render: Add `premultiplied_alpha` parameter for image capture
When rendering offscreen, we want the resulting image to use
premultiplied alpha, since the image will be stored in a texture.

However, when capturing an image in the exporter or test framework,
we want to use straight alpha, so that the resulting image can
be saved as a PNG.

Previously, we incorrectly used straight alpha everywhere, resulting
in incorrect output when using BitmapData.draw with transparency.
2022-09-09 15:46:48 -07:00
Aaron Hill ca030169f7 avm2: Implement BitmapData.rect and stub BitmapData.applyFilter
These are the last BitmapData methods needed for Solarmax
(the victory screen after beating the last level now renders).
2022-09-09 13:05:13 -05:00
Aaron Hill bb138d9082 avm2: Implement some of SharedObject
Our AVM2 `SharedObject` support is now *almost* equivalent
to our avm1 `SharedObject` support. We implement serialization
and deserialization for primitives, arrays, and `Object` instances
with local properties. We also implement serialization for `Date`,
but not `Xml` (since our AVM2 `Xml` class is just a stub at the moment).

This is enough to make 'This is the only level too' save level
progress to disk.

Currently, we always serialize to AMF3. When we implement
the `defaultObjectEncoding` and `objectEncoding`, we'll need
to adjust this.
2022-09-08 21:22:05 -05:00
Aaron Hill 974738fe10 tests: Add BitmapData.copyPixels image test from PR #2488 2022-09-08 19:52:48 -05:00
EmperorBale 5791423d43 tests: Enable avm_debug for regression tests 2022-09-07 13:54:33 -07:00