Commit Graph

8540 Commits

Author SHA1 Message Date
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
relrelb 1fbfd2cbbc swf: Introduce `BevelFilterFlags` 2023-02-21 16:55:13 +02:00
relrelb 1f9c940331 swf: Introduce `GlowFilterFlags` 2023-02-21 16:55:13 +02:00
relrelb 2aaf337b6a swf: Introduce `BlurFilterFlags` 2023-02-21 16:55:13 +02:00
relrelb c86cd4fa9d swf: Introduce `DropShadowFilterFlags` 2023-02-21 16:55:13 +02:00
nosamu 1e2ab9cd0e tests: Add new clipDepth test 2023-02-21 16:39:42 +02:00
nosamu a505d7a6d3 core: Fix off-by-one bug with clipDepth 2023-02-21 16:39:42 +02:00
Adrian Wielgosik f7a12698b9 core: Implement Color::to_premultiplied_alpha without floats 2023-02-19 22:25:34 +01:00
Adrian Wielgosik 92e52f2d0a avm2: Add missing imports 2023-02-19 19:06:54 +01:00
relrelb 94db943743 web: Enforce ESLint's `prefer-const` rule 2023-02-19 14:09:43 +02:00
David Wendt 81ef33f58e web: Use the CORRECT extension ID in the version seal 2023-02-18 18:44:33 -07:00
Lord-McSweeney 89792865d0
avm2: Stub Loader.close 2023-02-18 18:35:20 +00:00
relrelb 5a3bb33b78 swf: Cleanup `Twips2d`
* Rename it to `Point`.
* Remove unnecessary methods, such as `.get()`.
2023-02-18 17:51:02 +02:00
relrelb 1581123284 web: Miscellaneous tiny cleanups 2023-02-18 16:35:59 +02:00
relrelb a7f41f4df5 web: Add missing access modifiers 2023-02-18 16:35:59 +02:00
relrelb b36643f52d web: Cleanup some comments 2023-02-18 16:35:59 +02:00
relrelb 903f8bc33a web: Enforce ESLint's `no-constructor-return` rule 2023-02-18 16:35:59 +02:00
relrelb f68542991f web: Enforce ESLint's `curly` rule 2023-02-18 16:35:59 +02:00
relrelb 87ecbcc066 web: Remove `InternalContextMenuItem` type
Simply declare it inline.
2023-02-18 16:35:59 +02:00
Aaron Hill 3327a9a3fd core: Set clipDepth to 0 when swapDepths affects a clip
This makes "Garfield's Comic Creator" properly show
panels when you close the editor.
2023-02-17 23:11:57 -06:00
EmperorBale fa6d01c505 tests: Extend `movielcip.gotoAndPlay` test 2023-02-17 18:46:43 -08:00
EmperorBale 158de01c92 avm2: `goto_frame` should use the movieclips scene by default 2023-02-17 18:46:43 -08:00
Aaron Hill 071306f107 avm2: Also register EventDispatcher methods in ns "flash.events:IEventDispatcher"
This is needed by "Steambirds: Survival"
2023-02-17 20:32:27 -06:00
EmperorBale bc165a81ff chore: Add comment explaining why we skip the first scope 2023-02-18 01:37:12 +01:00
EmperorBale 46bd6bbee9 tests: Add test for scopechain resolution order 2023-02-18 01:37:12 +01:00