Commit Graph

5390 Commits

Author SHA1 Message Date
David Wendt c55bc96993 scanner: Clean up and document the `FileResults` type a bit 2021-09-11 09:52:40 -07:00
David Wendt 5e3eaba5f8 scanner: Include SHA256 hash in scan results 2021-09-11 09:52:40 -07:00
David Wendt d084cb116f scanner: Remove 16MB stacks, as they are no longer needed now that we are using multiple processes 2021-09-11 09:52:40 -07:00
David Wendt 3294ef17e4 scanner: Break the scanner up into multiple modules 2021-09-11 09:52:40 -07:00
David Wendt 7a71cce028 scanner: Break each movie out into a separate process.
Since forking isn't an option in Rust (and is generally unsafe, incompatible with threads, and more or less not UNIX's best design idea) we instead grab the current binary path and run it again with a different subcommand.

This should allow us to grab all the panics, including uncatchable ones.

Note: this also requires that we introduce an IPC mechanism. I currently decided to have it spit out CSV rows, same as the main `scan` command. This also makes the psuedo-fork subcommand arguably useful on it's own as it will dump timing metrics for each step.
2021-09-11 09:52:40 -07:00
David Wendt 263c1133c8 scanner: Add a `scan` subcommand 2021-09-11 09:52:40 -07:00
David Wendt 75f1b40925 scanner: Deduplicate repeated log messages 2021-09-11 09:52:40 -07:00
David Wendt a284d5d13b scanner: Record test duration (in milliseconds) 2021-09-11 09:52:40 -07:00
David Wendt a18d13833c scanner: Print partial results as they come out of the parallel iterator.
This relies on a proposed serial bridge as per https://github.com/rayon-rs/rayon/issues/858. As that project is licensed the same as Ruffle itself and the submitter intended it to be included in Rayon, I believe it's legal to copy this code.
2021-09-11 09:52:40 -07:00
David Wendt 46638b1be8 scanner: Set the default scanner thread size to 16MB.
Rayon's default of 2MB is about half of what the AVM1 recursion limit requires, and I have plenty of memory, so I might as well add some padding for long runs.
2021-09-11 09:52:40 -07:00
David Wendt b49ae66ff3 scanner: Run the first frame of every movie we scan.
This currently fails to scan the entire Flashpoint `localflash` directory because Rust considers stack overflow to be an immediate program termination, no ifs, ands, or buts about it.
2021-09-11 09:52:40 -07:00
David Wendt 2b061cdba6 scanner: Report what stage of the scan got to before any errors happened 2021-09-11 09:52:40 -07:00
David Wendt 1d0e418c5c scanner: Parallelize the scan process 2021-09-11 09:52:40 -07:00
David Wendt f9c646e51f scanner: Report decompression failures as errors instead of panicking. 2021-09-11 09:52:40 -07:00
David Wendt 074cc4bc8e scanner: Report the AVM version of every scanned file 2021-09-11 09:52:40 -07:00
Chris Midgley bd26790f5b
avm1: Fix `this` inside watchers (#5276)
* fix: fix 'this' inside watchers

* tests: test value of 'this' in watcher

* lint: cargo fmt
2021-09-11 15:15:16 +03:00
Mike Welsh 9978eaa954 chore: Bump to wasm-bindgen 0.2.77 2021-09-10 16:32:14 -07:00
relrelb 923201d2e4 chore: Appease clippy 2021-09-10 15:42:37 +02:00
Chris Midgley 3e04c2b0d2 dev: remove allow unused mut and corresponding mut 2021-09-09 19:06:49 -06:00
Daniel Jacobs 5ac9796ffd web: Support salign, quality, & scale embed/object attributes (part of #4258) 2021-09-08 16:25:47 -07:00
relrelb 3aeffce365 desktop: Refactor clap settings
* Fix #5252 by passing `multiple_occurrences = true`.
* Remove `case_insensitive = true`.
* Reformat comments a bit.
2021-09-08 16:04:09 -07:00
Tal Hayon 7d6eaf127d core: Fix EditText width and height scaling (close #3001) 2021-09-08 02:39:01 -07:00
relrelb acd462745d web: Fix `publicPath()` being called from non-global scope
`document.currentScript` works only while the script is initially
being processed. This means that when `publicPath()` was called from
a non-global scope, it failed to detect where ruffle.js is located,
which in turn failed to determine the .wasm location.
2021-09-08 02:25:05 -07:00
relrelb 375269417f web: Set `__webpack_public_path__` in `load-ruffle.ts`
Use wasm-bindgen's built-in loader instead of relying on Webpack.
In order to still respect the `publicPath` config, set
`__webpack_public_path__` just before fetching the WebAssembly module.
This allows to no longer declare `.wasm` files as resource assets in
each `webpack.config.js`.
2021-09-08 02:25:05 -07:00
relrelb 28a155a099 web: Remove `config.publicPaths`
This simplifies the `publicPath` function and makes it useable inside
`fetchRuffle`.

Assuming `publicPaths` isn't used anywhere, this shouldn't be harmless.
2021-09-08 02:25:05 -07:00
relrelb c2fcc03c35 avm1: Remove `TObject::get_local` in favor of `TObject::get_local_stored`
`get_local` is basically equivalent to `get_local_stored` that also
handles virtual getters. So instead handle virtual getters in
`search_prototype`. This allows to inline the `get_local_sub` helper
methods into the implementations of `get_local_stored`.
The remaining usages of `get_local` were not exactly correct as they
all should ignore virtual getters. This change solves this as well
by using `get_local_stored` that ignores virtual getters.
2021-09-08 12:21:17 +03:00
relrelb 1f96c2fcb8 audio: Small cleanup 2021-09-07 18:28:17 -07:00
relrelb 65205ac6d7 audio: Store sound transform values in 30-bit integers
It seems like Flash stores sound transform values in 30-bit unsigned integers:
* Negative values are equivalent to their absolute value.
* Specifically, 0x40000000, -0x40000000 and -0x80000000 are equivalent to zero.
2021-09-07 18:28:17 -07:00
Chris Midgley 868706d775
avm1: call watcher, if defined, from virtual properties on prototype (#4827)
* avm1: extract get_watcher

* tests: add tests for TextField text watch

* avm1: call the watcher, if defined, from call_setter

* dev: shadow variable to avoid unused mut warning

* dev: remove value mutability

* chore: cargo fmt

* dev: unify virtual and stored property watcher cases

* tests: add test for watching prototyped property

* feat: when getting old values, ascend the proto chain ignoring virtual properties

* chore: lint

* dev: share complicated code

* chore: Small cleanups

Co-authored-by: relrelb <relrelbachar@gmail.com>
2021-09-08 03:41:18 +03:00
Tal Hayon e7bff63149 web: check array_buffer promise for failure 2021-09-07 16:59:01 -07:00
Mike Welsh 483995823f core: Add symphonia as optional MP3 decoder
Add symphonia_mp3 feature to enable symphonia as an MP3 decoder.
This is a pure Rust MP3 decoder that could be used on web.
2021-09-07 16:48:34 -07:00
Mike Welsh 94d02fa653 core: Add AudioMixer to core
Pull out the audio mixing code from desktop and add it to core.
This will allow other backends to use it (such as the web audio
backend) to get consistent audio across all platforms.
2021-09-07 16:48:34 -07:00
Tal Hayon 4625ca0e0b web: fix base param 2021-09-07 16:45:35 -07:00
dependabot[bot] b90436cffe build(deps): bump thiserror from 1.0.28 to 1.0.29
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.28 to 1.0.29.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.28...1.0.29)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 14:34:19 -07:00
dependabot[bot] 5e07d4e464 build(deps): bump syn from 1.0.75 to 1.0.76
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.75 to 1.0.76.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.75...1.0.76)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 14:33:56 -07:00
Chris Midgley d34d8457ea dev: Only test beta rust on ubuntu 2021-09-06 17:35:03 +02:00
Adrian Wielgosik 9bd0b624fd avm2: Add more Event class stubs and constants 2021-09-05 11:56:21 +02:00
David Wendt bc4f790031 avm2: Stub `SoundMixer.areSoundsInaccessible` and `SoundMixer.computeSpectrum` 2021-09-03 16:47:02 -06:00
David Wendt 34fe35a998 avm2: Impl `SoundMixer.bufferTime` 2021-09-03 16:47:02 -06:00
David Wendt 364ee62c92 avm2: Impl `SoundChannel`'s `soundComplete` event.
This includes a test that is currently ignored because `NullAudioBackend` can't fire complete events.
2021-09-03 16:47:02 -06:00
David Wendt d5718fe408 avm2: Initialize all sounds and channels at time of allocation 2021-09-03 16:47:02 -06:00
David Wendt efcab92d97 avm2: Impl `SoundMixer.stopAll` 2021-09-03 16:47:02 -06:00
David Wendt d73ba586d0 avm2: Impl `SoundChannel.stop()` 2021-09-03 16:47:02 -06:00
David Wendt 39305f6a38 avm2: Implement `SoundChannel.soundTransform` 2021-09-03 16:47:02 -06:00
David Wendt 9c6c64e4e3 core: `NullAudioBackend` should falsely report all sounds as not playing, like the real backends
This prevents sounds from being removed from the `AudioManager`, which allows sound transforms to be placed on them in tests.
2021-09-03 16:47:02 -06:00
David Wendt 6b7609ff4e avm2: Stub `SoundChannel.position`.
This also comes with an ignored test for `position`, because I originally believed this to be implementable.
2021-09-03 16:47:02 -06:00
David Wendt 4e77f89e0f avm2: Stub `SoundChannel.leftPeak` and `SoundChannel.rightPeak` 2021-09-03 16:47:02 -06:00
David Wendt 50092e6c04 avm2: Stub all remaining `Sound` methods. 2021-09-03 16:47:02 -06:00
David Wendt b6167c2f86 avm2: Allow playing sounds with a given `SoundTransform`. 2021-09-03 16:47:02 -06:00
David Wendt 5771d4c826 avm2: Deduplicate the sound transform conversion code 2021-09-03 16:47:02 -06:00