Commit Graph

8464 Commits

Author SHA1 Message Date
relrelb 17ac6c79d3 web: Reduce script duplication
By introducing the `$WASM_BINDGEN_FLAGS` and `$WASM_OPT_FLAGS`
environment variables, similarly to what already done with `$CARGO_FLAGS`.
2023-02-25 16:18:38 +02:00
relrelb 3035dd7161 web: Use `Closure::new()`
`Closure::new()` works on stable Rust since wasm-bindgen 0.2.81.
Use it in place of `Closure::wrap()` for more concise code.
2023-02-25 11:20:10 +02:00
relrelb 79cc42c739 web: Use TypeScript project references
This slightly improves TypeScript build times, and allows LSP to work
across packages without building `ruffle-core`.

Official documentation at:
https://www.typescriptlang.org/docs/handbook/project-references.html
2023-02-25 02:00:23 +02:00
Aaron Hill 9d0ab3b8c5
Merge pull request #9680 from Aaron1011/lots-of-native 2023-02-24 16:22:18 -06:00
Aaron Hill dfee80e981
avm2: Mention interfaces in globals.as ordering comment 2023-02-24 16:08:29 -06:00
Aaron Hill 82a3f473d9
avm2: Move some class definitions after playerglobal is loaded 2023-02-24 16:08:29 -06:00
Aaron Hill 62767213a6
avm2: Use 'flash.events' internal namespace for EventDispatcher 2023-02-24 16:08:29 -06:00
Aaron Hill 24e231ae06
avm2: Convert TextField to AS 2023-02-24 16:08:29 -06:00
Aaron Hill 337149ff0e
avm2: Add TextFormat AS stub 2023-02-24 16:08:29 -06:00
Aaron Hill bc240db517
avm2: Convert SimpleButton to AS 2023-02-24 16:08:29 -06:00
Aaron Hill d31c686360
avm2: Convert MovieClip to AS 2023-02-24 16:08:29 -06:00
Aaron Hill aa7dc52b82
avm2: Convert Sprite to AS 2023-02-24 16:08:28 -06:00
Aaron Hill d996aecb04
avm2: Convert Shape to AS 2023-02-24 16:08:28 -06:00
Aaron Hill 39063a5a04
avm2: Add Graphics stub 2023-02-24 16:08:28 -06:00
Aaron Hill 8831042e8f
avm2: Convert LoaderInfo to AS 2023-02-24 16:08:28 -06:00
Aaron Hill be16286407
avm2: Convert several flash.display and flash.events classes to AS
These classes all reference each other, so it's difficult to convert
them individually.
2023-02-24 16:08:28 -06:00
Aaron Hill 6ce7bd3277
avm2: Convert EventDispatcher and IEventDispatcher to AS 2023-02-24 16:08:28 -06:00
Aaron Hill cd2770ce7e
avm2: Add SoundTransform stub 2023-02-24 14:48:51 -06:00
EmperorBale 216bb1bb28 tests: Add test for duplicate definitions 2023-02-24 11:55:58 -08:00
EmperorBale 99aa274e0f avm2: Stop loading scripts in reverse order 2023-02-24 11:55:58 -08:00
EmperorBale 5bc3c696b5 avm2: Ignore duplicate definitions 2023-02-24 11:55:58 -08:00
Nathan Adams 01af1af4d9 webgl: Fixed blown out colortransform in webgl 2023-02-24 19:01:41 +01:00
Nathan Adams edd7f80341 wgpu: Fix blown out colors when transforming them above 100% - fixes #9698 2023-02-24 19:01:41 +01:00
Aria Aghaei 44149614c7
desktop: min and max window size for ruffle (#9608)
Co-authored-by: Swag Gaming <memail@cock.li>
Co-authored-by: Aria Aghaei <ariaaghaei@gmail.com>
Co-authored-by: relrelb <relrelbachar@gmail.com>
2023-02-24 11:04:44 +00:00
relrelb 9f8419a145 web: Change `ruffle-core` output directory to `dist`
This aligns with the other packages.
2023-02-24 12:43:01 +02:00
feos 871a4d053d core: add framerate to SWF load log
fixes #8531
2023-02-24 12:13:00 +02:00
TÖRÖK Attila 5a7cd92bfe avm2: Use a lookup table for cosine in SoundMixer.computeSpectrum()
This results in 128 times fewer calls to the builtin cosf function.
2023-02-23 23:51:55 +01:00
Aaron Hill 5f4bf7b5fa avm2: Stub Capabilities.manufacturer and Capabilities.language
These are needed by Steambirds: Survival
2023-02-23 12:25:34 -06:00
relrelb 2c5b7a9221 chore: Improve Renovate config
* Move under `.github/` to reduce amount of top-level files.
* Convert to JSON5 to allow comments and trailing commans.
* Include `js-sys` and `web-sys` in `wasm-bindgen` group.
2023-02-23 20:06:52 +02: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 3a29ebc600 avm2: Comment where our RangeErrors have different-to-flash text in DOC 2023-02-23 08:12:42 -06:00
Nathan Adams 5f7978cfa5 avm2: Use avm errors for RangeErrors inside DisplayObjectContainer 2023-02-23 08:12:42 -06:00
Daniel Jacobs bcbf8c9108
web: Allow context menu to work on iOS using PointerEvents (#9598)
Co-authored-by: nosamu <71368227+n0samu@users.noreply.github.com>
2023-02-23 12:47:08 +02:00
Nathan Adams e17b154d47 avm2: Iterate the inheritance chain for class-symbol linkage 2023-02-22 22:27:13 +01:00
Aaron Hill 203d4cd3aa avm2: Use Value::Undefined for out-of-range Vector enumerant index
This makes Vector consistenht with the other implementations
of `get_enumerant_name`. This also fixes a bug where AMF object
serialization would loop all te way to `u32::MAX` when serializing
a vector, because it would never see `Value::Undefined` and break.
2023-02-22 15:03:09 -06:00
Aaron Hill f1b0247de7 avm2: Remove install_trait_late 2023-02-22 14:41:01 -06:00
Aaron Hill c52f1082c4 avm2: Make `early_resolve_interface` take in a `domain` directly 2023-02-22 14:41:01 -06: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
relrelb 52e395ecca extension: Use `@tsconfig/strictest` 2023-02-22 21:39:12 +02:00
relrelb 140e1fcfee web: Use `@tsconfig/strictest` 2023-02-22 21:39:12 +02: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
Marty_SVK fac7fc0666 Stub System.pauseForGCIfCollectionImminent
This progresses Papas Scooperia
2023-02-22 12:34:13 -06: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 e8fcc8b194 avm2: Don't reset SimpleButtons that are created by scripts 2023-02-22 18:49:04 +01:00
Nathan Adams aef466f8f3 avm2: Implemented BitmapData.drawWithQuality 2023-02-22 17:36:55 +01:00
Nathan Adams 6539262db7 render: Add Quality option to RenderBackend::render_offscreen 2023-02-22 17:36:55 +01:00
nosamu 70bf0a816a core: Add options to set and force stage scale mode 2023-02-22 12:13:20 +02: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
relrelb e98aa54599 swf: Introduce `ConvolutionFilterFlags` 2023-02-21 16:55:13 +02:00
relrelb 35ef402b95 swf: Introduce `GradientFilterFlags` 2023-02-21 16:55:13 +02:00