Commit Graph

3890 Commits

Author SHA1 Message Date
David Wendt 155672d482 core: Remove AS3-related `coerce_to_object` calls in `MovieClip` 2022-04-24 16:54:19 -07:00
David Wendt fe50e98f87 avm2: Remove `coerce_to_object` calls in `flash.text.TextField` 2022-04-24 16:54:19 -07:00
David Wendt afdae1f6c6 avm2: Remove `coerce_to_object` calls in `flash.media.Sound` 2022-04-24 16:54:19 -07:00
David Wendt 818526069e avm2: Remove `coerce_to_object` calls in `flash.events.MouseEvent` 2022-04-24 16:54:19 -07:00
David Wendt 5dc5ca06e3 avm2: Remove `coerce_to_object` calls in `flash.events.EventDispatcher` 2022-04-24 16:54:19 -07:00
David Wendt 4c736094c1 avm2: Remove `coerce_to_object` calls in `flash.display.Stage` 2022-04-24 16:54:19 -07:00
David Wendt cbc9937fcf avm2: Remove `coerce_to_object` calls in `flash.display.SimpleButton` 2022-04-24 16:54:19 -07:00
David Wendt 40ecae28d0 avm2: Remove `coerce_to_object` in `flash.display.MovieClip` 2022-04-24 16:54:19 -07:00
David Wendt 85b598a8da avm2: Remove `coerce_to_object` calls in `flash.display.DisplayObjectContainer` 2022-04-24 16:54:19 -07:00
David Wendt 7e7ee14d3b avm2: Remove `coerce_to_object` calls in `flash.display.DisplayObject`. 2022-04-24 16:54:19 -07:00
David Wendt 5f5f98ecdc avm2: Remove `coerce_to_object` calls in `flash.display.Bitmap` 2022-04-24 16:54:19 -07:00
David Wendt 5b5313bf95 avm2: Remove `coerce_to_object` calls in `String` impls 2022-04-24 16:54:19 -07:00
David Wendt e851b73570 avm2: Remove calls to `coerce_to_object` in `JSON` impls 2022-04-24 16:54:19 -07:00
David Wendt 88f4ebc2a3 avm2: Remove calls to `coerce_to_object` in `Function` impls 2022-04-24 16:54:19 -07:00
David Wendt 26e65368df avm2: Remove `coerce_to_object` calls in `Array` where possible, and replace with more descriptive error messages otherwise 2022-04-24 16:54:19 -07:00
David Wendt 1383901a94 avm2: Remove unnecessary usage of `coerce_to_object` in `avm2::globals`. 2022-04-24 16:54:19 -07:00
David Wendt 90b239f30d avm2: Add descriptive error messages for when `Vector` methods encounter `null`/`undefined`. 2022-04-24 16:54:19 -07:00
David Wendt e486efb4c6 avm2: Remove unnecessary usage of `coerce_to_object` in `ClassObject`. 2022-04-24 16:54:19 -07:00
David Wendt 0f2b77c138 avm2: Alter basic object operations to use more descriptive error messages. 2022-04-24 16:54:19 -07:00
David Wendt 4185acc5a8 avm2: Remove unnecessary usage of `coerce_to_object` in `avm2::events`. 2022-04-24 16:54:19 -07:00
David Wendt bb70086238 avm2: Replace a number of `coerce_to_object` calls with the previous commits' new messages as appropriate 2022-04-24 16:54:19 -07:00
David Wendt bea6744682 avm2: Add methods to `Value` and `Activation` for performing common coercions and returning a relevant error if they fail.
Those methods are:

 * `Value.coerce_to_receiver`: coerce to object for receivers
 * `Value.as_callable`: as_object for callables
 * `Activation.superclass_object`: get superclass of currently-called object
 * `Activation.resolve_class`: resolve scope value, unwrap `ClassObject`, and error out if either step fails

