Commit Graph

1171 Commits

Author SHA1 Message Date
Mike Welsh a4e175a790 avm1: Implement MovieClip.getNextHighestDepth 2020-01-31 19:44:42 -08:00
Mike Welsh 4d12cd1566 avm1: Implement MovieClip.getDepth 2020-01-31 19:44:42 -08:00
Mike Welsh 9e337ede34 avm1: Implement MovieClip.swapDepths 2020-01-31 19:44:42 -08:00
dependabot-preview[bot] 2f98fd1a0e build(deps-dev): bump webpack-dev-server in /web/selfhosted
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.10.1 to 3.10.2.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.10.1...v3.10.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 19:44:42 -08:00
dependabot-preview[bot] 9d950e3705 build(deps-dev): bump webpack-dev-server in /web/selfhosted
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.10.1 to 3.10.2.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.10.1...v3.10.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 19:05:42 +00:00
Mike Welsh 0d91fb423e core: Goto only runs if frame is an integer 2020-01-30 15:17:01 -08:00
Mike Welsh c079cb3bca core: Don't run frame actions when seeking past end of timeline
If you goto past the final loaded frame of a timeline, for example,
with gotoAndStop(9999), this seeks to the final frame on the
timeline, but it doesn't run the actions on this frame.

MovieClip::goto_frame now will not run the final frame actions if
the target frame was not reached.
2020-01-30 15:17:01 -08:00
Mike Welsh 8aae07bbf3 core: Frame labels are case insensitive 2020-01-30 15:17:01 -08:00
Mike Welsh a835573f3c tests: Add test for global GotoFrame action 2020-01-30 15:17:01 -08:00
Mike Welsh 62467bb880 avm1: Handle invalid parameters in GotoFrame2
Use the same code path for the global GotoFrame2 action and
MovieClip.gotoAndX, which properly handles out-of-range and invalid
values like NaN.

