Commit Graph

9538 Commits

Author SHA1 Message Date
relrelb 226a2be2bd core: Fix drag constraint with `lockCenter` set to `false`
Previously `last_mouse_position` was updated irrespectively of
whether the dragged object was inside or outside the constraint
box. Change it follow mouse deltas, after clamping is performed.

Fixes #11254.
2023-06-11 07:34:14 +03:00
Lord-McSweeney dced6445ee avm2: Stub flash.net.getClassByAlias and improve flash.net.registerClassAlias stub 2023-06-10 16:09:57 -05:00
Lord-McSweeney 4d8feeab2e avm2+tests: Fix String.substr with negative second value, add tests 2023-06-10 15:48:45 -05:00
Aaron Hill cfb23d1f97 avm2: Implement AMF serialization of XML objects 2023-06-10 12:13:07 -05:00
relrelb dcb6bbe50b avm1: Migrate `GradientGlowFilter` to `NativeObject` 2023-06-10 12:46:22 +03:00
Nathan Adams 75979b561a avm1: Rename try_resolve_level -> get_level, resolve_level -> get_or_create_level 2023-06-10 10:37:15 +02:00
Nathan Adams 38a3f67000 avm1: Don't create _levelN for unloadMovieNum(N) 2023-06-10 10:37:15 +02:00
Crowdin Bot e8925832a1 chore: Update translations from Crowdin 2023-06-10 10:09:19 +02:00
AllinolCP 44ff49aa53
core: Fix status code implementation for AVM1 and implement HTTPStatusEvent.HTTP_STATUS for avm2 (#11360) 2023-06-10 03:06:26 +00:00
renovate[bot] a621472336 chore(deps): lock file maintenance rust dependencies 2023-06-09 20:17:25 +03:00
Aaron Hill a387476de7 core: Unify loader event handler and AVM2 data into MovieLoaderVMData
`AVM2Data` was always provided with
`MovieLoaderEventHandler::Avm2LoaderInfo`, so we can unify
them into a single enum.
2023-06-09 11:47:11 -05:00
doomsdayrs 16210cbcf6 desktop: Add reverse engineered logo svg
There was no source file for the various logos.

I used the icon file provided by @nosamu and used existing pngs to recreate the style of the logo.
2023-06-09 18:21:56 +02:00
Oleksandr Kalko 70aa8385b7
chore: Upgrade NodeJS dependencies (#11352) 2023-06-09 15:50:59 +00:00
Toad06 2894f01d50 avm1: Implement `MovieClip.lineGradientStyle` 2023-06-09 17:36:34 +02:00
Toad06 181aac46b0 avm1: Don't fail if base clip is invalid in `GetProperty`/`SetProperty` 2023-06-09 16:59:27 +02:00
Nathan Adams 6ec01f3ecb desktop: Add dummy External Interface option 2023-06-09 13:03:46 +02:00
Nathan Adams 137986c384 core: Add PlayerBuilder::with_external_interface 2023-06-09 13:03:46 +02:00
Aaron Hill 66f3198f50 desktop/web: Increase stack size on Windows and wasm
This works around a stack overflow with Bloonts Tower Defense 5,
where we have over 400 stack frames at once due to deep
`construct_frame` recursion in `goto` execution.
2023-06-08 22:17:27 -05:00
Aaron Hill 59b219cda6 avm2: Run 'nested goto frame' for entire Stage and orphans
When we run a 'goto', a weird "nested frame" gets triggered.
Previously, we were only calling `construct_frame` on the target
MovieClip as part of this "nested frame". However, Flash Player
seems to treat this (in some ways) like a normal frame - *all*
objects on the Stage (and orphans) have `construct_frame` called.

In particular, `gotoAndStop`/`gotoAndPlay` is called during
an "enterFrame" event handler, then unrelated objects on the Stage
will have their children constructed during the execution of
`gotoAndStop`/`gotoAndPlay`. The same logic holds for frame scripts.

This fixes a bug in Steamlands, which relies on children on the main
timeline being constructed immediately following a call to `gotoAndStop`
on an orphan (originally triggered from an "enterFrame" handler).
2023-06-08 22:17:27 -05:00
Crowdin Bot 650f872b19 chore: Update translations from Crowdin 2023-06-09 01:51:23 +02:00
Moulins fcd9935a81 desktop: Add `File > Reload` menu command
Also remove redundant `has_movie` parameter in `RuffleGui::update`
2023-06-09 00:42:03 +02:00
Moulins c1a3caefea desktop: point `Open Advanced`'s file dialog to the current file's directory 2023-06-09 00:42:03 +02:00
Moulins d7a056df8e desktop: keep options in-sync when using `Open` or drag-and-dropping a file 2023-06-09 00:42:03 +02:00
Moulins ac69926b5e desktop: add `Ctrl+Shift+O` shortcut for `Open Advanced` 2023-06-09 00:42:03 +02:00
Moulins 08fe4a4c94 desktop: Add button to clear all movie params. in `Open Advanced` 2023-06-09 00:42:03 +02:00
Moulins 5e1716d7e8 desktop: remember `Open Advanced` options across movie loads
Makes opening the same movie repeatedly less tedious.

Note that `Open` still ignore this and will use the default options
provided on the command-line.
2023-06-09 00:42:03 +02:00
Aaron Hill d44c9cceb1 wgpu: Cache compiled naga-agal shader module
We use an `lru::LruCache` inside `ShaderModuleAgal`. This automatically
gives us the proper garbage-collection behavior (when the Flash
Program3D instance is garbage collected, we'll drop the
`ShaderModuleAgal` and the cache).

The cache is keyed on the data needed to compile the shader (vertex
attributes and sampler overrides). This lets us avoid shader
recompilations when a Stage3D program repeatedly uses the same
Program3D with different sampler overrides / vertex attribute formats.
2023-06-08 02:57:47 -05:00
Lord-McSweeney 455b96710e avm2: Fix MouseCursorData.frameRate stubs 2023-06-07 22:39:41 -05:00
Aaron Hill 9d8ac81b58 avm2: Use WeakObject in `broadcast_list`
This ensures that we don't keep the underlying listener
object alive after all event listeners (including broadcast
listeners) have been unregistered.
2023-06-07 21:15:26 -05:00
EmperorBale 4815ca5e90 avm2: Implement WeakObject
This also adds a new required function to TObject called `downgrade`, that will convert the `Object` to a `WeakObject`.
2023-06-07 17:51:26 -07:00
EmperorBale 5e20b079d9 avm2: Add weak variant of every object 2023-06-07 17:51:26 -07:00
Toad06 8ce8b775a7 avm1: Fix coercion order in SWFv4 actions 2023-06-08 01:33:08 +02:00
Moulins 3f1bcecfbb avm1: Add version gate for `{MovieClip, Button}.blendMode`
Theses properties are only available on SWF >= 8
2023-06-08 01:18:06 +02:00
Moulins b71b8f9de5 avm1: fix coercions for the `blendMode` property of display objects
`mc.blendMode = 3` is a valid way of modifying the blend mode of a DO;
on the other hand, booleans and objects *shouldn't* be coerced.
2023-06-08 01:18:06 +02:00
Crowdin Bot 93f5869005 chore: Update translations from Crowdin 2023-06-08 00:57:49 +02:00
Aaron Hill 0e0399963e avm2: Throw exception when ExternalInterface is not available 2023-06-07 17:24:25 -05:00
Aaron Hill b240f05390 avm2: Stub Graphics.beginShaderFill 2023-06-07 17:06:33 -05:00
Daniel Jacobs 55efb80dd6 web: Don't try to use Ruffle on browsers with Flash support 2023-06-07 23:48:39 +02:00
Aaron Hill 1efcd584c2 avm2: Wrap orphan list in an `Rc` for correct iteration behavior
When we iterate over the orphan list to run frame lifecyle methods,
the orphan list may be modified (e.g. an event listener creates a new
orphan object). To ensure that we iterate over all of the orphans
originally present, this commit wraps the orphan list in an `Rc`
(just like we do for the render list). Modifications to the list use
`Rc::make_mut`, and iteration operates on a clone of the `Rc`.
2023-06-07 16:23:06 -05:00
Aaron Hill d2999a2572 core: Fix parsing of PixelBender sampleNearest and sampleLinear
This fixes a panic on startup for Sniper Team
2023-06-07 15:59:31 -05:00
Aaron Hill ccb5027de0 avm2: Preserve MultinameFlags::ATTRIBUTE when filling a lazy Multiname 2023-06-07 14:08:10 -05:00
Aaron Hill 638471fc2d avm2: Stub flash.printing.PrintJob 2023-06-07 03:47:29 -05:00
Aaron Hill 5fd7dc2c9b core: Correctly handle '.' and '<' in obfuscated QNames
QName can contain characters like '.' and '<' as part of the
package or class name (though this requires editing the SWF
or using a nonstandard compiler). This broke our attempt to parse
generic type paramters by looking for '.<'

Instead, our 'Vector' special casing now operates on the unparsed
'AVMString' name, instead of attempting to construct a 'QName'.
This means that we don't need to handle generic paramters at
all for obfuscated names (which will never start with '__AS3__'
or 'Vector.<')

This fixes a bug in Red Ball 4v3, which has an obfuscated class
'!D.<H'
2023-06-06 18:12:58 -05:00
Aaron Hill 0d5ead4c02 core: Ignore newer PlaceObject tag in same frame with duplicate depth
If we have two PlaceObject tags in the same frame with the same depth,
only the first one actually places an object. The second one is ignored
(Flash Player logs a warning).
2023-06-06 14:50:07 -05:00
Aaron Hill d037038170 avm2: Make `caller_domain` an `Option`, and call `expect` when actually needed
There are only a few places where we actually need to use the
`caller_domain`, so we don't actually need it available for most native
method calls. This means that `Activation::from_nothing` can be used
in the vast majority of cases without causing a panic later on.
2023-06-06 21:05:19 +02:00
Nathan Adams 10134467c9 avm2: Don't error on removeChildren() for empty containers - fixes #11382 2023-06-05 18:30:08 -05:00
Crowdin Bot 808deaa378 chore: Update translations from Crowdin 2023-06-05 09:00:51 +02:00
renovate[bot] f1fe998869 chore(deps): lock file maintenance rust dependencies 2023-06-04 22:53:18 -05:00
relrelb f62d80dd93 ci: Fix artifact download for AUR package
`actions/download-artifact` cannot be used because only macOS artifacts are uploaded using `actions/upload-artifact`.

Instead use `gh release download`, which mirrors `gh release upload`.
2023-06-03 23:56:06 +03:00
relrelb 9c8e212641 avm1: Migrate `GradientBevelFilter` to `NativeObject` 2023-06-03 21:33:12 +03:00