This accounts for ~80% of coercion-related errors in `Activation`.
2022-04-24 16:54:19 -07:00
David Wendt 2ec606c5cb avm2: Add utilities for formatting `Multiname`s and class instances' names. 2022-04-24 16:54:19 -07:00
relrelb 3dbde841df avm1: Remove `TObject::type_of`
It can be simply determined in `Value::type_of`.
2022-04-23 17:55:48 -07:00
Daniel Jacobs aa92c3c1bc core: scale_mode -> window_mode for set_window_mode 2022-04-22 19:31:23 +03:00
Mike Welsh e2e7ad0df2 avm2: Implement `flash.ui.Keyboard`
Add `Keyboard` key code constants and stub out other properties.
2022-04-21 21:40:04 -07:00
Mike Welsh 1cb3d389e8 core: Add some KeyCode variants 2022-04-21 21:40:04 -07:00
TÖRÖK Attila 7cbba5bc8f avm2: Stub flash.accessibility.AccessibilityProperties 2022-04-19 09:55:09 -07:00
relrelb 25d47da528 render: Improve CMYK to RGB conversion
Use integer arithmetic, which is more accurate and efficient.
2022-04-18 22:00:48 -07:00
Mike Welsh cdccc2a2db avm1: Array.sortOn does not inspect proto or virtual properties
`Array.sortOn` only looks at raw properties and does not inspect
the prototype chain or call virtual properties.
2022-04-18 08:34:04 -07:00
Mike Welsh 3305ac69c4 web: Support wmode parameter 2022-04-17 08:33:51 -07:00
relrelb 87e85e16da render: Make `rgb5_component` a lambda
This way the `compressed` parameter becomes implicit.
2022-04-16 13:52:59 -07:00
relrelb 8feeadf578 render: Use `std::borrow::Cow`
Also apply some nearby refactors.
2022-04-16 13:52:59 -07:00
relrelb eeaec947b3 render: Remove unneeded `pub`s
And remove the dead `glue_swf_jpeg_to_tables` function.
2022-04-16 13:52:59 -07:00
relrelb 9b4108444f render: Strip 16-bit PNG samples to 8-bit
PNGs with 16-bit samples were not being normalized to 8-bit, screwing up their
appearance.

Add the `STRIP_16` transformation using `Transformations::normalize_to_color8()`,
which is equivalent to `Transformations::EXPAND | Transformations::STRIP_16`.
Also warn in case `png` outputs a color type other than `Rgb` and `Rgba`.
Due to the `EXPAND` transformation, this may be only `Grayscale` or
`GrayscaleAlpha`. `Indexed` is converted to either `Rgb` or `Rgba`.

Fixes #6662.
2022-04-16 12:45:55 -07:00
Mike Welsh bce9398c0d avm1: Add Accessibility stub 2022-04-16 09:05:16 -07:00
Toad06 b2b1b5fa25 avm1: Correct `Add`, `Equals`, `Less` and `GetProperty` actions 2022-04-13 22:00:25 -07:00
Mike Welsh 146b8adc68 swf: Clean up LineStyle
* Remove LineStyle::color, instead using fill_style with
   FillStyle::Color to indicate solid color.
 * Store `flags` in the struct instead of separate bools/values.
 * Add getters/setters for ease of use.
 * Add builder-style methods for setting LineStyle properties.
 * Fix misnamed ALLOW_CLOSE flag to NO_CLOSE.
2022-04-11 22:50:40 -07:00
Mike Welsh c0dff98d84 chore: Fix len_zero warning in symphonia Mp3Decoder 2022-04-11 20:15:13 -07:00
Mike Welsh 24f00238a7 audio: Fix symphonia feature
This feature stopped building with the bump to symphonia 0.5, which
added a `Sync` bound to its traits.

 * Add `Sync` bounds to our own internal audio traits to match.
 * nellymoser::Decoder was also tweaked to add a Sync bound.
 * Lock the nellymoser dependency to a specific git commit.
2022-04-11 15:25:15 -07:00
dependabot[bot] a5f7fccca2 build(deps): bump quote from 1.0.17 to 1.0.18
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.17 to 1.0.18.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.17...1.0.18)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 13:51:20 -07:00
dependabot[bot] 5973ecc7d9 build(deps): bump flate2 from 1.0.22 to 1.0.23
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.22 to 1.0.23.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.22...1.0.23)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 13:51:09 -07:00
Toad06 c6c1f553d5 avm1: Correct `Action::RandomNumber` 2022-04-11 11:02:08 -07:00
Toad06 e2528b04a7 avm1: Coerce booleans to `"1"` or `"0"` in SWFv4 2022-04-10 20:03:39 -07:00
Toad06 b221485288 avm1: Fix `Action::Divide` in SWFv4 2022-04-09 23:17:39 -07:00
Mike Welsh 91346f5fad avm1: Format floating-point numbers
Co-authored-by: Toad06 <gd.productions@laposte.net>
2022-04-09 22:40:59 -07:00
Mike Welsh 478f970fc8 chore: Appease clippy 2022-04-09 18:23:51 -07:00
Aaron Hill d7532ae654 avm2: Add stubs for `BitmapFilter`, `GlowFilter`, and `DisplayObject.filters`
This gets 'Rolling Hero' further in the startup process,
since it just tries to set a filter on an object.
2022-04-08 16:53:16 -07:00
relrelb ad42b9908f xml: Refactor `XmlNode` creation methods
Unify the previous 3 creation methods to a single `XmlNode::new`.
This allows supporting arbitrary `nodeType` values passed to the
`XMLNode` constructor.
2022-04-08 16:34:57 -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