relrelb
50a4643253
swf: Number enum VideoDeblocking
2021-06-07 11:29:28 -07:00
relrelb
636775f1e2
swf: Number enum TextGridFit
2021-06-07 11:29:28 -07:00
relrelb
a45fdba4d1
swf: Number enum FontThickness
2021-06-07 11:29:28 -07:00
relrelb
88b6632188
swf: Number enum TextAlign
2021-06-07 11:29:28 -07:00
relrelb
781e3ff0cd
swf: Number enum AudioCompression
2021-06-07 11:29:28 -07:00
relrelb
ee14945974
swf: Number enum LineCapStyle
2021-06-07 11:29:28 -07:00
relrelb
f6d04061b0
swf: Number enum GradientSpread
2021-06-07 11:29:28 -07:00
relrelb
fed4facd8a
swf: Number enum SoundEvent
2021-06-07 11:29:28 -07:00
relrelb
0d279a05c2
swf: Number enum BlendMode
2021-06-07 11:29:28 -07:00
relrelb
72113dbcf2
swf: Number enum Language
2021-06-07 11:29:28 -07:00
relrelb
f82faf9603
chore: Appease clippy
2021-06-05 10:16:00 -07:00
Mike Welsh
2b98c878f0
swf: Use Fixed in more places
2021-05-30 21:24:03 -07:00
Mike Welsh
e1439f4105
swf: Add HeaderExt struct providing additional info
...
When reading an SWF, search for FileAttributes and
SetBackgroundColor and return this along with the header data
because it's useful (in particular, the AS3 flag).
2021-05-23 23:02:38 -07:00
Mike Welsh
8960414436
swf: Use bitflags for FileAttributes
2021-05-22 15:53:02 -07:00
dependabot[bot]
185a4f5b8f
chore: Bump lzma-rs from 0.1.3 to 0.2.0
...
Bumps [lzma-rs](https://github.com/gendx/lzma-rs ) from 0.1.3 to 0.2.0.
- [Release notes](https://github.com/gendx/lzma-rs/releases )
- [Changelog](https://github.com/gendx/lzma-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/gendx/lzma-rs/compare/v0.1.3...v0.2.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 15:37:29 -07:00
Mike Welsh
0552d26551
core: Use Fixed8 and i16 for ColorTransform
...
Use the proper types for ColorTransform:
* Fixed8 (8.8) format for multiplicative component
* i16 format for additive component
This matches the behavior of Flash (for example, alpha only changes
in units of 1/256).
2021-04-19 15:47:52 -07:00
Mike Welsh
b9d84c0a82
chore: Appease clippy
...
Honor the branches-sharing-code lint.
2021-04-15 00:02:27 -07:00
relrelb
20d6fcc128
chore: Remove unnecessary type annotations
2021-04-10 18:39:16 -07:00
CUB3D
d5c2e5559b
avm2: Don't mutably borrow for pos()
2021-04-03 16:37:47 -06:00
Mads Marquart
66f5c856d7
swf: Make a few functions const
2021-02-27 17:04:42 -08:00
Mads Marquart
1455671cd7
swf: Change read_tag_with_code to take an already parsed tag
2021-02-27 17:04:42 -08:00
Mads Marquart
9243010cc0
swf: Clean up a few imports
2021-02-27 17:04:42 -08:00
Mads Marquart
24780003e7
swf: Deduplicate different read methods
2021-02-27 17:04:42 -08:00
Mike Welsh
3099914374
chore: Appease clippy
2021-02-27 16:10:46 -08:00
David Wendt
92bfc18e1d
swf: Make video-related tags publicly parsable
2021-02-16 19:03:48 -08:00
Mike Welsh
e5fb1f09e7
chore: Appease clippy
...
* #[derive(Collect)] should be before #[collect]
* Replace redunant `&buf[..]` with `buf`
* Changes most cases of UPPERCase to UpperCase
* Allow upper_case_acronym on most SWF types, as they are from
SWF spec/more annoying to change.
2021-02-12 06:32:42 -08:00
TÖRÖK Attila
80b0bd3b33
swf: Add VideoCodec::ScreenVideoV2 variant
2021-02-12 03:37:14 -08:00
Mike Welsh
47f0f980b8
core: Handle PlaceObject tags with malformed clip actions
...
Some SWFs in the wild have PlaceObject tags with ending ClipActions
that are 2 bytes instead of the required 4 bytes (see #2899 ).
Swallow the error in this case so that the tag can run.
2021-02-02 23:56:48 -08:00
Mike Welsh
02d99c3686
core: CSMTextSettings tag alters text hit testing
...
Normally, a hit test on static text will consider the text glyphs.
However, a CSMTextSettings tag can change the text to use the
"advanced rendering engine", which causes hit tests to only consider
the bounds. This is toggled by the "Anti-alias for readibility"
setting in the Flash IDE.
Wire up the CSMTextSettings tag and adjust hit test behavior based
on this flag.
Fixes #2987 .
2021-02-01 17:17:41 -08:00
relrelb
a2dcad683d
swf: Refactor read_tag_list
2021-01-29 13:05:37 -08:00
Mads Marquart
8eddde76a2
swf: Add safe and simpler string parsing
2021-01-28 14:39:35 -08:00
relrelb
19662503ca
swf: Convert ButtonActionCondition to bitflags
2021-01-23 11:59:24 -08:00
relrelb
7f4845d777
swf: Convert ButtonState to bitflags
2021-01-23 11:59:24 -08:00
relrelb
b05c6540e1
chore: Migrate from enumset to bitflags
2021-01-21 16:35:46 -08:00
Mike Welsh
2254589e71
swf: Don't error on focal gradients in DefineShape tags ( fix #2730 )
2021-01-21 15:47:04 -08:00
Mike Welsh
66256dd3be
swf: SwfStr no longer contains encoding
...
SwfStr is now an unsized slice analogous to `str` or `bstr`.
The desired encoding must be supplied when converting to String.
2021-01-20 15:02:31 -08:00
Mike Welsh
700c3c1767
chore: Appease clippy
2021-01-20 15:02:31 -08:00
Mike Welsh
303a2620a7
swf: Fix uncompressed length check
2021-01-20 15:02:31 -08:00
Mike Welsh
c063264d1c
swf: Use bitstream_io
2021-01-20 15:02:31 -08: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
1d9c11e145
swf: Add SwfStr type to handle encodings in SWF<6
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
Mike Welsh
bf94f5dbaa
swf: Split out bit i/o into SwfBitsReader/Writer types
2021-01-20 15:02:31 -08:00
Mike Welsh
da1e2801a2
chore: Appease clippy
2021-01-18 21:23:50 -08:00
MrCheeze
5915f2a841
core: Return uncompressed length for getBytesLoaded/Total
2021-01-09 14:29:19 -08:00
Mike Welsh
7cf217a911
swf: Use lzma-rs for LZMA SWFs ( fix #405 )
...
Pure Rust decoder that functions on desktop and wasm.
Enable lzma feature by default.
TODO: Switch to lzma-rs streaming API when stable on crates.io.
Currently decodes entire stream at once.
2020-12-17 16:40:21 -08:00
Mike Welsh
cec0ca74e1
chore: Fix swf doctests working directory
...
Rust 12-09 nightly changed the working dir of doctests to be the
workspace root instead of the subcrate root. This broke the
doctests for swf. Now do some setup to ensure the same working
directory on both stable and nightly.
cc https://github.com/rust-lang/cargo/pull/8954
2020-12-10 12:25:02 -08:00
Mike Welsh
53212f192c
chore: Appease clippy, squelch unnecessary_wraps lint
2020-11-24 18:59:42 -08:00
Mike Welsh
eb0b16790c
swf: Allow construct clip events in SWFv6
2020-11-22 19:34:29 -08:00
relrelb
083e2a2ff5
core: Implement getBytes{Loaded,Total} (simpler approach)
2020-10-23 13:13:00 -07:00