Fixes Disorderly hanging on game start
(https://www.newgrounds.com/portal/view/121896)
2020-01-30 15:17:01 -08:00
Mike Welsh 3ab0d4ef80
web: Merge #352, improved performance on canvas
Shape-drawing performance improvements on the canvas backend.
2020-01-30 15:16:09 -08:00
dependabot-preview[bot] cf2d29f65a build(deps): bump indicatif from 0.13.0 to 0.14.0
Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 17:42:12 +00:00
Mike Welsh 087f15f28c web: Clear audio decoding buffer before each decode (fix #357) 2020-01-29 12:29:54 -08:00
David Wendt abedb1262a Make sure `DrawImage` commands get the image filter. 2020-01-29 14:19:19 -05:00
David Wendt 30fc56649b Clamp u8 values to the [0, 255] range. 2020-01-29 14:19:19 -05:00
David Wendt a57d0e12b3 Do not apply a color filter at all unless rendering a bitmap or gradient.
This significantly improves render times, as browsers appear to apply filters in the most general, inefficient way possible.
2020-01-29 14:19:18 -05:00
David Wendt 746971e38a Avoid unnecessary calls to `set_attribute`/`set_filter`. 2020-01-29 14:19:18 -05:00
David Wendt 693537a294 Line widths and miter limits should be in pixels, not twips 2020-01-29 14:19:18 -05:00
David Wendt b611067bc5 First pass on a more-optimized render path that uses canvas draw commands directly rather than precompiling SVGs as images. 2020-01-29 14:19:18 -05:00
David Wendt 4ee60d9214 Make `swf_shape_to_svg` output the entire `ShapeData` list itself, and also it's not called that anymore. 2020-01-29 14:19:18 -05:00
David Wendt 70cdcb60a7 Break shape data up into a series of canvas commands, including direct fills and strokes. 2020-01-29 14:19:18 -05:00
dependabot-preview[bot] dc8858505d build(deps): bump smallvec from 1.1.0 to 1.2.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.1.0...v1.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 18:42:28 +00:00
Mike Welsh 003cc414aa core: Create clips in execution order during a goto
The list of goto commands is now a Vec that will already be in order
of creation. This ensures that subsequent ActionScript in these clips
runs in the correct order.
2020-01-28 04:15:08 -08:00
Mike Welsh 81a1c05682 tests: Add goto_execution_order2 regression test
Tests execution order of children added during a goto.
2020-01-28 04:15:08 -08:00
Mike Welsh 7532e89aff avm1: Use `resolve_target_display_object` in `Color`
Fixes the boss damage blinking in Alien Hominid. Target was a path
string.
2020-01-27 23:35:41 -08:00
Mike Welsh 69f19f03c4 avm1: Output trace warning for invalid SetTarget (fix #332) 2020-01-27 23:35:41 -08:00
Mike Welsh a0032b9aa1 avm1: Better handling of movie clip paths strings (fix #317)
Ops and functions that take a movie clip path in String form have
a very forgiving syntax. These include:
 * `SetTarget`
 * `CloneSprite`
 * `RemoveSprite`
 * `swapDepths`

This change adds `Avm1::resolve_target_display_object` to parse
these paths correctly, along with `target_paths` test to test a
wide variety of formats.

This also applies to `GetVariable`/`SetVariable`, which accept
target paths to variables and is used by some SWF4/5 content.
(fixes #324, #337).
2020-01-27 23:35:41 -08:00
Mike Welsh 2751b89d4e avm1: Root clip should not have a name
Previously we set the name of the root clip to `_level0`. Top-level
clips should actually have no name (`_root._name` returns `""`).

However, when constructing a dot path, `_level0` still gets inserted
by `DisplayObject::path` for the top-level, so that `trace(_root)`
still correctly prints `_level0`.

TODO: When `loadMovieNum` gets merged in, the proper level # needs
to be returned by `.DisplayObject::path`.
2020-01-27 23:35:41 -08:00
Mike Welsh 0446644742 tests: Add target_path test 2020-01-27 23:35:41 -08:00
Mike Welsh f29cb8793c
avm1: Merge #149, Function methods
Implements Function and associated methods
2020-01-27 20:45:59 -08:00
David Wendt db51ec9e3c Implement a separate `Object` impl for functions that holds an `Executable`. 2020-01-27 21:57:32 -05:00
David Wendt 8eeb9a5c60 This technically isn't a test of `toString`, so remove stuff from the test that it relies upon. 2020-01-27 21:50:11 -05:00
David Wendt d217f51c6c Don't crash if `Function.prototype.call` is called without arguments. 2020-01-27 21:50:10 -05:00
David Wendt 0470b8d0a7 Add a test for `Function.call` and `Function.apply` 2020-01-27 21:50:10 -05:00
David Wendt 2c0d892154 Implement Function.call/apply 2020-01-27 21:50:09 -05:00
Mike Welsh 1223de9e94 web: Draw masks with 100% alpha (fix #348) 2020-01-22 12:08:57 -08:00
Mike Welsh 4b7bac706b avm1: ActionNewMethod supports auto-boxing values
This allows `new ("FOO".bar)()`, although there is probably no
good reason to do this. :-)
2020-01-21 18:24:49 -08:00
Mike Welsh 70bec9437f tests: Boolean() returns undefined 2020-01-21 18:24:49 -08:00
Mike Welsh d9e7a6a960 avm1: Implement Boolean class 2020-01-21 18:24:49 -08:00
Mike Welsh e71099edd5 tests: Add primitive_type_globals test 2020-01-21 18:24:49 -08:00
Mike Welsh 8263d13fd0 avm1: Implement Number class 2020-01-21 18:24:49 -08:00
Mike Welsh b49357e46f avm1: Boxing a value calls the object constructor 2020-01-21 18:24:49 -08:00
Mike Welsh ccf62979a1 avm1: Implement String methods 2020-01-21 18:24:49 -08:00
Mike Welsh 5f12ce78b6 tests: Add string method tests 2020-01-21 18:24:49 -08:00
David Wendt 2f9d50cdb8 Very rudimentary/basic/not-good implementation of `String`, plus auto-boxing for primitive strings getting their methods taken. 2020-01-21 18:24:49 -08:00
David Wendt 4d1e49882b Add another object class for boxed primitive values, because the language demands it. 2020-01-21 18:24:49 -08:00
dependabot-preview[bot] 92c1abdcd9 build(deps): bump csv from 1.1.2 to 1.1.3
Bumps [csv](https://github.com/BurntSushi/rust-csv) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/BurntSushi/rust-csv/releases)
- [Commits](https://github.com/BurntSushi/rust-csv/compare/1.1.2...1.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-21 18:56:34 +00:00
Mike Welsh 13b4cd4c1b avm1: Add Value::coerce_to_i32/u32/u16 methods
Add these methods that will explicilty coerce a value to an int,
following the wrapping behavior in the ECMAScript specs (ToInt32,
ToUInt32, ToUInt16).

This also fixed an off-by-one error for negative numbers in the
previous implementation.

These will call `valueOf` if necessary. AVM code that requires an
integer will probably use one of these (`coerce_to_i32` usually).
2020-01-20 13:28:27 -08:00
dependabot-preview[bot] 87e96212e4 build(deps): bump syn from 1.0.13 to 1.0.14
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.13 to 1.0.14.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.13...1.0.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 18:56:56 +00:00
dependabot-preview[bot] fdc37ec44f build(deps): bump structopt from 0.3.7 to 0.3.8
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 07:24:58 +00:00