David Wendt
fde7715fb8
`EditText.height` is in `Twips`
2020-02-03 14:46:33 -05:00
David Wendt
75022f36d2
Pull `TextFormat` into the `font` module.
...
Also, since there's a separate function for attaching virtual properties to an AVM1 `TextField` object, let's use that!
2020-02-03 14:46:33 -05:00
David Wendt
4b3660bf2c
Impl get/set for `is_multiline`.
2020-02-03 14:46:32 -05:00
David Wendt
c1ff1d94d5
Pull the `EditText.evaluateFont` method into `Font`.
...
`Text` itself doesn't use this method, but it probably could with some changes.
2020-02-03 14:46:32 -05:00
David Wendt
81b7958090
Impl `textWidth` / `textHeight`, although it currently only works well for single-line scenarios.
2020-02-03 14:46:32 -05:00
David Wendt
2181f0d0d0
Impl `getNewTextFormat`/`setNewTextFormat`.
...
These don't actually do anything yet, because we don't track text spans, nor do we actually use those text spans to alter rendering or text layout.
2020-02-03 14:46:30 -05:00
David Wendt
db56217f20
`TextFormat` does *not* coerce `undefined` or `null`; instead those both become `null`.
2020-02-03 14:46:30 -05:00
David Wendt
8449d964ef
Implement `TextFormat` as a property bag.
2020-02-03 14:46:29 -05:00
David Wendt
2b0600ab1a
Impl `createTextField`.
2020-02-03 14:46:29 -05:00
dependabot-preview[bot]
580144d57b
build(deps): bump structopt from 0.3.8 to 0.3.9
...
Bumps [structopt](https://github.com/TeXitoi/structopt ) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/TeXitoi/structopt/releases )
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md )
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.8...v0.3.9 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-01 11:05:33 +00:00
Mike Welsh
2ff76775e0
core: Empty movie clips can not be used as a mask
...
When a movie clip or button is used as a mask, the masking will be
disabled if that object has no children; the maskee will be
completely visible. An empty movie clip inside an empty movie clip
successfully masks.
An EditText can also not be used as a masker (although it can be
wrapped inside a movie clip, and then the text successfully masks).
Add a `TDisplayObject::allow_mask` trait method that will
return whether the object can be used as a mask.
This fixes characters not being visible in Dad 'n' Me.
2020-02-01 01:15:31 -08:00
Mike Welsh
6b7966f3fc
chore: Update comments in canvas mask rendering
2020-01-31 20:27:24 -08:00
Mike Welsh
2e304a81ef
core: Flag as transformed-by-script after swapDepths
2020-01-31 19:44:42 -08:00
Mike Welsh
a55a378a73
avm1: Improve comments in MovieClip depth methods
2020-01-31 19:44:42 -08:00
Mike Welsh
4d1f7c4d4a
tests: Add movieclip depth method tests
2020-01-31 19:44:42 -08:00
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