Commit Graph

2968 Commits

Author SHA1 Message Date
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
David Wendt de186ed5f3 avm2: Implement `MovieClip.currentLabels` 2020-10-06 06:03:22 -07:00
David Wendt 77a86aef9b avm2: Implement `FrameLabel`. 2020-10-06 06:03:22 -07:00
David Wendt 86b07c0007 tests: Add tests for `prevScene` and `nextScene`. 2020-10-06 06:03:22 -07:00
David Wendt 542147d657 avm2: Run all AVM2 frame scripts on the action queue.
This is the same way that AVM1 actions run and it appears that frame scripts work exactly the same way. It fixes all outstanding bugs with movie clip navigation in AVM2 and allows me to remove a lot of weird workarounds I was writing for the old, incorrect behavior.

I'm also removing the "last run script frame" rule as `run_frame_internal` already had rules to prevent stopped clips from rerunning actions.
2020-10-06 06:03:22 -07:00
David Wendt 996d7528d5 avm2: Implement `prevScene` and `nextScene`. 2020-10-06 06:03:22 -07:00
David Wendt 864c6a37f9 avm2: Dynamic properties should be retrievable before they are actually set. 2020-10-06 06:03:22 -07:00
David Wendt 6d0befad97 avm2: Implement `prevFrame` and `nextFrame`, with tests. 2020-10-06 06:03:22 -07:00
David Wendt bcf08b5bf7 avm2: Frame scripts should run when the frame number has changed, regardless of playhead state. 2020-10-06 06:03:22 -07:00
David Wendt 97048fb8bd avm2: Implement `stop` and `play`, with tests for the former. 2020-10-06 06:03:22 -07:00
David Wendt c8cd4d09cd core: Don't run frame scripts on stopped movie clips. 2020-10-06 06:03:22 -07:00
David Wendt 556c951b1c avm2: Implement `gotoAndPlay`/`gotoAndStop`, with test. 2020-10-06 06:03:22 -07:00
David Wendt 3513918149 avm2: Allow typechecking by prototype, rather than just by constructor. 2020-10-06 06:03:22 -07:00
David Wendt e837840bba core: Always skip frames after the current frame when getting the current scene or label. 2020-10-06 06:03:22 -07:00
David Wendt 5b83f6b4cc avm2: Add test for movieclip-specific properties. 2020-10-06 06:03:22 -07:00
David Wendt 3b6f8cff4e avm2: Implement `framesLoaded`, `isPlaying`, and `totalFrames`. 2020-10-06 06:03:22 -07:00
David Wendt 7ca34452a1 avm2: Implement `currentFrameLabel` and `currentFrame`. 2020-10-06 06:03:22 -07:00
David Wendt 6124ed468f core: Add `current_label` for getting the current label on a given clip.
This also fixes `current_scene` as well.
2020-10-06 06:03:22 -07:00
David Wendt c1b14b7639 avm2: Implement `currentFrame`. 2020-10-06 06:03:22 -07:00
David Wendt 7756fd530d core: Allow grabbing the movieclip's current scene, if scene labels are defined. 2020-10-06 06:03:22 -07:00
David Wendt d747ef7914 core: Store scene and frame labels generated by the `DefineSceneAndFrameLabelData` tag. 2020-10-06 06:03:22 -07:00
David Wendt 55fec14a1c tests: Add tests for timeline scripts. 2020-10-06 06:03:22 -07:00
David Wendt c04bf7d53c `addFrameScript` indexes by zero, not by one. 2020-10-06 06:03:22 -07:00
David Wendt ab45b9084d avm2: Parse `SymbolClass` package paths correctly. 2020-10-06 06:03:22 -07:00
David Wendt a1a21500d8 core: Warn when a movie clip is AVM2-constructed without an accompanying symbol class. 2020-10-06 06:03:22 -07:00
David Wendt 8c67260e68 core: Special-case ID 0 as the current movie timeline.
Note: This relies on the fact that SWF files do not stick `SymbolClass` declarations in child movieclips. If this isn't the case, then it will fail horribly, and we would then need to actually store clip 0 in the library somehow.
2020-10-06 06:03:22 -07:00
David Wendt f2c3466026 avm2: The AVM2 constructor should be an actual Class, not it's prototype. 2020-10-06 06:03:22 -07:00
David Wendt e915a07d4f core: ABC files should resolve at the time of discovery, not on the action queue. 2020-10-06 06:03:22 -07:00
David Wendt 7e898457b0 avm2: Implement `addFrameScript`. 2020-10-06 06:03:22 -07:00
David Wendt d991c49774 Implement `addFrameScript`. 2020-10-06 06:03:22 -07:00
David Wendt 664152d739 avm2: Mark `EventDispatcher` as implementing `IEventDispatcher`.
This doesn't actually implement any of it's methods yet, which *would* cause an error *if* we were verifying that.
2020-10-06 06:03:22 -07:00
David Wendt e72c9776ec avm2: Implement `IEventDispatcher`. 2020-10-06 06:03:22 -07:00
David Wendt c899b3080a avm2: Add function to unwrap a `StageObject` as it's underlying `DisplayObject`. 2020-10-06 06:03:22 -07:00
David Wendt a70e1be466 Add code to instantiate AVM2 movie clips correctly.
This also includes several bits to build an effective VM barrier.
2020-10-06 06:03:22 -07:00
David Wendt 247e79e61a core: Track the VM each movie has pledged to execute on.
This uses a "VM tendency" system wherein the presence of `DoAction` or `DoInitAction` tags defaults the movie to AVM1, while the presence of `DoABC` defaults to AVM2. The presence of a `FileAttributes` tag allows setting the VM tendency in the same manner using it's AS3 bit.

Particularly malformed SWFs may cause execution issues if Flash Player uses a dramatically different system from this.
2020-10-06 06:03:22 -07:00
David Wendt 3128bbcda6 core: Implement `SymbolClass` tag. 2020-10-06 06:03:22 -07:00
David Wendt edd31c4b83 core: Allow pulling the AVM2 Object out of a participating movie clip. 2020-10-06 06:03:22 -07:00
David Wendt f85319aa4c core: Allow `DisplayObject` to hold AVM2 objects.
This requires the use of an intermediary enum called `AvmObject` which can hold either object representation. Currently, it's mostly just being unwrapped as AVM1 objects, which we will need to fix.
2020-10-06 06:03:22 -07:00
David Wendt 63f411d231 avm2: Add `StageObject` object implementation for holding display objects in AVM2. 2020-10-06 06:03:22 -07:00
dependabot-preview[bot] 5f6e3ca3d4 build(deps): bump futures from 0.3.5 to 0.3.6
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 13:47:58 -07:00
dependabot-preview[bot] 3b98ee4c8e build(deps-dev): bump copy-webpack-plugin from 6.1.1 to 6.2.0 in /web
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v6.1.1...v6.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-04 13:10:09 -07:00
Mike Welsh a81f050e14 chore: Bump to winit 0.23 2020-10-04 13:04:27 -07:00
David Wendt 3fb186e5c0 avm1: Remove fscommand debug code 2020-10-01 13:53:00 -07:00