Commit Graph

4090 Commits

Author SHA1 Message Date
relrelb beff73b815 core: Small refactor 2021-01-29 13:05:37 -08:00
dependabot-preview[bot] fd4cafb377 build(deps-dev): bump webpack from 5.18.0 to 5.19.0 in /web
Bumps [webpack](https://github.com/webpack/webpack) from 5.18.0 to 5.19.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.18.0...v5.19.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-29 11:43:26 -08:00
dependabot-preview[bot] 67f793549e build(deps): bump flate2 from 1.0.19 to 1.0.20
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.19 to 1.0.20.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.19...1.0.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-29 11:43:05 -08:00
dependabot-preview[bot] 047baa8d38 build(deps): bump svg from 0.8.2 to 0.9.0
Bumps [svg](https://github.com/bodoni/svg) from 0.8.2 to 0.9.0.
- [Release notes](https://github.com/bodoni/svg/releases)
- [Commits](https://github.com/bodoni/svg/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-29 11:42:46 -08:00
dependabot-preview[bot] 6f14490f84 build(deps): bump jpeg-decoder from 0.1.21 to 0.1.22
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.1.21 to 0.1.22.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.1.21...v0.1.22)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-29 11:42:19 -08:00
Mike Welsh 477fa06daf avm1: Fix off-by-one error in String.lastIndexOf
Fixes #2873.

Co-authored-by: Toad06 <gd.productions@laposte.net>
2021-01-29 02:59:14 -08:00
Mike Welsh 92e4d781e7 tests: Add test for #2870 2021-01-28 16:36:42 -08:00
Mike Welsh 008f0f596c core: Clip event slices are from parent movie in PlaceObject
Since 19034b7, clip event scripts are returned as slices from the
SWF. This caused a panic when a movie was loaded into a clip,
because the loaded clip's `movie` would be used as the source for
clip events. However, clip events are placed by the parent's
PlaceObject tags, so the movie in this case should be the parent's
movie.

Fixes #2870.
2021-01-28 16:36:42 -08:00
Mads Marquart bb4240ad1f chore: Add a few comments about unsafe usage 2021-01-28 14:39:35 -08:00
Mads Marquart 39aa7536df core: Remove unsafe NonZeroU32 creation in shape utils 2021-01-28 14:39:35 -08:00
Mads Marquart 8eddde76a2 swf: Add safe and simpler string parsing 2021-01-28 14:39:35 -08:00
Mads Marquart 6772f96469 desktop: Use slice unpacking instead of unsafe get_unchecked 2021-01-28 14:39:35 -08:00
dependabot-preview[bot] 57491ff287 build(deps): bump embed-resource from 1.4.1 to 1.5.0
Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases)
- [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.4.1...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-28 12:30:10 -08:00
Mike Welsh 5e0527c599 desktop: Fix sound envelopes to use proper positions
The points in an SWF sound envelope are always in 44.1KHz. The
desktop audio backend would end up using this points in the sound's
sample rate, often causing the envelope to be delayed.

Now the envelope is applied after resampling, and the positions
are scaled based on the output sample rate.
2021-01-27 16:16:30 -08:00
Mike Welsh 0f5bab3e78 core: Use dirty flag for updating sound transforms 2021-01-27 15:25:04 -08:00
Mike Welsh 7eb5389630 core: Avoid vec allocation in AudioManager::update_sounds 2021-01-27 15:25:04 -08:00
Mike Welsh a4699a3ca5 audio: Sound transforms apply to stream sounds
This unifies the code path for event sounds and stream sounds.
Both `AudioBackend::start_stream` and `start_sound` return a
`SoundHandle`. `stop_stream` is removed (`stop_sound` can be
used for both cases).

Also removes references to `CharacterId` from the `AudioBackend`
(instead, an increasing ID is returned to identiy streams while
loading).
2021-01-27 15:25:04 -08:00
Mike Welsh 4c33464115 tests: Add test for Sound 2021-01-27 15:25:04 -08:00
Mike Welsh 95ce2abf17 audio: Remove AudioBackend::stop_sounds_with_handle/is_sound_playing_with_handle 2021-01-27 15:25:04 -08:00
Mike Welsh da2dd3b36c core: Implement sound transforms and Sound.setPan 2021-01-27 15:25:04 -08:00
Mike Welsh 98e6c54c3b avm1: Implement Sound.onSoundComplete 2021-01-27 15:25:04 -08:00
Mike Welsh 34f60b127a core: Add AudioManager to handle actively playing sounds
Add an AudioManager struct to handle this list of actively playing
sounds. This will maintain information for each sound instance,
such as the owning display object, AVM1 object, etc.

This will allow us to implement the awkward AVM1 Sound API in a
fairly backend-agnostic way.
2021-01-27 15:25:04 -08:00
TÖRÖK Attila a89eb6b9b8 avm1: Implement BitmapData.perlinNoise() 2021-01-27 11:53:05 -08:00
Omar Shehata 218f1f1da5 web: Pause player when tab is inactive (close #347) 2021-01-26 22:34:43 -08:00
dependabot-preview[bot] 383e0d4bb1 build(deps): bump log from 0.4.13 to 0.4.14
Bumps [log](https://github.com/rust-lang/log) from 0.4.13 to 0.4.14.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.13...0.4.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 22:28:43 -08:00
Adrian Wielgosik 937b371e30 core: Support grayscale JPEGs 2021-01-26 17:14:27 -08:00
Adrian Wielgosik 9195491f1b web: Redesign the context menu 2021-01-26 17:12:43 -08:00
Mads Marquart 4c3783b6ff desktop: Also use flashvars parameters when running local files 2021-01-26 16:27:20 -08:00
dependabot-preview[bot] a0159a5efa build(deps-dev): bump webpack from 5.17.0 to 5.18.0 in /web
Bumps [webpack](https://github.com/webpack/webpack) from 5.17.0 to 5.18.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.17.0...v5.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 12:44:56 -08:00
dependabot-preview[bot] 8172ddb1ba build(deps): bump rand from 0.8.2 to 0.8.3
Bumps [rand](https://github.com/rust-random/rand) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 08:52:20 -08:00
dependabot-preview[bot] 7856cdd3d7 build(deps): bump serde from 1.0.122 to 1.0.123
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.122 to 1.0.123.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.122...v1.0.123)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 14:14:33 -08:00
dependabot-preview[bot] 9dfe21eda4 build(deps-dev): bump @typescript-eslint/eslint-plugin in /web
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.14.1/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 14:10:31 -08:00
dependabot-preview[bot] 320b54ef57 build(deps-dev): bump @typescript-eslint/parser in /web
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.14.1/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 13:27:01 -08:00
Mike Welsh 44bfd46bf9 chore: Lock wasm-bindgen and wasm-bindgen-cli to 0.2.69 2021-01-25 12:27:21 -08:00
relrelb aeda974143 web: Rename contextMenu to contextMenuElement
Firefox has a read-only "contextMenu" property, so avoid
shadowing it.
2021-01-25 03:51:50 -08:00
relrelb b07eb07afb web: Revert config removal 2021-01-25 03:51:50 -08:00
relrelb 5827801b03 web: Rename config.showContextMenu to config.contextMenu 2021-01-25 03:51:50 -08:00
relrelb 70326108b9 web: Rename "right click menu" to "context menu" 2021-01-25 03:51:50 -08:00
relrelb 21b0128bca web: Add option to disable the context menu 2021-01-25 03:51:50 -08:00
Andrew Larson f34bdb045d demo: Fix player not being destroyed when None is selected
Fix issue with duplicate instances in web demo when sample SWF
is unloaded.
2021-01-25 03:31:24 -08:00
Mads Marquart ad137a2377 desktop: Change Windows Subsystem to not launch unnecessary console
Basically just copied from what alacritty is doing:
530de00049/alacritty/src/main.rs

There are two functional changes:
- When launching normally, you no longer see a console window quickly flashing
- When launching via. console, the program is detached (but still logs to the console)
2021-01-25 01:31:14 -08:00
Mike Welsh 306d2ead7f core: Avoid panic in EditText::on_changed (fix #2809) 2021-01-24 19:52:30 -08:00
Mads Marquart 5d887861da desktop: Fix windows cross compilation of assets 2021-01-24 18:11:48 -08:00
dependabot-preview[bot] 64983cde22 build(deps): bump serde from 1.0.121 to 1.0.122
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.121 to 1.0.122.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.121...v1.0.122)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-24 17:26:09 -08:00
dependabot-preview[bot] 32fd3fb71b build(deps): bump syn from 1.0.59 to 1.0.60
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.59 to 1.0.60.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.59...1.0.60)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-24 14:23:03 -08:00
paq e9ad1587a4 chore: Rename Namespace::public_namespace to Namespace::public 2021-01-24 11:53:43 -08:00
paq b58fcf3b05 chore: Use Namespace::public_namespace() instead of Namespace::package("") 2021-01-24 11:53:43 -08:00
dependabot-preview[bot] 239ccb3511 build(deps): bump jpeg-decoder from 0.1.20 to 0.1.21
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.1.20 to 0.1.21.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-24 11:52:39 -08:00
dependabot-preview[bot] ef428d95a7 build(deps): bump lyon from 0.17.3 to 0.17.4
Bumps [lyon](https://github.com/nical/lyon) from 0.17.3 to 0.17.4.
- [Release notes](https://github.com/nical/lyon/releases)
- [Changelog](https://github.com/nical/lyon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nical/lyon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-23 19:08:26 -08:00
dependabot-preview[bot] 86b4c20809 build(deps): bump serde from 1.0.120 to 1.0.121
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.120 to 1.0.121.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.120...v1.0.121)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-23 14:12:08 -08:00