Commit Graph

1903 Commits

Author SHA1 Message Date
dependabot-preview[bot] 2fdb378e4f build(deps): bump syn from 1.0.44 to 1.0.45
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.44 to 1.0.45.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.44...1.0.45)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-17 13:00:00 -07:00
Nathan Adams a2d53df49c render: Store immutable part of wgpu rendering as a reusable object, to speed up exporting 2020-10-17 04:16:24 -07:00
David Wendt 6f659db342 tests: Fix the lazyinit test so that it actually passes on Ruffle 2020-10-17 03:32:09 -07:00
David Wendt 50d6ffb510 avm2: Prevent circularly referential scripts from causing stack overflows or double-borrows. 2020-10-17 03:32:09 -07:00
David Wendt a484861f79 tests: Add a test for lazy initialization load order. 2020-10-17 03:32:09 -07:00
David Wendt d27360b282 avm2: Enable lazy initialization for ABCs that request it. 2020-10-17 03:32:09 -07:00
David Wendt 0d1676afda avm2: Create a separate domain for each loaded movie and pull symbols out of each. 2020-10-17 03:32:09 -07:00
David Wendt cdab885979 avm2: Implement `ApplicationDomain` and all methods that don't require `Vector` or domain memory 2020-10-17 03:32:09 -07:00
David Wendt 1aceb7776d avm2: Superclasses should resolve out of the current scope stack. 2020-10-17 03:32:09 -07:00
David Wendt 00fcc5ffa4 avm2: Reference the current domain at the bottom of the scope stack. 2020-10-17 03:32:09 -07:00
David Wendt f2caf60d3e avm2: Scripts should run in a child of the global domain. 2020-10-17 03:32:09 -07:00
David Wendt 1792939212 avm2: Script scopes should hold the domains they are a part of.
Also, this means we have a `TObject` representation for domains now.
2020-10-17 03:32:09 -07:00
David Wendt 6a736b0d2b avm2: Wrap all player globals in a separate appdomain and script.
This entirely abolishes the "global scope object" in AVM2. I even had to redefine several global object functions to work with the bottom of the scope stack, which seems to be where ASC likes to stick the script scope.
2020-10-17 03:32:09 -07:00
David Wendt add7c4d43d avm2: Collect all script definition names and associated scripts into a `Domain`. 2020-10-17 03:32:09 -07:00
David Wendt 02e05e3d7f Add separate scope object for each script. 2020-10-17 03:32:09 -07:00
Mike Welsh 4558be948e render: Fix masking issues on wgpu/webgl backends
Change the usage of the stencil buffer to avoid running out of
stencil bits when too many nested masks are active.

