Commit Graph

8679 Commits

Author SHA1 Message Date
Adrian Wielgosik be2d5faa6f avm2: Implement proxy.isAttribute() 2023-03-06 19:48:23 +01:00
Lord-McSweeney 3cb307bfb0
avm2: Implement String.toString (#9872)
Some SWFs use this property
2023-03-06 05:57:02 +00: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
EmperorBale 2b1918316d avm2: Require multinames to be passed explicitly to QNameObject 2023-03-05 21:32:40 -08:00
EmperorBale ac9106ccb4 chore: Cleanup multiname creation in XML 2023-03-05 21:32:40 -08:00
EmperorBale f95599b816 avm2: Store Multiname instead of QName in QNameObject
avm2: Fix QName constructor
2023-03-05 21:32:40 -08:00
renovate[bot] 130144a76d fix(deps): update rust dependencies 2023-03-05 20:43:46 -06: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 806c0fe052 web: Only report log events to browser timing api if new `profiling` feature is enabled 2023-03-05 10:29:17 +01:00
Nathan Adams 25db37790c web: Also set up logging for Buffer::play() 2023-03-05 10:29:17 +01:00
Nathan Adams b38dbadad6 web: Fixed missing logs when using `log` 2023-03-05 10:29:17 +01:00
Nathan Adams d213bc6f7f web: Make sure we set the log subscriber in futures 2023-03-05 10:29:17 +01:00
Lord-McSweeney b919889174 avm2: Stub DisplayObject.scale9Grid 2023-03-04 19:29:11 -08:00
Aaron Hill 830d5198f2 desktop: Actually use 'quality' flag
This was being completely ignored
2023-03-04 18:45:25 -06:00
Aaron Hill e6bbb627d7 avm2: Implement KeyboardEvent.keyLocation getter/setter 2023-03-04 18:30:12 -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
relrelb 83c15b8033 render: Replace `BoundingBox` with `swf::Rectangle` 2023-03-04 21:54:23 +02:00
relrelb 5756c847cd swf: Make `Twips::new` a `const fn` 2023-03-04 21:54:23 +02:00
relrelb abcdc2a851 render: Enable `serde`'s `derive` feature
Otherwise `cargo check` fails when run right from the `render/`
directory.
2023-03-04 21:54:23 +02:00
Aria Aghaei 352ed20d34
desktop: Handle errors before detaching from console on Windows CLI (#9781)
Co-authored-by: relrelb <relrelbachar@gmail.com>
2023-03-04 12:33:26 +00:00
Aaron Hill 3c03a769dc avm2: Format Matrix3D.as 2023-03-03 18:32:04 -06: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 1ef539e31b avm2: Implement Capabilities.isDebugger and stub System.disposeXML
These are needed for Solarmax 2
2023-03-03 16:51:54 -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
Daniel Jacobs 5944bae33b web: Log a message when the preloader configuration option is false 2023-03-02 10:51:36 +02:00
Daniel Jacobs 3051e66960 web: Mark shadow-DOM elements as readonly 2023-03-02 10:51:36 +02:00
Daniel Jacobs a63f520449 web: Change preloader name while keeping old name for compatibility 2023-03-02 10:51:36 +02:00
Lord-McSweeney a2150cbbbf avm2: Implement IExternalizable interface 2023-03-02 01:32:43 -06:00
Nathan Adams fcaa17308c avm2: Workaround haxe calling addChild(this) before super() 2023-03-02 00:38:24 +01:00
Aaron Hill 656ab8439c chore: Bump clap to 4.1.8 and re-enable nightly clippy on CI
Clap macros no longer produce `#[deny]`, so clippy passes
again on nightly.
2023-03-01 17:01:40 -06:00
Nathan Adams bcc4e63144 core: Inline to_un_multiplied_alpha_accurate 2023-03-01 23:24:35 +01:00
Nathan Adams 6bcb64e52a core: Use slightly more accurate to_un_multiplied_alpha version in copy_pixels to fix tests 2023-03-01 23:24:35 +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 ceda614add avm1: Don't use stack_push when the pushed value can't be an Object 2023-03-01 22:36:39 +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 6a5eb43274 avm1: Fix getVariable when path is an object+var and object is a clip 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 ae9538c3c7 avm1: Fix beta clippy 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 0d5258fa2a avm1: Remove some mc todos 2023-03-01 22:36:39 +01:00
CUB3D 6ba75d6045 avm1: Refactor movieclip path logic 2023-03-01 22:36:39 +01:00