Commit Graph

527 Commits

Author SHA1 Message Date
Mike Welsh 65866842a7 swf: Change respoitory URL in swf crate 2019-10-03 00:27:47 -07:00
Mike Welsh 336eace45e chore: Delete old dotfiles from swf-rs 2019-10-03 00:26:23 -07:00
Mike Welsh 52b6832db2 chore: Move swf-rs to ruffle workspace
Move the swf-rs crate into the Ruffle workspace proper instead of
having a separate repo. This makes it easier to make changes to
the SWF parsing code during development. swf-rs can still be
published as its own crate from the subfolder.
2019-10-02 18:58:58 -07:00
Mike Welsh 0de44d61b3 Merge swf-rs into ruffle repo
git-subtree-dir: swf
git-subtree-mainline: 2740f3ccc1
git-subtree-split: 1b04015326
2019-10-02 17:25:30 -07:00
Mike Welsh 2740f3ccc1 chore: Globally allow clippy::unneeded_field_pattern
Often times we want to explicty destructure instead of using ..
because the compiler will emit errors if the structure changes.

(see https://github.com/rust-lang/rust-clippy/issues/1741 and #69)
2019-10-02 12:57:58 -07:00
Mike Welsh 8a43523c27
Merge pull request #69 from Dinnerbone/feature/virtual_properties
Allow for dynamic properties in Object
2019-10-02 12:46:46 -07:00
Mike Welsh b157354fef chore: Fix clippy lints 2019-10-02 12:39:04 -07:00
Nathan Adams 2b54791cbb Changed storage of object values to allow for dynamic (vs stored) properties 2019-10-02 10:49:08 -07:00
Will Brindle bd5bed0327 Get rid of constant from atan2 test and remove now unneeded clippy directives 2019-09-30 10:38:42 -07:00
Will Brindle 5a36e4d78e Fix remaining tests 2019-09-30 10:38:42 -07:00
Will Brindle abe80806ab Use f64 methods for tests to resolve rounding errors 2019-09-30 10:38:42 -07:00
Mike Welsh e0811be40d avm1: Fix Random action 2019-09-27 19:32:22 -07:00
Mike Welsh c8cec3132f avm1: Fix GotoFrame2 one-frame-off error
Frame numbers pushed/popped from the stack for GotoFrame2 are
1-based. This differs for GotoFrame which is 0-based and encodes
the frame alongside the instruction.
2019-09-27 18:09:52 -07:00
Mike Welsh 1c88de5132 avm1: Fix doc typo 2019-09-27 17:58:40 -07:00
Mike Welsh 67506e54ca avm1: Remove debug print 2019-09-27 17:57:37 -07:00
Mike Welsh 646ad967a2 avm1: Fix Subtract action 2019-09-27 17:56:34 -07:00
Mike Welsh 4ec8765f7f avm1: Fix Subtract action 2019-09-27 17:32:51 -07:00
Mike Welsh 06d91a2b0d avm1: Stub out CloneSprite/RemoveSprite 2019-09-27 17:28:14 -07:00
Mike Welsh 5ee7b9c8aa avm1: Use into_number_v1 for GetProperty (fix #55)
Flash 4 published actions using Strings, so `into_number_v1`
should be used to coerce them to numbers.
2019-09-27 17:21:50 -07:00
Mike Welsh c1f521cfba web: Fix color transforms not working when canvas is reused
On the web demo, if you played two different SWFs, color transforms
would stop working because the color matrix SVG filter would be
created twice with the same ID. Now we properly remove the previous
filter.
2019-09-27 16:20:25 -07:00
Mike Welsh fcfcf0407d core: Fix stop sound events 2019-09-27 13:50:03 -07:00
Mike Welsh 9fc18fdb6a web: Clean up web audio backend
Change naming to more closely match the desktop backend.
2019-09-27 13:50:03 -07:00
Mike Welsh af163d9183 core: Support start, stop, event sounds in audio backend
Event sounds on the timeline in Flash have a "sync" setting,
which allows them to stop other sounds or only play if the
sound is not already playing.
2019-09-27 13:50:03 -07:00
Mike Welsh 875f250b86 chore: cargo fmt for 1.38 2019-09-26 12:25:07 -07:00
Mike Welsh 6247d5d027 chore: Remove deprecated clippy lint 2019-09-26 12:24:59 -07:00
Mike Welsh 8c2113bbdf chore: cargo fmt pcm.rs 2019-09-26 11:46:44 -07:00
Mike Welsh b38552204d chore: cargo fmt 2019-09-26 11:45:45 -07:00
David Wendt a0ed4d339d Add fscommand checking to `ActionGetUrl2`. 2019-09-20 21:38:37 -04:00
David Wendt b61f264ac7 Add a check for `fscommand:` URLs 2019-09-20 15:11:33 -04:00
Mike Welsh c2eb96eed0 core: Fix incorrect clamping in ADPCM decoder
Caused artifacts in ADPCM encoded audio.
2019-09-19 11:05:27 -07:00
Mike Welsh 547da84c9c core: Add stop_all_sounds to audio backend
Implemented in web and desktop.
2019-09-19 00:47:05 -07:00
Mike Welsh 1f0e43c3bd web: Support event sound looping and start/end points 2019-09-19 00:47:05 -07:00
Mike Welsh e052a70a5a desktop: Support looping and start/end points for event sounds
Renamed `AudioBackend::play_sound` to `start_sound`, and this
also takes a `SoundInfo` parameter with the event sound settings
from the SWF file.

Desktop now obeys the loop and start/end point settings. Envelopes
are still TODO.
2019-09-19 00:47:05 -07:00
Mike Welsh 9c8721c127 core: Drop rodio and use only cpal for audio backend
Drop the rodio dependency and directly use cpal for the audio
backend. Use the sample crate for audio mixing and resampling.
2019-09-19 00:47:05 -07:00
Mike Welsh 3b5820f365 webdemo: Add min-height to nav bar for Safari 2019-09-17 23:29:21 -07:00
Mike Welsh be0bb0b803 core: Fix looping movieclips 2019-09-17 19:24:55 -05:00
Mike Welsh a331c565b3 core: More goto fixes 2019-09-17 19:24:55 -05:00
Mike Welsh ae80900f17 core: Add tellTarget regression test 2019-09-17 12:51:44 -05:00
Mike Welsh 7b63dc05c4 core: Initial implementation of SetTarget2
Implement the SetTarget2 action, which pops the target off of the
stack, and GetProperty 11, which pushes _target.

However, our implementation of _target is not accurate yet,
because it requires dynamically building the target path. Currently
we fake it by caching the last path to tellTarget.
2019-09-17 12:51:44 -05:00
Mike Welsh 856a4c6130 core: Improve TellTarget support
The AVM1 contains an explicit "target clip" that is used for older
Flash 4-era actions. This target clip can be set to an invalid
value, at which point Play, Stop, etc. will fail silently.

For GetVariable and SetVariable, if the target is invalid,
the variables will be modified on root ("/").
2019-09-17 12:51:44 -05:00
Mike Welsh 305950661f
Merge pull request #54 from kmeisthax/avm-webmethods
AVM1 browser interactions
2019-09-17 00:37:50 -05:00
Mike Welsh 82c1116c42 chore: cargo fmt 2019-09-16 20:37:11 -07:00
David Wendt 4250015420 Add query support for desktop and resolve some TODOs 2019-09-16 20:04:30 -07:00
David Wendt f00e938299 Clean up unused functionality in preparation of a PR. 2019-09-16 20:04:30 -07:00
David Wendt b40b10daf6 Support form submission from `getURL` function 2019-09-16 20:04:30 -07:00
David Wendt 58ce10ea67 Support form submission from Flash. 2019-09-16 20:04:30 -07:00
David Wendt eb1b474528 Propagate AVM locals to `NavigationBackend`. 2019-09-16 20:04:30 -07:00
David Wendt 130d9736bc Allow builtins access to the AVM1 state directly. 2019-09-16 20:04:30 -07:00
David Wendt 65586cbcf5 Allow SWFs to open websites from the desktop 2019-09-16 20:04:30 -07:00
David Wendt e952d20976 Open the window asked for, if specified 2019-09-16 20:04:30 -07:00