Commit Graph

11555 Commits

Author SHA1 Message Date
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
David Wendt 7deb33c231 Fail remote SWF loads rather than jamming a download in the user's face 2019-09-16 20:04:30 -07:00
David Wendt 63e1484d38 Support legacy `GetURL`/`GetURL2` actions 2019-09-16 20:04:30 -07:00
David Wendt 359d3e4780 Propagate the RNG to the action context. This lets random work. 2019-09-16 20:04:30 -07:00
David Wendt 26c928b68f Add a better error message for missing object methods 2019-09-16 20:04:30 -07:00
David Wendt 70d4f6c7c2 Implement more math builtins.
Random is currently a stub.
2019-09-16 20:04:30 -07:00
David Wendt 4e9fb2676b Add `getURL` global builtin 2019-09-16 20:04:30 -07:00
David Wendt 0f9db1744b Add a backend for controlling the enclosing web browser. 2019-09-16 20:04:30 -07:00
Mike Welsh 2d2b473fe1 core: Clean up MovieClip::place_object 2019-09-16 22:03:34 -05:00
Mike Welsh f0e345bea8 core: Improve handing of gotos (fix #33)
Display objects will now properly persist during gotos instead
of erroneously being recreated.
2019-09-16 22:03:34 -05:00
Mike Welsh 4222701c9c chore: cargo fmt 2019-09-15 11:44:18 -07:00
Mike Welsh 94afcfb2e1 core: Add DisplayObject::id 2019-09-15 11:35:04 -07:00
David Wendt 4502ad54c2 Allow dynamic interdiction to apply to object/embed tags directly 2019-09-14 15:15:26 -05:00
David Wendt a942eb3ab2 Support data parameter for SWF url. 2019-09-14 15:15:26 -05:00
Mike Welsh 37191dc489
docs: Add nightly build and wiki links to README 2019-09-14 01:13:18 -07:00
Mike Welsh ef73fa1794 docs: Add CONTRIBUTING.md 2019-09-14 01:02:13 -07:00
Mike Welsh 1b04015326 avm1: Don't include code length in DefineFunction
The code length is not included in the length of the DefineFunction
action in Writer.

Add test for DefineFunction.
2019-09-13 21:54:41 -07:00
Mike Welsh dbbeccaacd web: More accurate radial gradients on canvas 2019-09-12 01:02:46 -07:00
David Wendt 84759f8cea Fix our previous changes to the Ruffle core loader so that both the extension and demo work 2019-09-11 20:28:58 -04:00
Mike Welsh df8177d2e1 destkop: Fix garbage colors in gradients
Gradients could render with uninitialzied memory (usually colors
from previous gradients). Now the interpolation value is clamped
in the shader to prevent out-of-bounds access of the gradient
colors array.

This will be cleaned up further when the rendering backend
switches to gfx-rs.
2019-09-10 22:50:23 -07:00
Mike Welsh 37063b4a96 desktop: Clear stencil buffer when overflowing stencil mask 2019-09-09 20:42:08 -05:00
Mike Welsh 8fcee704c0 chore: cargo fmt 2019-09-09 20:42:08 -05:00
Mike Welsh ce9a0a8ef6 web: Initial masking support
Also add web/src/utils.rs for some methods to ease management
of errors for wasm_bindgen.
2019-09-09 20:42:08 -05:00