Mike Welsh
452ac84f0e
tests: Uncomment Number.POSITIVE_INFINITY/Number.NEGATIVE_INFINITY tests
2020-02-18 10:17:55 -08:00
Mike Welsh
c073afb077
avm1: Use proper value for Number.MIN_VALUE
...
This is the smallest positive number, not the most negative value.
This is actually the smallest positive subnormal f64, which Rust
does not provide a constant for. This is ~5e-324.
2020-02-18 10:17:55 -08:00
Mike Welsh
6bbe1dbab8
avm1: Match Flash when converting exotic numbers to string ( fix #361 )
...
Match Flash's more closely when converting number to string:
* NAN -> NaN
* inf -> Infinity
* -inf -> -Infinity
* Use exponential notation for very large/very small
This is a little bit of a cheat by using Rust's number-to-string
formatting for exponentials, and shoving a sign in front of the
exponent.
2020-02-18 10:17:55 -08:00
Mike Welsh
324dd1c5e4
tests: Add swf_tests_approx macro
...
Use this macro to test numeric calculations that might have some
variance using approx_eq.
2020-02-17 15:42:29 -08:00
Mike Welsh
b6249cdb73
tests: Add localToGlobal/globalToLocal test
2020-02-17 15:42:29 -08:00
Mike Welsh
2af21d87e0
avm1: Implement MovieClip.localToGlobal/globalToLocal
2020-02-17 15:42:29 -08:00
Mike Welsh
ba60f89c28
docs: Add nightly build section
2020-02-17 15:39:43 -08:00
Mike Welsh
b3cfec0852
docs: Add link to wiki for self-hosting instructions
2020-02-17 15:39:43 -08:00
Mike Welsh
23671029a6
docs: Add sponsors to README
2020-02-17 15:39:43 -08:00
Mike Welsh
b8defda7bb
docs: Update AS support info in README
2020-02-17 15:10:31 -08:00
Mike Welsh
cd94486f7e
desktop: Fix stream audio from prematurely ending ( fix #222 )
2020-02-14 20:32:25 -08:00
Mike Welsh
7c406732c7
audio: Ensure stream sounds stop upon goto/loop ( fix #370 )
2020-02-14 20:32:25 -08:00
Mike Welsh
9ad069e11a
avm1: Improve display object property setters for weird values
...
Setting a property such as _x to undefined or null should have no
effect. This was working for v7+ SWFs because it would coerce to
NaN and we toss out NaNs. But on v6 and below, these coerce to 0
and would end up setting the property to 0.
Explicitly check for undefined/null and bail out. Fixes #380 .
Also adjust the _visible setter, since this actually coerces to a
number (because of its legacy from SWFv4). For example,
_visible = "" should have no effect.
2020-02-14 15:34:14 -08:00
Mike Welsh
3a1a73ae11
tests: Add more tests for display object properties
...
Add more _x = weirdo value tests, and copy the test into a v6 SWF.
(because undefined etc. can coerce to 0 instead of NaN in SWFv6).
2020-02-14 15:34:14 -08:00
Mike Welsh
432c605987
chore: Bump glutin/glium/winit to latest versions
...
Closes #371 , #376 .
2020-02-14 13:23:27 -08:00
Mike Welsh
7d14b98f3b
avm1: Ignore undefined values in Color.setTransform
...
If a property is not set on the object passed to Color.setTransform,
then that channel is left unmodified. This fixes invisible objects
in some games (fixes #369 , addresses #380 ).
Also improve handling of wrapping/invalid values to better match the
behavior in the Flash Player (some work pending on #193 ).
2020-02-13 18:06:27 -08:00
Mike Welsh
21f117e7bc
avm1: Add Value::coerce_to_i16
2020-02-13 18:06:27 -08:00
Mike Welsh
19df074a79
tests: Add more tests for AVM1 Color object
...
Include not defined values, wrapping values, invalid values.
2020-02-13 18:06:27 -08:00
Mike Welsh
cc90d7b0ae
chore: Actually don't optimize build dependencies in release profile
...
Previous commit incorrectly set the override in the dev profile.
2020-02-13 15:28:15 -08:00
Mike Welsh
6ea2a55207
chore: Don't optimize build dependencies
...
Rust 1.41 shipped with the ability to specify optimization level
per dependency/dev-dependency.
This speeds up a full release build by ~20% on my machine.
2020-02-12 15:43:58 -08:00
Mike Welsh
560834ff6b
chore: Bump ci to Rust 1.41
2020-02-12 13:54:11 -08:00
dependabot-preview[bot]
d9deaab5f1
build(deps-dev): bump webpack-cli in /web/selfhosted
...
Bumps [webpack-cli](https://github.com/webpack/webpack-cli ) from 3.3.10 to 3.3.11.
- [Release notes](https://github.com/webpack/webpack-cli/releases )
- [Changelog](https://github.com/webpack/webpack-cli/blob/next/CHANGELOG_v3.md )
- [Commits](https://github.com/webpack/webpack-cli/commits )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 01:59:04 +00:00
dependabot-preview[bot]
c7405d6bc0
build(deps): bump image from 0.22.4 to 0.23.0
...
Bumps [image](https://github.com/image-rs/image ) from 0.22.4 to 0.23.0.
- [Release notes](https://github.com/image-rs/image/releases )
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md )
- [Commits](https://github.com/image-rs/image/compare/v0.22.4...v0.23.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 01:33:11 +00:00
dependabot-preview[bot]
fde5e0a730
build(deps-dev): bump webpack from 4.41.5 to 4.41.6 in /web/selfhosted
...
Bumps [webpack](https://github.com/webpack/webpack ) from 4.41.5 to 4.41.6.
- [Release notes](https://github.com/webpack/webpack/releases )
- [Commits](https://github.com/webpack/webpack/compare/v4.41.5...v4.41.6 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 01:25:30 +00:00
dependabot-preview[bot]
6681e843a9
build(deps): bump byteorder from 1.3.2 to 1.3.4
...
Bumps [byteorder](https://github.com/BurntSushi/byteorder ) from 1.3.2 to 1.3.4.
- [Release notes](https://github.com/BurntSushi/byteorder/releases )
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md )
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.3.2...1.3.4 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 00:57:11 +00:00
dependabot-preview[bot]
c17fa52565
build(deps-dev): bump webpack-dev-server in /web/selfhosted
...
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server ) from 3.10.2 to 3.10.3.
- [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.2...v3.10.3 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 00:53:47 +00:00
Mike Welsh
843169d0e8
core: Merge #350 , improved dynamic text support
2020-02-11 16:52:44 -08:00
David Wendt
18516c8eac
Pre-strip HTML from HTML tags, rather than skipping them.
2020-02-03 19:32:05 -05:00
David Wendt
7d225f8b55
Fix overflow when shifting `u8`s
2020-02-03 14:46:36 -05:00
David Wendt
3d6b00c1e4
Impl the remaining text layout properties
2020-02-03 14:46:36 -05:00
David Wendt
517e7ce9ff
Add word-wrap for `measure_text` and caching for word-wrap calculations
2020-02-03 14:46:36 -05:00
David Wendt
5e808c8cd6
Adjust the wordwrap machinery to work in break points (indicies where new lines start) so we can cache them later
2020-02-03 14:46:35 -05:00
David Wendt
fb8664c818
Implement wordWrap and multiline rendering, poorly
2020-02-03 14:46:35 -05:00
David Wendt
7df8eb7674
Impl `is_multiline`'s effect of respecting newlines
2020-02-03 14:46:35 -05:00
David Wendt
f95ec777de
Also impl storage of the `wordWrap` flag
2020-02-03 14:46:34 -05:00
David Wendt
819757e2b6
Fix text measurement now that the underlying SWF tags are correctly parsed as `Twips`.
...
Transform coordinates are always in twips, so we have to convert pixels to twips when evaluating the font, and then convert back when measuring.
2020-02-03 14:46:34 -05:00
David Wendt
63b7d172f4
`TextRecord.height` is also in `Twips`.
...
Notably, the `Text` rendering code does not appear to actually work in pixel scale.
2020-02-03 14:46:34 -05:00
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