This also cleans things up on wgpu which requires us to make
pipeline states in advice; now we only need a few stencil states
for masking as opposed to hundreds.
2020-10-17 02:42:56 -07:00
Mike Welsh 97a3ef73a3 tests: Add tests for issue #893 2020-10-15 00:10:55 -07:00
Mike Welsh e66b71817b avm1: Stop execution if base clip is removed (fix #893)
Stop execution of the current stack frame if the base clip was
removed (for example, due to a goto).
2020-10-15 00:10:55 -07:00
Nathan Adams 6d9155477c core: Add flashvars support - #312 2020-10-12 15:28:16 -07:00
Mike Welsh a6b952e44e core: Switch from libflate to flate2 2020-10-12 13:47:35 -07:00
Mike Welsh 2c2aa82730 chore: Remove debug message 2020-10-12 13:30:03 -07:00
Nathan Adams fd6431f724 core: Don't use std Instant as it doesn't work for web, use a wrapper 2020-10-11 13:34:15 -07:00
Nathan Adams 4abd02e2f7 core: Implement a timeout for script execution, defaulting to 15 seconds. Fixes #554 2020-10-11 13:34:15 -07:00
Mike Welsh 137ac2887e core: Don't mouse pick children when invisible (fix #1242) 2020-10-11 04:10:25 -07:00
Mike Welsh 2c9cf6802d core: Squelch false AS3 error before initial SWF loads 2020-10-10 19:28:01 -07:00
Mike Welsh 5c3dd25638 avm1: Avoid unwrap in Sound constructor
At least avoid the panic in this case, but it can possibly fail
(see #701).
2020-10-10 18:13:08 -07:00
dependabot-preview[bot] 2c2a70e714 build(deps): bump syn from 1.0.43 to 1.0.44
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.43 to 1.0.44.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.43...1.0.44)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-10 16:35:50 -07:00
Mike Welsh 23660e49c9 core: Avoid panic due to invalid style IDs
If the shape converter encountered a fill/line style with an
ID > the number of styles, Ruffle would panic as it tried to grab
the non-existent style. This could occur if we mis-parsed some
shape data, or the SWF contained incorrect data. Now we the invalid
style is gracefully ignored.
2020-10-10 16:35:37 -07:00
Mike Welsh 10aaae9247 chore: Appease nightly clippy 2020-10-10 00:03:25 -07:00
dependabot-preview[bot] 4af9632761 build(deps): bump syn from 1.0.42 to 1.0.43
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.42 to 1.0.43.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.42...1.0.43)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-09 12:22:43 -07:00
David Wendt 5abebd5433 avm2: Yield an error if the caller specifies a label/scene pair and the label is not present within the scene. 2020-10-06 06:03:22 -07:00
David Wendt 1a10f1e004 avm2: Lock old movies (SWFv8 and earlier) to always use AVM1 2020-10-06 06:03:22 -07:00
David Wendt 693e56dc67 core: Always instantiate a new movie's library before creating it's root movieclip. 2020-10-06 06:03:22 -07:00
David Wendt 7c719bfb0c Only the first tag in a SWF file should be trusted to deliver file attributes. 2020-10-06 06:03:22 -07:00
David Wendt ddccede9d3 avm2: Make VM type non-optional.
This has the side effect of forcing the AVM check to happen at the time of library construction, which is already very early on in movie loading.
2020-10-06 06:03:22 -07:00
David Wendt ef665acaec avm2: Movie clips not explicitly granted a `symbol_class` should be constructed using the `MovieClip` class directly 2020-10-06 06:03:22 -07:00
David Wendt 12cf8022cd core: Remove useless uses of `matches!`. 2020-10-06 06:03:22 -07:00
David Wendt 007d54b389 avm2: Remove redundant implementations of `prev_frame` and `next_frame` 2020-10-06 06:03:22 -07:00
David Wendt 4c44ca8e77 avm2: Non-integer numbers should be handled as strings and integer-parsible strings should be handled as numbers. 2020-10-06 06:03:22 -07:00
David Wendt e2f21d0a7d avm2: Retire old references to the "VM tendency" nomenclature 2020-10-06 06:03:22 -07:00
David Wendt 896a5b37a5 avm2: Implement `new MovieClip()`. 2020-10-06 06:03:22 -07:00
David Wendt d399811eb8 avm2: Allow `MovieClip` to be constructed by users. 2020-10-06 06:03:22 -07:00
David Wendt 50dd9a6733 avm2: Implement the programmatically-playing flag that governs `isPlaying` behavior. 2020-10-06 06:03:22 -07:00
David Wendt 035c841eb5 tests: Add tests for `gotoAndStop` and rename the `gotoAndPlay` one 2020-10-06 06:03:22 -07:00
David Wendt 1f29497b8c tests: Add test for AS3 movieclip play 2020-10-06 06:03:22 -07:00
David Wendt 8152400a39 avm2: Implement `MovieClip.scenes`. 2020-10-06 06:03:22 -07:00
David Wendt c682868205 avm2: Implement `MovieClip.currentScene` 2020-10-06 06:03:22 -07:00
David Wendt 2483201bcd avm2: Store the lengths of each scene in a movie. 2020-10-06 06:03:22 -07:00
David Wendt 8a13d5fe10 avm2: Implement `Scene` object. 2020-10-06 06:03:22 -07:00
David Wendt 5e31c44b81 All objects should default to `toString`ing with their own classname. 2020-10-06 06:03:22 -07:00