Commit Graph

8609 Commits

Author SHA1 Message Date
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
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 693e29a82d avm1: Fix test failures 2023-03-01 22:36:39 +01:00
CUB3D d1d38091ff avm1: Fixup clippy lints and formatting 2023-03-01 22:36:39 +01:00
CUB3D c6ff8a801b avm1: Fallback to resolving properties on _root when the are not in the current scope 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
CUB3D 3d3f279160 avm1: In swfv5, resolving a non MovieClip path, should resolve to the first MovieClip parent 2023-03-01 22:36:39 +01:00
CUB3D 611c86df94 avm1: Temporary fix, block events when clips are removed 2023-03-01 22:36:39 +01:00
CUB3D a282d06ab7 avm1: Locals on removed DisplayObjects can't be accessed, should be undef 2023-03-01 22:36:39 +01:00
CUB3D a67976f601 avm1: Fix add2 coerce 2023-03-01 22:36:39 +01:00
CUB3D 1fdd8f1a82 avm1: Timers attached to clips don't fire when the clip is removed 2023-03-01 22:36:39 +01:00
CUB3D 9b850e7615 avm1: Correctly invalidate cache on clip removal 2023-03-01 22:36:39 +01:00
CUB3D cb3d9f99a7 avm1: Cache MovieClips in Value::MovieClip, this is required to correctly handle changing DO._name and for perf 2023-03-01 22:36:39 +01:00
CUB3D 6a9e13814a avm1: Don't convert SuperObjects to Value::MovieClip, or you break classes 2023-03-01 22:36:39 +01:00
CUB3D de86a51edd avm1: AS-instantiated clips with unload handlers need to have delayed removal, fixes mochi preloader 2023-03-01 22:36:39 +01:00