Commit Graph

53 Commits

Author SHA1 Message Date
TÖRÖK Attila d153290fd6 nits: Fix a whole bunch of typos all over the place 2024-01-17 23:59:19 +01:00
Kornelius Rohrschneider 687c0e7516 core: Complete MovieClip error state & Change uncompressed_len to i32
Previously, the MovieClip error state contained one TODO in order to be
completely implemented: The HeaderExt variable uncompressed_len needs to
be -1 in the error state, but its type has been u32.
The type has now been changed to i32, and the variable is set to -1 in
the default_error_header function. Therefore, the MovieClip error state
is now fully implemented.

Other connected functions and variables like SwfMovie::uncompressed_len
or MovieClip::total_bytes have been adjusted to this type change. Code
has been adjusted if needed where this value is used.
2023-07-17 00:08:02 +02:00
Aaron Hill c597f9f996 core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
AsukaMinato b40adc7568 remove the no-used import 2023-01-23 10:22:12 +01:00
AsukaMinato 7e89e7b411 reduce some indents. 2023-01-23 10:22:12 +01:00
Nathan Adams 7a9e8b4771 core: Made NullNavigatorBackend no longer use unwraps 2023-01-10 11:10:46 +01:00
relrelb bd9078addf chore: Fix `clippy::uninlined_format_args` lints 2022-12-15 08:59:38 +02:00
Adrian Wielgosik 0861153626 swf: make Clippy happy 2022-12-03 22:18:22 +01:00
relrelb 89f3445d62 swf: Introduce and use `Rectangle::width()` and `Rectangle::height()` 2022-11-01 09:49:04 +02:00
Aaron Hill 68471723b3 core: Fix clippy format string lint 2022-10-27 08:49:39 +03:00
relrelb a9dedf759a chore: Fix `clap` update
As described in https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#400---2022-09-28.
2022-10-05 21:33:34 +03:00
David Wendt 0eff0bf91a core: Remove all synchronous preloading from core.
Backends that need synchronous preload behavior now explicitly ask for it as follows:

 * `tests` - repeatedly call `preload` in a loop with an exhausted execution limit to stress-test the chunked preload
 * `exporter`, `scanner` - synchronous/unlimited preload to match prior behavior

These may change in the future.
2022-09-15 19:14:41 -06:00
CUB3D 05bfa3770e chore: Fix warnings with cargo doc 2022-08-08 20:20:18 +03:00
relrelb ee89010dd9 scanner: Fix update of `indicatif`
Use `ProgressStyle::with_template` as demonstrated in `indicatif`'s
examples, alongside some nearby cleanups.
2022-08-06 10:52:42 +03:00
relrelb 13a0eb3d92 scanner: Fix `path-slash` update
As mentioned in the [CHANGELOG.md](https://github.com/rhysd/path-slash/blob/master/CHANGELOG.md#v020---05-jul-2022),
`to_slash_lossy` now returns `Cow<'_, str>` instead of `String`.
2022-07-12 00:24:50 +03:00
relrelb 4978158638 chore: Resolve `clap` deprecation warnings
As suggested in https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#320---2022-06-13.
2022-06-17 07:58:21 +03:00
Mike Welsh 1eb06908c8 core: Make PlayerBuilder::build infallible 2022-04-29 09:14:32 -07:00
Mike Welsh f48182ef3d core: Add various settings to PlayerBuilder 2022-04-29 09:14:32 -07:00
Mike Welsh e1e2b1008a core: Add PlayerBuilder 2022-04-29 09:14:32 -07:00
relrelb 7497fb7008 core: Change `Player::set_root_movie` to accept a `SwfMovie`
Move the `Arc::new` to within the function.
2022-04-08 15:16:25 -07:00
relrelb 161071e8c4 core: Re-implement `NullExecutor`
Make it a thin abstraction layer over either the `futures` or `wasm-bindgen-futures`
crates, as already done in `render/wgpu/src/uniform_buffer.rs`,
instead of a hand-made single-thread executor.

Ideally this would also be usable on desktop, but I didn't manage to
get `LocalPool` working with `winit` (it needs to post a task to the
`EventLoopProxy` as a wake procedure).
2022-03-26 10:03:42 -07:00
relrelb 031126a1b8 core: Remove `LocaleBackend`
Previously there were 3 implementations of `LocaleBackend`:
`DesktopLocaleBackend`, `WebLocaleBackend` and `NullLocaleBackend`.

While `DesktopLocaleBackend`, `WebLocaleBackend` were identical,
`NullLocaleBackend` always returned a fixed date/time for tests
determinism.

Unify them in a single file, and use `cfg!(test)` and a new dedicated
`deterministic` feature to decide whether to mock date/time or not.
This should not cause any behavioral changes.
2022-03-16 19:57:53 +02:00
David Wendt 2aee3555ab chore: Fix all new clippy lints added in latest Rust nightly 2021-12-17 20:53:26 -07:00
Mike Welsh 8ae8de4d51 chore: Appease clippy
Squelch some false positives from `question_mark` and
`match_str_case_mismatch` lints.
2021-10-24 15:33:09 -07:00
dependabot[bot] 40aeffb91d build(deps): bump clap from 3.0.0-beta.4 to 3.0.0-beta.5
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.0-beta.4 to 3.0.0-beta.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 14:50:19 -07:00
David Wendt 3c229e462a scanner: For some reason, analysis reports get cut off if I don't add another newline 2021-09-11 09:52:40 -07:00
David Wendt a180aba613 scanner: Don't reset progress when the iterator has yet to complete 2021-09-11 09:52:40 -07:00
David Wendt 400938180b scanner: Remove duplicate CSV header 2021-09-11 09:52:40 -07:00
David Wendt f7a4593ab4 scanner: Add post-scan progress analysis 2021-09-11 09:52:40 -07:00
David Wendt d08d2ec783 Actually copy all the file results field from the child into the parent 2021-09-11 09:52:40 -07:00
David Wendt 9bb5229e14 scanner: Report compressed and uncompressed file size of each SWF 2021-09-11 09:52:40 -07:00
David Wendt 37f084e3e0 scanner: Include other SWF header information in the scanner output. 2021-09-11 09:52:40 -07:00
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
dependabot[bot] 860f26ef7d chore: Bump indicatif from 0.15.0 to 0.16.0
Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 15:37:40 -07:00
Mike Welsh 61628a74fc swf: Rename and organize some util methods
* SwfRead -> SwfReadExt
 * SwfWrite -> SwfWriteExt
 * read_swf_header -> decompress_swf
 * read_swf -> parse_swf
2021-01-20 15:02:31 -08:00
Mike Welsh 19034b76e4 swf: Return slices in swf::Reader
Avoid copies by returning slices of the decompressed input.
2021-01-20 15:02:31 -08:00